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 2005

Tip: Looking for answers? Try searching our database.

INCLUDETEXT File is Determined by Merge Field

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Clint Marshall - 01 Jun 2005 19:03 GMT
   I'm trying to create a Mail Merge where I get my merge fields from an
Access Query.  I'm using Word XP and Access XP.
   Several items that I want to merge are actually large sections of
"boilerplate" text that exist as their own Word Documents (picture a lease
with sections of boilerplate specific to each property being leased).
   How can I specify in/to the merge which piece of boilerplate (which word
document) to merge in?  The fields in Access could be text fields or
hyperlinks, of the form: "S:\Forms\Lease Forms\lsefrms\5MILK.DOC".
   I've tried various formats, such as: "{INCLUDETEXT {MERGEFIELD
linktofile}\* MERGEFORMAT}", but get an error of:  "Error! Filename not
specified.".
   I used to do this with fields full of "If" statements in the merge
document, but this is what I'm trying to get away from by moving to an
Access Query.  Is there any way to do a merge and include the contents of
another Word document?
   Thank you for any thoughts!

-Clint Marshall

Peter Jamieson - 01 Jun 2005 20:25 GMT
{ INCLUDETEXT "{ MERGEFIELD linktofile }" }

should be enough, but
a. all the {} have to be the field braces you can insert using ctrl-F9
b. you may need to double up all the backslashes in the file names to make
it work (I believe this varies depending on the version of Word and
Windows).
c. Access hyperlink fields probably won't work as they have a format
something like

displaytext#linktext

You can extract the linktext in an Access query - e.g. if the hyperlink
column is called h, your query SQL could be something like

SELECT  Mid(h, instr(1, h, '#') + 1, Len(h) - instr(1,h,'#') - 1) as
hyperurl, * FROM mytable

Other things you may be able to consider are:
 just putting a filename (not a pathname) in the data source, and
hard-coding the rest of the pathname in the document, e.g.

{ INCLUDETEXT "S:\\Forms\\Lease Forms\\lsefrms\\"{ MERGEFIELD
myfilename }" }

or putting all your texts in a single Word file and bookmarking the sections
you need, e.g.

{ INCLUDETEXT "S:\\Forms\\Lease Forms\\lsefrms\\myfile.doc" "{ MERGEFIELD
mybookmarkname }" }

Peter Jamieson

>    I'm trying to create a Mail Merge where I get my merge fields from an
> Access Query.  I'm using Word XP and Access XP.
[quoted text clipped - 14 lines]
>
> -Clint Marshall
Clint Marshall - 01 Jun 2005 22:16 GMT
Thank you, Peter.

Lots of good ideas, none of which quite worked.

In the end, I've had to include four backslashes to make it work - no idea
why!  But it's running now!

Thanks!

>{ INCLUDETEXT "{ MERGEFIELD linktofile }" }
>
[quoted text clipped - 48 lines]
>>
>> -Clint Marshall
 
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.