R
revstead
I am trying to programmatically convert all references in a document of one
fontname to another, in order to replace a missing font. This code works
fine ... but only if the 'missing' font ("SuperHebrew") is in fact installed.
For Each rngStory In ActiveDocument.StoryRanges
With rngStory.Find
.ClearFormatting
.Font.Name = "SuperHebrew"
Do While .Execute(FindText:="", Forward:=True) = True
With .Parent
HebrewString = .Text
HebrewString = ConvertSupHebToCCAT(HebrewString)
HebrewString = ConvertCCATToUnicode(HebrewString, "Vowels")
If HebrewString <> "" Then .Text = HebrewString
.Font.Name = "Ezra SIL"
.Move Unit:=wdWord, Count:=1
End With
Loop
End With
Next rngStory
However, if SuperHebrew is NOT installed (which is the situation I am trying
to handle <grin>) , then MSWord Font Substitution kicks in, and remaps the
font to a different font (in this case "Default"). The side effect of this
is that I can no longer reference the missing font by its orginal name, and I
cannot work out what name I should use the code does not find anything to
change. I have tried changing to ...
font.name = "Arial" 'Ariel is my Default font
font.name = "(Default)"
font.name = "(Default) SuperHebrew" ' this is how is displays in manual
Search & Replace
None of these work. Any ideas?
Cheers
revstead
fontname to another, in order to replace a missing font. This code works
fine ... but only if the 'missing' font ("SuperHebrew") is in fact installed.
For Each rngStory In ActiveDocument.StoryRanges
With rngStory.Find
.ClearFormatting
.Font.Name = "SuperHebrew"
Do While .Execute(FindText:="", Forward:=True) = True
With .Parent
HebrewString = .Text
HebrewString = ConvertSupHebToCCAT(HebrewString)
HebrewString = ConvertCCATToUnicode(HebrewString, "Vowels")
If HebrewString <> "" Then .Text = HebrewString
.Font.Name = "Ezra SIL"
.Move Unit:=wdWord, Count:=1
End With
Loop
End With
Next rngStory
However, if SuperHebrew is NOT installed (which is the situation I am trying
to handle <grin>) , then MSWord Font Substitution kicks in, and remaps the
font to a different font (in this case "Default"). The side effect of this
is that I can no longer reference the missing font by its orginal name, and I
cannot work out what name I should use the code does not find anything to
change. I have tried changing to ...
font.name = "Arial" 'Ariel is my Default font
font.name = "(Default)"
font.name = "(Default) SuperHebrew" ' this is how is displays in manual
Search & Replace
None of these work. Any ideas?
Cheers
revstead