Somebody gave me a Word97 document and it contains:
All UNIX machine hostnames have 8 characters. The first 4
characters csu' is constant. cs' for the project
name and ' to identify that it is a UNIX machine.
Actually, the content should be:
All UNIX machine hostnames have 8 characters. The first 4
characters 'acsu' is constant. 'acs' for the project name
and 'u' to identify that it is a UNIX machine.
Someone suggested that it may be a "wrong code page" problem.
Any idea what went wrong?
Thanks in advance.
Tom
MSMVP PS-D
"rtang" <ricky_...@sinaman.com> wrote in message
news:dad96f9b.01070...@posting.google.com...
Do you have an idea what's going on here?
My guess was the funny codes came from another program, not Word.
It seemed to me that the apostrophes tricked the program to interpret it and
the following letter as a DBCS (double byte) character; but the codes seem
very funny.
The only *half*-sensible way to get them seems to be:
'a --> Asc("a") + &H10000 - 7000 = 97 + 65536 - 7000 = 58633
'u --> Asc("u") + &H10000 - 7000 = 117 + 65536 - 7000 = 58653
... but why any program would assign such values is beyond me.
Hi rtang,
In case Tom's suggestion doesn't work:
If my macro from microsoft.public.word.newusers didn't (fully) repair your
file(s), and you really can't get the person who sent you the files to send
you a correct file, you can *privately* mail me the document, and I'll try to
repair it.
Regards, Klaus
Tom
"Klaus Linke" <fotosatz...@t-online.de> wrote in message
news:9hvjsl$2dd$03$1...@news.t-online.com...
I thought so too, at first.
But the codes aren't covered by unicode (they come from a "private use"-area),
and I don't think there is a programmer from Microsoft who'd put an "a" on any
position but its Ascii-position 97 in a code page.
Your reply got me thinking I might have interpreted the question wrong:
If there are boxes in the Word-Doc, and the codes ("") came from
pasting to HTML, then the following adapted macro should fix the file.
HTH, Klaus
Sub FixFile()
'
Do
Search$ = "[" & ChrW(58633 - Asc("a")) & "-"
Search$ = Search$ & ChrW(58633 - Asc("a") + 255) & "]"
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = Search$
.Replacement.Text = "^&"
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
If Selection.Find.Execute Then
Var$ = Selection.Text
Var2 = AscW(Selection.Text) - 58633 + AscW("a") + &H10000
VarReplace$ = ChrW(39) & ChrW(Var2)
With Selection.Find
.Text = Var$
.Replacement.Text = VarReplace$
.MatchCase = True
.Format = True
.MatchWildcards = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Else
Exit Do
End If
Loop
End Sub
Thomas Ferguson wrote:
>
> Without really going into it, I assumed an ANSI-Unicode encoding problem.
>
> Tom
>