Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Word Automation - Table of Contents.MarkEntry
Message
De
31/01/2003 12:39:08
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Word Automation - Table of Contents.MarkEntry
Divers
Thread ID:
00747726
Message ID:
00747726
Vues:
53
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. Maybe it cannot be done.

I know this is not standard stuff but I am hoping there is a Word Automation Guru with the answer.
Répondre
Fil
Voir

Click here to load this message in the networking platform