Aberrant/Corrupted/Strange/Weird formatting (Word 2003)

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15636
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Aberrant/Corrupted/Strange/Weird formatting (Word 2003)

Post by ChrisGreaves »

This is not critical, since I can retrieve the corrupted line from a backup copy.
But ...
2.png
This (attached extract) is what greeted me this afternoon.
One row of my table is partially corrupted.
Each row has a common format in that column 1 contains a date, column 2 contains initials, column 3 contains descriptive text typed in by me, sometimes with pasted text or hyperlinks.
Part of column 3 is corrupted; part is quite readable.
The Format, Font box tells me nothing untoward.
In VBE Immediate pane, ?asc(selection.Text) yields the value 63, which 1s ASCII for a question-mark. I think that just means that Word is scratching her head and can't work out what is going on.

I tried pasting the Word text into Notepad:
3.png
You do not have the required permissions to view the files attached to this post.
There's nothing heavier than an empty water bottle

User avatar
HansV
Administrator
Posts: 78526
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Aberrant/Corrupted/Strange/Weird formatting (Word 2003)

Post by HansV »

Character 63 is used to mark Unicode characters; you can find the "real" character (for what it's worth) by typing

? AscW(Selection)

in the Immediate window. It looks like all characters have been shifted by 4096=2^12. Why? No idea.
Best wishes,
Hans

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15636
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Aberrant/Corrupted/Strange/Weird formatting (Word 2003)

Post by ChrisGreaves »

HansV wrote:It looks like all characters have been shifted by 4096=2^12. Why? No idea.
Saturday?
Wind from the SW?
Oatmeal for breakfast?

Thanks Hans.

Code: Select all

Sub Macro4()
'
' Macro4 Macro
' Macro recorded 6/25/2011 by CGreaves
'
    Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
    Selection.Text = ChrW(4096 + AscW(Selection.Text))
    Selection.MoveRight Unit:=wdCharacter, Count:=1
End Sub
4.png
You do not have the required permissions to view the files attached to this post.
There's nothing heavier than an empty water bottle

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15636
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Aberrant/Corrupted/Strange/Weird formatting (Word 2003)

Post by ChrisGreaves »

HansV wrote:It looks like all characters have been shifted by 4096=2^12.
(Minutes later).
Having fixed the text in my micro-document I decided to paste the fixed row into the original document.
I'd forgotten that at first glance it looked Greek to me, and I had used Ctrl-space thinking that the format was out of whack.

I still don't know what happened.
5.png
You do not have the required permissions to view the files attached to this post.
There's nothing heavier than an empty water bottle