Reply
 
Thread Tools Display Modes
  #1   Report Post  
Clint Marshall
 
Posts: n/a
Default INCLUDETEXT File is Determined by Merge Field

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



  #2   Report Post  
Peter Jamieson
 
Posts: n/a
Default

{ 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 a
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

"Clint Marshall" wrote in message
...
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





  #3   Report Post  
Clint Marshall
 
Posts: n/a
Default

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!


"Peter Jamieson" wrote in message
...
{ 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 a
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

"Clint Marshall" wrote in message
...
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







Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to retain formatting when using IncludeText in Merge? Gordon Detlor Mailmerge 3 May 18th 05 04:30 AM
How to creat relative and shorthand file path names? 2dogs Microsoft Word Help 1 May 15th 05 12:11 PM
Multiple merge with IncludeText generating extraneous hidden chara Judy Mailmerge 4 May 5th 05 03:51 PM
Includetext Merge Field Jan Mailmerge 1 April 19th 05 01:36 AM
Home Phone field not getting picked up in Merge Cathleen McGuire Mailmerge 4 January 7th 05 03:13 AM


All times are GMT +1. The time now is 11:40 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"