R
Robin Tucker
Say, for example, I have a single page looking something like this:
<<SECTION_START>>
--------------------------------------------------------------
| Database ID | Asset Title
|
--------------------------------------------------------------
| <<ASSET_ID>> | <<ASSET_NAME>> |
--------------------------------------------------------------
<<SECTION_END>>
How is it possible to remove the field codes <<SECTION_START>> and
<<SECTION_END>>, without leaving blank lines above and below, so that when I
perform a directory merge I end up with one big table, rather than something
like the following:
--------------------------------------------------------------
| Database ID | Asset Title
|
--------------------------------------------------------------
--------------------------------------------------------------
| 10234 | Primary Crusher
|
--------------------------------------------------------------
--------------------------------------------------------------
| 10235 | Secondary Crusher
|
--------------------------------------------------------------
What I want, is something that looks like this:
--------------------------------------------------------------
| Database ID | Asset Title
|
--------------------------------------------------------------
| 10234 | Primary Crusher
|
--------------------------------------------------------------
| 10235 | Secondary Crusher
|
--------------------------------------------------------------
To enlarge a little more, I have report "templates", within which the user
can embed "SECTION_START" and "SECTION_END" tags. My code then goes through
the template, splitting it into separate documents (everything between
SECTION_START and SECTION_END). These documents are then mail-merged with
the data source, before being re-combined into the finished report. This
allows me to do a main report section, on a given set of records and then a
summary section on another, different set of records. At present I'm
finding the range between the tags like so:
' The indices of the start and end section tags (index within the fields
collection for the document)
Dim theSectionStartIndex, theSectionEndIndex as integer
...
... find the section start and end tag indices
...
theRange = m_LoadedDocument.Fields.Item(theSectionStartIndex).Result
theRange.Collapse(Word.WdCollapseDirection.wdCollapseStart)
theRange.MoveStart(Word.WdUnits.wdCharacter, -1)
theRange.End =
m_LoadedDocument.Fields.Item(theSectionEndIndex).Result.End
theRange.MoveEnd(Word.WdUnits.wdCharacter, 1)
But when merged, this range results in the split table above, rather than a
combined one.
Thanks for any hints you can give me about this.
Robin
<<SECTION_START>>
--------------------------------------------------------------
| Database ID | Asset Title
|
--------------------------------------------------------------
| <<ASSET_ID>> | <<ASSET_NAME>> |
--------------------------------------------------------------
<<SECTION_END>>
How is it possible to remove the field codes <<SECTION_START>> and
<<SECTION_END>>, without leaving blank lines above and below, so that when I
perform a directory merge I end up with one big table, rather than something
like the following:
--------------------------------------------------------------
| Database ID | Asset Title
|
--------------------------------------------------------------
--------------------------------------------------------------
| 10234 | Primary Crusher
|
--------------------------------------------------------------
--------------------------------------------------------------
| 10235 | Secondary Crusher
|
--------------------------------------------------------------
What I want, is something that looks like this:
--------------------------------------------------------------
| Database ID | Asset Title
|
--------------------------------------------------------------
| 10234 | Primary Crusher
|
--------------------------------------------------------------
| 10235 | Secondary Crusher
|
--------------------------------------------------------------
To enlarge a little more, I have report "templates", within which the user
can embed "SECTION_START" and "SECTION_END" tags. My code then goes through
the template, splitting it into separate documents (everything between
SECTION_START and SECTION_END). These documents are then mail-merged with
the data source, before being re-combined into the finished report. This
allows me to do a main report section, on a given set of records and then a
summary section on another, different set of records. At present I'm
finding the range between the tags like so:
' The indices of the start and end section tags (index within the fields
collection for the document)
Dim theSectionStartIndex, theSectionEndIndex as integer
...
... find the section start and end tag indices
...
theRange = m_LoadedDocument.Fields.Item(theSectionStartIndex).Result
theRange.Collapse(Word.WdCollapseDirection.wdCollapseStart)
theRange.MoveStart(Word.WdUnits.wdCharacter, -1)
theRange.End =
m_LoadedDocument.Fields.Item(theSectionEndIndex).Result.End
theRange.MoveEnd(Word.WdUnits.wdCharacter, 1)
But when merged, this range results in the split table above, rather than a
combined one.
Thanks for any hints you can give me about this.
Robin