Re: Replacing WP Typographic Symbols in Word 2002
From: Klaus Linke (info_at_fotosatz-kaufmann.de.no.junk)
Date: 05/21/04
- Next message: Victoria: "Help Opening WordPerfect Files"
- Previous message: Charles Kenyon: "Re: Wordperfect doc conversion to Word XP"
- In reply to: CharlieW: "Re: Replacing WP Typographic Symbols in Word 2002"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 21 May 2004 21:09:26 +0200
Hi Charlie,
It's really Twilight Zone now:
When I open your original WP file in my Word2002 (or 2003), all "WP
Typographical Symbol" characters are converted into the proper Unicode
characters (smart quotes ...) just fine -- no problems at all.
(using Word 2002 10.6612.6626 SP3)
Either the buggy WP import was fixed by an update, or I have different WP
import filter installed for some reason.
Or it's one of the countless options settings? Or the German version? ...
The Word2002 file you posted is really botched. It uses "Courier" as the
replacement font for "WP Typographical Symbols", and the same font for
regulat text.
You could change the substitute font in "Tools > Options > Compatibility".
But the *really* botched thing about it that it treats the WP characters as
protected symbols (Word doesn't show the real font, AscW reports code=40),
but still uses the regular ASCII codes ("Insert > Symbol" shows "A", "@"
...).
So my macros won't work, neither those to unprotect characters nor those to
replace characters from decorative/symbol fonts.
The file can still be fixed by saving as "Web page (filtered) (*.HTM,
*.HTML)". If you then close and reopen the file, Word will display "WP
Typographical Symbols" again, and you can then use "Find/Replace" (this
time with regular ASCII codes, not those for "decorative" fonts).
A set of macros that does these replacements is posted below.
Regards,
Klaus
Sub WPTypoToUnicode3()
Dim rngOld As Range
Set rngOld = Selection.Range.Duplicate
LoopStoryRanges "WPT2U3"
rngOld.Select
StatusBar = "Finished changing ""WP " _
& "TypographicSymbols"" font to Unicode"
End Sub
Sub WPT2U3(myRange As Range)
Dim myC, SelFont As String
Dim SelCharNum As Long
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
Selection.Find.Font.Name = "WP TypographicSymbols"
Selection.Find.Replacement.style = _
ActiveDocument.Styles(wdStyleDefaultParagraphFont)
With Selection.Find
.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
While Selection.Find.Execute
Selection.Find.Execute _
FindText:=Selection.Characters(1).Text, _
ReplaceWith:=WPTypo2Uni3(AscW(Selection.Characters(1).Text)), _
Replace:=wdReplaceAll
Wend
End Sub
Function WPTypo2Uni3(WPCharCode As Long) As String
Dim RepFont As String
Dim RepChar As String
RepChar = ""
' some characters in this font don't have a proper or unambiguous
' Unicode representation; this list was done by hand
Select Case WPCharCode
Case &H21 ' filled round bullet (medium)
RepChar = ChrW(&H25CF)
Case &H22 ' circle (medium)
RepChar = ChrW(&H25CB)
Case &H23 ' filled square bullet (medium)
RepChar = ChrW(&H25A0)
Case &H24 ' filled round bullet (small)
RepChar = ChrW(&H2022)
Case &H25 ' star
RepChar = ChrW(&H2A)
Case &H26 ' Paragraph sign
RepChar = ChrW(&HB6)
Case &H27 ' Section sign
RepChar = ChrW(&HA7)
Case &H28 ' Spanish exclamation mark
RepChar = ChrW(&HA1)
Case &H29 ' Spanish question mark
RepChar = ChrW(&HBF)
Case &H2A ' left pointing guillemet
RepChar = ChrW(&HAB)
Case &H2B ' right pointing guillemet
RepChar = ChrW(&HBB)
Case &H2C ' Pound sign
RepChar = ChrW(&HA3)
Case &H2D ' Yen sign
RepChar = ChrW(&HA5)
Case &H2E ' Peseta sign
RepChar = ChrW(&H20A7)
Case &H2F ' Florin sign (Dutch)
RepChar = ChrW(&H192)
Case &H30 ' feminine ordinal indicator (Spanish)
RepChar = ChrW(&HAA)
Case &H31 ' masculine ordinal indicator (Spanish)
RepChar = ChrW(&HBA)
Case &H32 ' 1/2
RepChar = ChrW(&HBD)
Case &H33 ' 1/4
RepChar = ChrW(&HBC)
Case &H34 ' Cent sign
RepChar = ChrW(&HA2)
Case &H35 ' superscript 2
RepChar = ChrW(&HB2)
Case &H36 ' superscript n
RepChar = ChrW(&H207F)
Case &H37 ' Registered sign
RepChar = ChrW(&HAE)
Case &H38 ' Copyright sign
RepChar = ChrW(&HA9)
Case &H39 ' Currency sign
RepChar = ChrW(&HA4)
Case &H3A ' 3/4
RepChar = ChrW(&HBE)
Case &H3B ' superscript 3
RepChar = ChrW(&HB3)
Case &H3C ' single opening quote
RepChar = ChrW(&H201B)
Case &H3D ' single high comma quote
RepChar = ChrW(&H2019)
Case &H3E ' single high turned comma quote
RepChar = ChrW(&H2018)
Case &H40 ' double high comma quote
RepChar = ChrW(&H201D)
Case &H41 ' double high turned comma quote
RepChar = ChrW(&H201C)
Case &H42 ' En dash
RepChar = ChrW(&H2013)
Case &H43 ' Em dash
RepChar = ChrW(&H2014)
Case &H44 ' Left pointing single guillemet
RepChar = ChrW(&H2039)
Case &H45 ' Right pointing single guillemet
RepChar = ChrW(&H203A)
Case &H48 ' Dagger
RepChar = ChrW(&H2020)
Case &H49 ' Double Dagger
RepChar = ChrW(&H2021)
Case &H4A ' Trademark sign
RepChar = ChrW(&H2122)
Case &H4D ' filled round bullet (large)
RepChar = ChrW(&H25CF)
Case &H4E ' circle (small)
RepChar = ChrW(&HB0)
Case &H4F ' Large filled square bullet (large)
RepChar = ChrW(&H2580)
Case &H50 ' filled square bullet (small)
RepChar = ChrW(&H25A0)
Case &H51 ' empty square bullet (medium)
RepChar = ChrW(&H25A1)
Case &H52 ' empty square bullet (small)
RepChar = ChrW(&H25A1)
Case &H53 ' En dash
RepChar = ChrW(&H2013)
Case &H57 ' Ligature fi
RepChar = ChrW(&HFB01)
Case &H58 ' Ligature fl
RepChar = ChrW(&HFB02)
Case &H59 ' Ellipsis = ...
RepChar = ChrW(&H2026)
Case &H5A ' Dollar sign
RepChar = ChrW(&H24)
Case &H5B ' Franc sign
RepChar = ChrW(&H20A3)
Case &H5E ' Lira sign
RepChar = ChrW(&H20A4)
Case &H5F ' low single comma quote
RepChar = ChrW(&H201A)
Case &H60 ' low double comma quote
RepChar = ChrW(&H201E)
Case &H61 ' 1/3
RepChar = ChrW(&H2153)
Case &H62 ' 2/3
RepChar = ChrW(&H2154)
Case &H63 ' 1/8
RepChar = ChrW(&H215B)
Case &H64 ' 3/8
RepChar = ChrW(&H215C)
Case &H65 ' 5/8
RepChar = ChrW(&H215D)
Case &H66 ' 7/8
RepChar = ChrW(&H215E)
Case &H69 ' Euro sign
RepChar = ChrW(&H20AC)
Case &H6A ' Care of
RepChar = ChrW(&H2105)
Case &H6C ' Per thousand
RepChar = ChrW(&H2030)
Case &H6D ' Numero sign
RepChar = ChrW(&H2116)
Case &H6E ' En dash
RepChar = ChrW(&H2013)
Case &H6F ' superscript 1
RepChar = ChrW(&HB9)
Case &H2C6 ' New Shequel sign (Israel)
RepChar = ChrW(&H20AA)
Case Else
RepChar = ChrW(&H2400 + WPCharCode)
End Select
WPTypo2Uni3 = RepChar
End Function
"CharlieW >" <<CharlieW.16it83@excelforum-nospam.com> wrote:
> Hi Klaus,
>
> Sorry for the delayed response. I was away from the office for a few
> days. A zip file is attached per your request that contains a small
> original wp5.2 file that uses smart quotes based on the WP
> TypographicSymbol font. I also include the converted Word-2000 file
> where one can still see the typographic symbol font (and where one can
> replace the smart quotes with the Times New Roman version), and the
> converted Word-2002 file where the typographic symbol font is no longer
> searchable or replaceable. Appreciate your offer of help. Hope you
> can figure something out.
>
> Charlie
>
> Attachment filename: wp52 typosymbol conversion test.zip
> Download attachment:
http://www.WordForums.com.com/forums/attachment.php?postid=140409
> ---
> Message posted from http://www.ExcelForum.com/
>
- Next message: Victoria: "Help Opening WordPerfect Files"
- Previous message: Charles Kenyon: "Re: Wordperfect doc conversion to Word XP"
- In reply to: CharlieW: "Re: Replacing WP Typographic Symbols in Word 2002"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|