G
Guest
Hi everyone,
Firstly great little discussion section here. I've been reading alot of
posts and it has been enlightening me a fair bit.
I've been having issues with Symbols (who hasn't) and I've been scouring the
net for solutions as well as having a go at creating a macro (which I
eventually need to do anyway.)
Here is my issue at hand...
I have a document with multiple Unicode characters scattered throughout the
document. The characters might be Arial or Times New Roman etc. The document
looks something like this:
---
Equation 1:
1 + 2 = 3
2 + 2 = 4
---
I need to convert ALL of the non-symbol characters (i.e. the unicode) to its
Symbol equivalent. In this example it would be the plus and the equals sign.
I've tried a few methods so far but none have worked for me.
1) Recording a Macro
This had the most success for me except I could only perform a single find
and replace as well as I couldn't format in Symbol. So the text would be
replaced and show up as an incorrect character in Times New Roman etc.
I.e. With Selection.Find
.Text = ChrW(215)
.Replacement.Font.Name = "Symbol"
.Replacement.Text = ChrW(180)
*Note I realise about the character numbers being incorrect now too.
2) Using the MVPS (http://word.mvps.org/FAQs/MacrosVBA/FindReplaceSymbols.htm)
This site helped me in greater understanding except I need an automated
macro. The solution in the macro9.dot file means that each time I have to
manually specify characters.
3) Klaus Linke's Solution
I thought I'd hit a home run when I found this one. Essentially this is what
I wanted to do. I was however just going to manually specify the ones I
needed to do. (i.e. "+" "-" and any others)
His solution was:
Sub UnicodeToSymbolFont()
' Replaces Unicode symbols with symbols from the Symbol font
' in all of the doc (all story ranges).
Call U2S(&H2200, &H22) ' # FOR ALL
Call U2S(&H2203, &H24) ' # THERE EXISTS
Call U2S(&H220B, &H27) ' # CONTAINS AS MEMBER
Call U2S(&H2217, &H2A) ' # ASTERISK OPERATOR
.... (continues)
However this was really slow (I think something to do with the loop) as well
as my test document which had:
+-×÷
It only worked on the X. So I was stumped there too.
If anyone knows of a solution at the moment I have almost lost hope!
Thanks,
David.
Firstly great little discussion section here. I've been reading alot of
posts and it has been enlightening me a fair bit.
I've been having issues with Symbols (who hasn't) and I've been scouring the
net for solutions as well as having a go at creating a macro (which I
eventually need to do anyway.)
Here is my issue at hand...
I have a document with multiple Unicode characters scattered throughout the
document. The characters might be Arial or Times New Roman etc. The document
looks something like this:
---
Equation 1:
1 + 2 = 3
2 + 2 = 4
---
I need to convert ALL of the non-symbol characters (i.e. the unicode) to its
Symbol equivalent. In this example it would be the plus and the equals sign.
I've tried a few methods so far but none have worked for me.
1) Recording a Macro
This had the most success for me except I could only perform a single find
and replace as well as I couldn't format in Symbol. So the text would be
replaced and show up as an incorrect character in Times New Roman etc.
I.e. With Selection.Find
.Text = ChrW(215)
.Replacement.Font.Name = "Symbol"
.Replacement.Text = ChrW(180)
*Note I realise about the character numbers being incorrect now too.
2) Using the MVPS (http://word.mvps.org/FAQs/MacrosVBA/FindReplaceSymbols.htm)
This site helped me in greater understanding except I need an automated
macro. The solution in the macro9.dot file means that each time I have to
manually specify characters.
3) Klaus Linke's Solution
I thought I'd hit a home run when I found this one. Essentially this is what
I wanted to do. I was however just going to manually specify the ones I
needed to do. (i.e. "+" "-" and any others)
His solution was:
Sub UnicodeToSymbolFont()
' Replaces Unicode symbols with symbols from the Symbol font
' in all of the doc (all story ranges).
Call U2S(&H2200, &H22) ' # FOR ALL
Call U2S(&H2203, &H24) ' # THERE EXISTS
Call U2S(&H220B, &H27) ' # CONTAINS AS MEMBER
Call U2S(&H2217, &H2A) ' # ASTERISK OPERATOR
.... (continues)
However this was really slow (I think something to do with the loop) as well
as my test document which had:
+-×÷
It only worked on the X. So I was stumped there too.
If anyone knows of a solution at the moment I have almost lost hope!
Thanks,
David.