-
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.
-
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
-
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.
-
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.
-
=/ 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
-
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.