Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / December 2004

Tip: Looking for answers? Try searching our database.

Help  Document Merging in Word

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Malik Al-Amin - 08 Dec 2004 01:24 GMT
Here's my situation. I have two documents. 1 is a TraceTree and the other is
a UseCase Document.
The trace tree is formatted like:
ucr100: Client Relationship
ucr100:1 Completed Logon
ucr100: Entitled to run this report

My UseCase is formatted like:
Client Relationship
Completed Logon
Entitled to run this report
   Br6666 The user must have the 'client administrative reports'
entitlement enabled.
   br6656 The report will be part of the report group.

What I'm doing is manually creating a third document. I'm taking the entire
usecase document and looking at the trace tree to see where I need to insert
additional detail from the tracetree to the usecase such as with "ucr100".
When this is the case, I also bold and change the color of the text. This
process is repeated until I've gone through all of the entries on the use
case. I then save this document as a seperate document so as to preserve all
three documents seperately. I want to automate this process but I'm not too
familiar with Word VBA. However I'm comfortable with both Visual Basic and
Access vba. So i don't know if I can open the usecase and loop through each
paragraph in the tracetree searching for my variable. Please I welcome any
advise you may have on this issue.
Jezebel - 08 Dec 2004 02:37 GMT
If you know VB and Access VBA you should have too much trouble with this.
Spend a bit of time with the Object Viewer to get the hang of the Word
object model. The short answer is, yes you can iterate the paragraphs --

Dim pPar as Word.Paragraph
Dim pTreeDoc as Word.Document
Dim pUseDoc as Word.Document

Set pTreeDoc = Documents.Open("C:\....")
Set pUseDoc = Documents.Open("C:\....")

For each pPar in pUseDoc.Paragraphs
   ...

But given that your source documents appear to be well-structured, it might
be simpler to create an array or collection of the Tree items, then iterate
that searching for the corresponding text in the usecase doc. Apart from
iterating the paragraphs, you can use Word's own Find function, or you can
use VB functions like Instr() operating on the body of the document as a
whole.

> Here's my situation. I have two documents. 1 is a TraceTree and the other is
> a UseCase Document.
[quoted text clipped - 22 lines]
> paragraph in the tracetree searching for my variable. Please I welcome any
> advise you may have on this issue.
Malik Al-Amin - 08 Dec 2004 03:28 GMT
Thanks for the feedback. I'll try your suggestion tomorrow. I'm comfortable
with VB/VBA but just unfamiliar with the word object model. But like you
suggested, I'll spend some time with the object browser and familiarize
myself with it and give it a shot. Again, thanks

Malik
> If you know VB and Access VBA you should have too much trouble with this.
> Spend a bit of time with the Object Viewer to get the hang of the Word
[quoted text clipped - 54 lines]
>> any
>> advise you may have on this issue.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.