General information
Category:
COM/DCOM and OLE Automation
Well, it has been some time but this thing has come up again.
It was never actually solved ... just circumvented.
I have achieved some measure of success and am hoping someone can provide me with the final key.
Let's review ...
I am using the MARKENTRY method to insert TablesOfContents entries into a Word Document. My basic problem has been getting the entries to go exactly where I insert them. They tend to "fall" to the end of the section in which they are inserted regardless of exactly where within that section that I place the inserting code.
However, this code works ...
oRange.InsertAfter("Technology Assessment Scope"+CR)
oDoc.TablesOfContents.MarkEntry(oRange,"Technology Assessment Scope",,,1)
oRange.Font.Name="Arial"
oRange.Font.Size = nBaseFontSize+1
oRange.Font.Bold=1
oRange.Underline=wdUnderLineSingle
oRange.Collapse(wdCollapseEnd)
However, the problem with using that code is that the entry within the Table of Contents takes on the characteristics which were assigned immediately after that MarkEntry statement.
So I thought, I would give my MarkEntry its own separate characteristics like this ...
oRange.InsertAfter("Technology Assessment Scope"+CR)
oRange.Font.Name="Arial"
oRange.Font.Size = nBaseFontSize+1
oRange.Font.Bold=1
oRange.Underline=wdUnderLineSingle
oRange.Collapse(wdCollapseEnd)
oDoc.TablesOfContents.MarkEntry(oRange,"Technology Assessment Scope",,,1)
oRange.Font.Name="Arial"
oRange.Font.Size = 11
oRange.Font.Bold=0
oRange.Underline=wdUnderLineNone
oRange.Collapse(wdCollapseEnd)
Seems logical ... but not quite. It seems that it does give the proper characteristics to the MarkEntry lines, it also causes the Table of Contents Code to fall back down to the end of the Section marker instead of having it inserted exactly where I issued the command.
I have tried many, many, different permutations of these concepts and have not been able to come upon a method to accomplish this.
Any help is appreciated. Thanks.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only