Switching fonts in a textbox under VBA

J

John Crawford

OK this is what I am trying to do
(10<=14)OR(25>=12)=
however I want the >= and <= symbols replaced with their math equivalent
. (line below the <>)
The normal fonts (like Courier) do not have the symbols. However the
"Symbols" font does. However the Symbols font does not have an "R" (but
Courier does.
I have been trying through vba to get the correct result. The closest I
can get is:
With .TextFrame.TextRange
.Font.Name = "Symbol" 'Change to the Symbol font
.Text = "(10" & symLE & "14)" 'first part (symLE = Chr$(163))
'The only way that I can change the font is to use InsertSymbol
'and the symbol is the first character in the next string
'In this case it is the "O" in OR
.InsertAfter.InsertSymbol "Courier New", 79
.InsertAfter "R" 'The rest of OR
'Now to switch back to Symbols I need to again use InsertSymbol
'and the symbol is the "(" of the next part
.InsertAfter.InsertSymbol "Symbol", 40
.InsertAfter "25" & symGE & "12)=" 'Now the rest (symGE = Chr$(179)
End With

I cannot find any property or method that will give the correct
results. This is going to be used for a math quiz, and I need the code
to be able to handle a number of math symbols.
If this is the best I can get then I will have to live with it. But
if there are any ideas out there I would appreciate any guidance.
Thanks
and Happy New Year
John Crawford
 

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