PDA

View Full Version : getting a directory to MS Word automatically



polopolo
07-05-2006, 10:48 PM
I have a visual basic 2005 program that is generating a program directory, foo. I want to get this directory to MS Word 2002 automatically. I can have the program put a *.dot file in the word startup directory, but I can't put the directory foo into this file because I don't know how to edit word templates with visual basic. My other option is to create a *.doc or *.dot file with some macros in it, and have the recipient use the organizer to put the macros in normal.dot. Yet still there is the problem of being unable to put the directory foo into these macros because they are wrapped up in a word document which I can't edit using visual basic. Any ideas?

kingdragonfly
08-05-2006, 03:49 PM
I tried to follow your thread, but I can't make heads-or-tails of it.

What is your ultimate goal for your program? I guess you know that most versions of Word support COM technolgy known as automation, formerly called OLE automation:

Dim docOne as Word.Document
Set docOne = Documents.Open("c:\mydoc.doc")