Finding WP MathA symbols in document

H

hansensj

My company is in the process of removing WordPerfect from all computers
A lot of documents have symbols from the font WP MathA (fro
WordPerfect) in them. I am trying to write a macro that will find if
symbol from that font is in a document and select the symbol. I ca
find whenever text is enterd with the WP MathA font, but I can not fin
the symbols.

How can I code the Selection.find to find symbols that are from the W
MathA font?

When the WP MathA font is removed from the computers, the document
automatically replace the symbol with a square box or some othe
symbol.

Stev
 
J

Julie

This works for me (find any character in that font), although I am currently
looking for a better way:

With Selection.Find
.Font.Name = sFontName 'hard code
the name of your font here
.Text = "^?"
.MatchWildcards = False
.Forward = True
.Wrap = wdFindStop
End With
Selection.Find.Execute

While Selection.Find.Found = True

'DO WHATEVER IS REQUIRED HERE

Selection.Find.Execute

Wend
 
H

hansensj

That works when someone has changed the font to WP MathA and then type
something.
BUT
When you Insert-Symbol (and then select WP MathA font) and then selec
the symbol, the find string will not find the symbol with that font.

My other option I am looking for would be to extract all fonts in
document.

I have noticed that I can use the (wdDialogFontSubstitution) to pop u
a dialog box to show missing fonts and the "Recover Text from any File
will display all the fonts in a document, but I am trying to now find
way to call something to give me a list of all fonts in a document.

The problem is that some computers have the WordPerfect fonts installe
and I want to prevent those people from saving a document with a W
MathA symbol. This will ensure that when the document is opened up o
a compter that does not have the WP MathA, it will not switch out th
symbol with something else.

Does someone know how to list all font in a document so I can extrac
the WP MathA?

Stev
 
H

Helmut Weber

Hi hansensj,
maybe this helps.
Given, that "WP MathA" is a so called decorative font,
and that there are no exeptions with "WP MathA"
you could check, whether "WP MathA" is in your doc,
the following way:
Sub GetMathA()
Dim rDcm As Range
Dim oChr As Object
Dim sFnt As String
Set rDcm = ActiveDocument.Range
For Each oChr In rDcm.Characters
If Asc(oChr) = 40 Then ' applies to most (or all) decorative fonts?
oChr.Select
sFnt = Dialogs(wdDialogInsertSymbol).Font ' that's it!
if sFnt = "WP MathA" then ' cann't test it
' whatever ,exit or wpfound = true etc.
endif
End If
Next
End Sub
.... and there may be other and better solutions
Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
 

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