Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
Hello,
I have a document that needs to pull in other documents based off of what is in the Subject Document Property, and also have the Table of Contents and List of Tables update properly (several headings and tables get included with the inserted document). If I use just the INCLUDETEXT on its own, it seems to work pretty well...the doc is inserted, the headings styles look correct, and the TOC and LOT update properly. My field: { INCLUDETEXT "BASE.doc" } The proper TOC looks similar to: 1.1 Introduction ... 7 1.2 Base Config ..... 7 1.3 Base Config Desc ...8 1.3.1 Desc A ...8 1.3.2 Desc B ...9 However, if I put this INCLUDETEXT inside an IF statement, then things go awry. The first heading in the included doc doesn't come out right, but next heading in the included doc seems all right? The added tables do not show up in the LOT at all when updated. And the TOC is very strange...where the messed up heading occurred, I have something similar to: { if { DOCPROPERTY "Subject" } = "BASE" { INCLUDETEXT "BASE.doc" } } 1.1 Introduction ... 7 1.1 .......... 7 1.1 .......... 7 1.1.1 7 1.1.1 7 1.1.1 7 1.1.1 7 1.1.1 7 1.1.1 7 1.2 Base Config ..... 7 1.3 Base Config Desc ...8 1.3.1 Desc A ...8 1.3.2 Desc B ...9 Beside the fact that this looks odd (should look like example above, w/out the IF), it doesn't match what the doc is actually showing. Help is greatly appreciated! This would be wonderful it would actually work! I saw similar posts, and tried several variations, but didn't find anything that really matched this (or worked). Thanks, SDJWalls |
#2
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
Hi sdjwalls,
What Style is applied to the paragraph the IF field is attached to? A slightly different approach you could take, which avoids the IF field altogether, is to use the DOCPROPERTY field in your target document to refer to different bookmarked ranges in your source document (meaning you'd only need one source document for all the variable boilerplate text) and code the INCLUDETEXT field along the lines of: { INCLUDETEXT "filepath//REFERENCE.doc" { DOCPROPERTY "Subject" } } With this approach, if your source document has a bookmarked range named 'base' and the target document has a DOCPROPERTY "Subject" set to 'Base', the corresponding text will be imported. For this to work, you'll need to have a default bookmark name (even if its range is empty) in the source document for the DOCPROPERTY field to refer. -- Cheers macropod [Microsoft MVP - Word] "sdjwalls" wrote in message ... Hello, I have a document that needs to pull in other documents based off of what is in the Subject Document Property, and also have the Table of Contents and List of Tables update properly (several headings and tables get included with the inserted document). If I use just the INCLUDETEXT on its own, it seems to work pretty well...the doc is inserted, the headings styles look correct, and the TOC and LOT update properly. My field: { INCLUDETEXT "BASE.doc" } The proper TOC looks similar to: 1.1 Introduction ... 7 1.2 Base Config ..... 7 1.3 Base Config Desc ...8 1.3.1 Desc A ...8 1.3.2 Desc B ...9 However, if I put this INCLUDETEXT inside an IF statement, then things go awry. The first heading in the included doc doesn't come out right, but next heading in the included doc seems all right? The added tables do not show up in the LOT at all when updated. And the TOC is very strange...where the messed up heading occurred, I have something similar to: { if { DOCPROPERTY "Subject" } = "BASE" { INCLUDETEXT "BASE.doc" } } 1.1 Introduction ... 7 1.1 .......... 7 1.1 .......... 7 1.1.1 7 1.1.1 7 1.1.1 7 1.1.1 7 1.1.1 7 1.1.1 7 1.2 Base Config ..... 7 1.3 Base Config Desc ...8 1.3.1 Desc A ...8 1.3.2 Desc B ...9 Beside the fact that this looks odd (should look like example above, w/out the IF), it doesn't match what the doc is actually showing. Help is greatly appreciated! This would be wonderful it would actually work! I saw similar posts, and tried several variations, but didn't find anything that really matched this (or worked). Thanks, SDJWalls |
#3
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
Hi macropod,
Thank you so much! By changing the problem around like that, it works very well. I've concatenated my source files and added bookmarks, and it works very well. Everything updates nicely, without styles getting scrambled. A workable work-around. To answer your question, the source docs had a variety of styles. Different headings, body, etc. I had tried setting the style of the field itself, but then when the field was updated, everything imported had that same style without any variation--too flat. So, does this imply that IF really has problems? Seems fine for straight text, but nothing more involved than that? Again-many thanks. sdjwalls "macropod" wrote: Hi sdjwalls, What Style is applied to the paragraph the IF field is attached to? A slightly different approach you could take, which avoids the IF field altogether, is to use the DOCPROPERTY field in your target document to refer to different bookmarked ranges in your source document (meaning you'd only need one source document for all the variable boilerplate text) and code the INCLUDETEXT field along the lines of: { INCLUDETEXT "filepath//REFERENCE.doc" { DOCPROPERTY "Subject" } } With this approach, if your source document has a bookmarked range named 'base' and the target document has a DOCPROPERTY "Subject" set to 'Base', the corresponding text will be imported. For this to work, you'll need to have a default bookmark name (even if its range is empty) in the source document for the DOCPROPERTY field to refer. -- Cheers macropod [Microsoft MVP - Word] "sdjwalls" wrote in message ... Hello, I have a document that needs to pull in other documents based off of what is in the Subject Document Property, and also have the Table of Contents and List of Tables update properly (several headings and tables get included with the inserted document). If I use just the INCLUDETEXT on its own, it seems to work pretty well...the doc is inserted, the headings styles look correct, and the TOC and LOT update properly. My field: { INCLUDETEXT "BASE.doc" } The proper TOC looks similar to: 1.1 Introduction ... 7 1.2 Base Config ..... 7 1.3 Base Config Desc ...8 1.3.1 Desc A ...8 1.3.2 Desc B ...9 However, if I put this INCLUDETEXT inside an IF statement, then things go awry. The first heading in the included doc doesn't come out right, but next heading in the included doc seems all right? The added tables do not show up in the LOT at all when updated. And the TOC is very strange...where the messed up heading occurred, I have something similar to: { if { DOCPROPERTY "Subject" } = "BASE" { INCLUDETEXT "BASE.doc" } } 1.1 Introduction ... 7 1.1 .......... 7 1.1 .......... 7 1.1.1 7 1.1.1 7 1.1.1 7 1.1.1 7 1.1.1 7 1.1.1 7 1.2 Base Config ..... 7 1.3 Base Config Desc ...8 1.3.1 Desc A ...8 1.3.2 Desc B ...9 Beside the fact that this looks odd (should look like example above, w/out the IF), it doesn't match what the doc is actually showing. Help is greatly appreciated! This would be wonderful it would actually work! I saw similar posts, and tried several variations, but didn't find anything that really matched this (or worked). Thanks, SDJWalls . |
#4
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
Hi sdjwalls,
I don't believe it was the IF field, per se, that was the problem but, more likely, the Style of the paragraph you had it attached to. -- Cheers macropod [Microsoft MVP - Word] "sdjwalls" wrote in message ... Hi macropod, Thank you so much! By changing the problem around like that, it works very well. I've concatenated my source files and added bookmarks, and it works very well. Everything updates nicely, without styles getting scrambled. A workable work-around. To answer your question, the source docs had a variety of styles. Different headings, body, etc. I had tried setting the style of the field itself, but then when the field was updated, everything imported had that same style without any variation--too flat. So, does this imply that IF really has problems? Seems fine for straight text, but nothing more involved than that? Again-many thanks. sdjwalls "macropod" wrote: Hi sdjwalls, What Style is applied to the paragraph the IF field is attached to? A slightly different approach you could take, which avoids the IF field altogether, is to use the DOCPROPERTY field in your target document to refer to different bookmarked ranges in your source document (meaning you'd only need one source document for all the variable boilerplate text) and code the INCLUDETEXT field along the lines of: { INCLUDETEXT "filepath//REFERENCE.doc" { DOCPROPERTY "Subject" } } With this approach, if your source document has a bookmarked range named 'base' and the target document has a DOCPROPERTY "Subject" set to 'Base', the corresponding text will be imported. For this to work, you'll need to have a default bookmark name (even if its range is empty) in the source document for the DOCPROPERTY field to refer. -- Cheers macropod [Microsoft MVP - Word] "sdjwalls" wrote in message ... Hello, I have a document that needs to pull in other documents based off of what is in the Subject Document Property, and also have the Table of Contents and List of Tables update properly (several headings and tables get included with the inserted document). If I use just the INCLUDETEXT on its own, it seems to work pretty well...the doc is inserted, the headings styles look correct, and the TOC and LOT update properly. My field: { INCLUDETEXT "BASE.doc" } The proper TOC looks similar to: 1.1 Introduction ... 7 1.2 Base Config ..... 7 1.3 Base Config Desc ...8 1.3.1 Desc A ...8 1.3.2 Desc B ...9 However, if I put this INCLUDETEXT inside an IF statement, then things go awry. The first heading in the included doc doesn't come out right, but next heading in the included doc seems all right? The added tables do not show up in the LOT at all when updated. And the TOC is very strange...where the messed up heading occurred, I have something similar to: { if { DOCPROPERTY "Subject" } = "BASE" { INCLUDETEXT "BASE.doc" } } 1.1 Introduction ... 7 1.1 .......... 7 1.1 .......... 7 1.1.1 7 1.1.1 7 1.1.1 7 1.1.1 7 1.1.1 7 1.1.1 7 1.2 Base Config ..... 7 1.3 Base Config Desc ...8 1.3.1 Desc A ...8 1.3.2 Desc B ...9 Beside the fact that this looks odd (should look like example above, w/out the IF), it doesn't match what the doc is actually showing. Help is greatly appreciated! This would be wonderful it would actually work! I saw similar posts, and tried several variations, but didn't find anything that really matched this (or worked). Thanks, SDJWalls . |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
embedding jpgs | Microsoft Word Help | |||
embedding a file | Page Layout | |||
PDF embedding | Microsoft Word Help | |||
embedding fonts | Microsoft Word Help | |||
Possible to {includetext} without taking on styles of target? | Microsoft Word Help |