Information générale
Catégorie:
COM/DCOM et OLE Automation
Titre:
Word Automation - Parsing Formatting Tokens
I am trying to create a routine which will read a memo field in which I have inserted various formatting tokens of my own invention for the purpose of converting that memo field into a MSWORD file.
I am using OLE automation to create the MSWORD file.
I have inserted various tokens like ...
<>This would be bold<>
or <> and <>, etc ...
My problem is that I know it is flawed (even though it works so far) because the discovery of each of these tokens requires that I COLLAPSE the range I am working within and begin a new range.
This means that if I NEST my tokens, sometimes the active range will have been collapsed prior to my implementing the formatting.
For example, <><>Item 1<><>
When my code processes the FONTBOLD.OFF token, it collapses the range (cannot be avoided) then when it processes the LIST.END token it inserts code to create a list on the active range but the active range has been collapsed and nothing happens.
I know this is pretty complicated, I just thought I would throw it out here to see if anyone has dealt with this in any manner or has a better idea.
I have a feeling that using the SELECTION concept is my only possibility of a solution but I am not experienced enough with this to have a good picture of how I might utilize it.
I will not be surprised if I get no action on this at all.
Thanks.
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement