|
-
Mar 27th, 2007, 01:57 PM
#1
Thread Starter
New Member
Opening a series of Word docs using VBA
I am trying to create a macro that will import various elements from previous Word documents into a new Word document. A little bit of background is necessary in order to explain the problem. Over time, a number of Word documents will be generated regarding certain customers. The documents will all have names that contain the customer's name and customer number followed by numbers for the date of the document e.g. "Doe, John 123456_070327" would be a document generated on 3/27/07 about customer number 123456 whose name is John Doe. All of the documents are stored within the same folder.
Frequently, I need to bring information from an earlier note on a given customer into the current note. The various types of info that this might apply to are all bookmarked within the documents but not every note has all of the different types of info/bookmarks. Thus, when trying to bring in the last entry for a certain type of info, it might not be in the newest of the earlier notes. I would like to be able to write code that sequentially searches a given customer's documents (in reverse chronologic order) for the appropriate bookmark in order to bring the info into the current document.
So far, the best I have been able to do is use a built-in wdFileOpen dialog box to bring up the list of documents for the customer and then have the user repeatedly manually choose from the list until a document is found that has the appropriate info/bookmark.
Any help would be much appreciated.
Also, while we are on the subject, is there any way to have the current document that is being worked on excluded from the list of documents in the wdFileOpen dialog box?
Thanks.
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
|