|
-
Aug 1st, 2000, 02:06 AM
#1
Thread Starter
Hyperactive Member
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.
-
Aug 1st, 2000, 02:09 AM
#2
Fanatic Member
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
-
Aug 1st, 2000, 02:22 AM
#3
Thread Starter
Hyperactive Member
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.
-
Aug 1st, 2000, 02:25 AM
#4
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.
-
Aug 1st, 2000, 02:28 AM
#5
Fanatic Member
=/ 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
-
Aug 1st, 2000, 01:46 PM
#6
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|