CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2012
    Posts
    8

    Red face Word App: To generate the word doc

    Hye guys,

    Needing you help.

    I want to print out the word document for the information in my database. Basically, I have 1 tables in 1 database.

    First table:
    DEFINE_VERIFY_ROOT_CAUSE_FINDINGS (field's name)
    (1)hye(2)zack(3)nick(4)and(5)aaron - in one row

    I have no problem to print out the 'word app' for the words/sentence for the first table using :
    .Selection.TypeText Text:=NullReturnTEXT(rst("DEFINE_VERIFY_ROOT_CAUSE_FINDINGS"))

    But, im do not know how to print out the sentence separately. eg:
    (1)hye
    (2)zack
    (3)nick
    (4)and
    (5)aaron

    Hope u guys could help.

  2. #2
    Join Date
    Aug 2009
    Posts
    100

    Re: Word App: To generate the word doc

    In the event that the string "Hey Zack Nick and Sharon" is in one field (you didn't specify), you could bring the string into a string variable and then use the Replace function to replace the space with vbcrlf:

    Code:
    REPLACE(strInStringFromDB," ",vbcrlf)
    If they are in separate fields, you could bring them into the same string and then insert the line feed:

    Code:
    strInStringFromDB = rs!Hey & vbcrlf & rs!Zack & vbcrlf & rs!Nick & vbcrlf & rs!and & vbcrlf & rs!Aason
    If it's something more complicated than that, we need more detailed information from you in order to help.

  3. #3
    Join Date
    Mar 2012
    Posts
    6

    Re: Word App: To generate the word doc

    Or you may check this data export(A free edition available): http://www.e-iceblue.com/Introduce/d...net-intro.html It can help you export data from datatable to Word/Excel/PDF in your .NET application.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured