Finding raised/lowered characters within a macro

R

Robin Dunford

I am converting an old WordBasic macro (that I didn't
write) to VBA. The idea is to run through a loop, changing
characters raised by between 8 and 0.5 points (step -0.5)
to superscript characters (not raised). I believe it used
to work fine in WordBasic.

However, the property Selection.Find.Font.Position is
apparently a long variable, so if I set the variable to be
e.g. 3.5 it is rounded to 4. But, it is perfectly possible
to set characters to be raised by 3.5 points from the
keyboard (in Format:Font:Character Spacing), and it is
also possible to use Selection.Find.Font.Position = 3.5 in
a macro to find such characters.

Does anyone have any ideas about how to find characters
raised by 7.5, 6.5 etc. points without having to write the
find/replace out each time?

Is this a known bug, or am I missing something?
 
K

Klaus Linke

Hi Robin,

Since this only got messed up with the introduction of VBA, you could also
use old WordBasic code:

WordBasic.EditFindClearFormatting
' for characters raised 3.5 points:
WordBasic.EditFindFont Position:="3.5 pt"
WordBasic.EditFind Find:="", Direction:=0, Format:=1

You can download the Word95 WordBasic help file to help you with the
possible arguments:
http://www.microsoft.com/downloads/release.asp?ReleaseID=26572

But if you want to capture all the formatting to such a level of detail,
you might be better off to save in HTML or in the new 2003 version's WordML
format, and take it from there.
Your macro will take lots of time otherwise, and there isn't too much you
can do to speed it up.

Greetings,
Klaus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top