That helped quite a bit.
Next puzzler: What built-in routine can I use to check for the existence of a particular style in a document? STYLEREF works great for grabbing the previous reference of a particular style, but I'm looking for a Boolean here.
Pseudocode I want to use goes something like this:
IF (Style X exists)
THEN
{
(move to next instance of Style X)
(perform action, replacing Style X with my new structure)
}
ENDIF
Or
WHILE (Style X exists)
{
(move to next instance of Style X)
(perform action, replacing Style X with my new structure)
}
...needing it to bail out if the style is no longer present.
Word's Find/Replace functionality doesn't seem to want to bail out when in macro form. If I have something like:
{
FIND (Style X)
(Hit Delete key)
}
bound together, it works great as long as Style X exists. If it doesn't, it ignores the first line and simply executes whatever's in the rest of the routine, instead of kicking out a "Selection not found" error like it would if I searched for it manually.
Suggestions?
|