cbitservices
asked on
Transferring data directly into a Word document using VB
I have a program which uses an Access database and I want to be able to "transfer" data from the database directly into the a new Word document after it has opened the program. I am fairly sure that this should be an easy thing to do and hopefully lots of you know the answer! Thanks in advance for all suggestions.
Cheers,
Colin.
Cheers,
Colin.
You will need to use the Microsoft Word Object Library. This is available as one of your references in VB. Once you careate an instance of this, you will be able to create word documents. This will give you the full functionality of Word itself. You can record a macro in Word and then go back in and view it. You can then use this code within VB to generate it.
ASKER
Where can I get information on using the library? Thanks,
Colin.
Colin.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
OK, I now understand that I can use Word object library, but it would be helpful if anyone could tell me where to get the information on how to use it! Thanks,
Colin.
Colin.
ASKER
I have worked out some of the properties and methods but a reference would be handy; any ideas? Thanks,
Colin.
Colin.
Well, what is your data?, where is saved? a recordeset?, directly from a table?
How do you want to populate word document?
How do you want to populate word document?
ASKER
Hi Richie,
I have already got it working to place data into the document from the database, etc., however, what I would like to know is whether there is a "Reference" anywhere for the methods and properties of the Word object, so that I could use the various facilities of the object more efficiently. If you know of such a thing please let me know. Thanks.
Regards,
Colin.
P.S. I will accept your comment as an answer and will post this as another question, so you will earn more points if you can help further. Thanks.
I have already got it working to place data into the document from the database, etc., however, what I would like to know is whether there is a "Reference" anywhere for the methods and properties of the Word object, so that I could use the various facilities of the object more efficiently. If you know of such a thing please let me know. Thanks.
Regards,
Colin.
P.S. I will accept your comment as an answer and will post this as another question, so you will earn more points if you can help further. Thanks.
ASKER
I need reference material on the Word object. I have posted another question for this.
you could see it at MSDN (on cd or microsoft site).
There is a bunch of resources at web. Just do a search in www.google.com with "word+com+visual+basic"
There is a bunch of resources at web. Just do a search in www.google.com with "word+com+visual+basic"
Thanks for "A" grade!
http://www.tfwpa.com/msaccess/wordmerge.htm
http://www.planet-source-code.com/xq/ASP/txtCodeId.1038/lngWId.1/qx/vb/scripts/ShowCode.htm
http://www.vb-world.net/activex/wordreports/index3.html
http://www.freevbcode.com/ShowCode.Asp?ID=2340
http://www.freevbcode.com/ShowCode.Asp?ID=1539
http://www.tfwpa.com/msaccess/wordmerge.htm
http://www.planet-source-code.com/xq/ASP/txtCodeId.1038/lngWId.1/qx/vb/scripts/ShowCode.htm
http://www.vb-world.net/activex/wordreports/index3.html
http://www.freevbcode.com/ShowCode.Asp?ID=2340
http://www.freevbcode.com/ShowCode.Asp?ID=1539