Results 1 to 6 of 6

Thread: Information in a MS-Word document

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    455
    Dear VB users,

    I want to place database information in a MS-Word document.
    The document is already existing and I want to fill in the information.
    What are the possibilities to do that.

    I have used the command: "SendKeys" in my opened Word document but I do think it can be easier.

    Nice regards,

    Michelle.

  2. #2
    Fanatic Member Dim's Avatar
    Join Date
    Jul 2000
    Posts
    620
    Umm...wouldn't it be just like writing to a txt file?
    Code:
    Open "word.doc" For Output As #1
        Print #1, Text1.Text
    Close #1
    Hope that helps,
    D!m
    Dim

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    455
    Hello Dim ,

    Thanks for your reaction, but on the way you are doing all existing information in the MS-Word file will disappear!

    I want to place in a existing Word document the information.

    For example an invoice: Place Name/address/town/description in the existing document.

    Thank for your help,

    Michelle.

  4. #4
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Well ....

    First of all, thanks for calling us 'Dear'!

    I have already helped out two guys with the code for this problem. You can mail me and I shall send you the file. The code is from a book titled 'Building Client-Server Applications with VB 5.0' An updated version with VB6 is also available. If you can get your hands on it, you don't need to mail me for that. Otherwise I shall send it to you in about a couple of days after receiving your mail.

    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

  5. #5
    Fanatic Member Dim's Avatar
    Join Date
    Jul 2000
    Posts
    620
    =/ Well you can replace Output with Append, but it wount organize the new data into proper colums, it will just add it to the end of the file.
    Code:
    OPen "word.doc" For Append As #1
        Print #1, Text1.Text
    Close #1
    Hope that helps,
    D!m
    Dim

  6. #6
    Addicted Member
    Join Date
    Jan 2000
    Location
    Fresno, California, USA
    Posts
    195
    How about using Word templates and the mail merge features of Word? You identify places in the template where you want data base info to go with data field markers, <<FieldName>>. Then in your program, you assign values to the markers and merge. I have posted examples of this in the past. If you would like, I could dig them up for you.

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