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 / Mailmerge and Fax / June 2007

Tip: Looking for answers? Try searching our database.

Listing the merge variables from all the dot documents

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
PRaveen - 04 Jun 2007 19:09 GMT
Hi...All,

  I am a newbie to the Word Merge.
 I have close to 250 .dot documents & I have to find out all the variables
that are used in these documents to do the merge.  It will take time for me
to open each one of them & find the variables (and I might miss some too).

Which is the easiest way to process the documents & list the variables.
Secondly the variables are marked {{home_address1}}

Regards,

Praveen
Peter Jamieson - 05 Jun 2007 10:15 GMT
> Secondly the variables are marked {{home_address1}}

Your "fields" look non-standard.

A standard Merge field would look like { MERGEFIELD home_address1 }, and a
local REF field would look like { REF home_address1 } or { home_address1 },
with the {} being the special field braces you can insert using ctrl-F9.

So are your "fields" just pieces of text that are processed by some existing
program? Do they start with two /ordinary/ {{ characters and end with two
ordinary }} characters?

Either way, you could start by adapting the macro at
http://word.mvps.org/FAQs/MacrosVBA/BatchFR.htm, but to look through every
part of a document (main body, headers, footers etc.) in the middle of that
you need a loop that does...

Dim objRange as Word.Range
For each objRange in ActiveDocument.StoryRanges
   Do
     ' whatever it is that you need to do
      Set objRange = objRange.NextStoryRange
   Loop until objRange is Nothing
Next

(Although you would need more than that to detect fields and text contained
in objects such as text boxes, other shapes, and frames).

Peter Jamieson
> Hi...All,
>
[quoted text clipped - 10 lines]
>
> Praveen
 
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.