Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
{ 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
|
|||
|
|||
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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to retain formatting when using IncludeText in Merge? | Mailmerge | |||
How to creat relative and shorthand file path names? | Microsoft Word Help | |||
Multiple merge with IncludeText generating extraneous hidden chara | Mailmerge | |||
Includetext Merge Field | Mailmerge | |||
Home Phone field not getting picked up in Merge | Mailmerge |