Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Punctuation arrow character in Word document 1

Status
Not open for further replies.

trollacious

Programmer
Sep 29, 2004
4,046
US
I received a document with a strange arrow character several places in it. The shaft of the arrow points up then turns to the right where the point of the arrow is, and it is listed in Symbols as a general punctuation character. The character cannot be highlighted to copy and paste, appears at the beginnings and ends of some words and numbers in the document, but I can't see a pattern of any kind for the symbol in the document. It doesn't turn off with the formatting characters, either.

I'm using Word 2000, not sure what the person who sent it to me is using. She commented on the strange characters in the document that came from her job, said it happens regularly in documents from the company.

Any ideas how to get rid of it easily or prevent it from displaying in the first place?

Lee
 
Are you sure the arrow goes UP first then turns right?

I have never seen that, and can not find such a character in General Punctuation for any Font I have on my machine. What Font is listed, that you see this in General Punctuation?

There IS a character that is an arrow that appears to come DOWN, with the arrow head at the left.

That bent arrow character is ASCII 11, or if you prefer, Chr(11). You get this when you use Shift-Enter to get a "vertical tab". These are often present when other applications produce raw text files.

Within the context of Word, this creates a new line, but NOT a new paragraph. The new line retains the attributes (and Style) of the paragraph.

Interestingly enough, you do NOT get Chr(11) if you execute either a vbCr (carriage return), or a vbLf (line feed). You can only get it if you use an actual Chr(11) - .e.g.
Code:
Selection.TypeText Text:=Chr(11)

BTW: Skip's comment should be Ctrl-Shift-*, in that you need the Shift to get the *. You can do the same thing by clicking the Show/Hide icon on the Standard toolbar. All this does is, well, show/hide the typographical characters. It does NOT remove the character. This is moot, as you state "It doesn't turn off with the formatting characters, either." That, I assume, is a reference to Show/Hide.

You can remove (or change) this character using Find/Replace. The arrow character is ^l (manual line break), and you can find it under the Special menu of the Find/Replace dialog. If you can not see this, click "More" (on the Replace dialog), and then click "Special".

Or you can simply put in ^l in the Find box.

Now you have a choice. If you put nothing in the Replace box, then the arrow character will be removed. This will make any text after the arrow character now be adjacent to the character BEFORE the arrow character. In other words, you will no longer have a line break.

Or, you can put ^p in the Replace box. This will replace the arrow character with a real paragraph mark, thus retaining the line break...but it will make the following line a new paragraph. Depending on whether you are properly using Styles, or not, this may have consequences you do not want.


Gerry
 
Yes, the arrow shaft goes up, then turns to the right before the arrow head at the end. It doesn't display in the symbol table when viewing it, but when I highlight it with the next character, then it shows in the symbols two symbols before the character whose default hotkey is CTRL-NumLock - (minus). The font is Times New Roman for that individual character ONLY each time, but the rest of the document is Book Antiqua.

fumei, you are correct that the Show/Hide does not turn off this character.

It appears to be ASCII code 253, or 0xfd, from the RTF file that I converted the .doc file to. I viewed the RTF in a text editor to get the code, then removed one of the \'fd characters, saved the file, and that one arrow was gone from the modified RTF document.

I tried to create a VBA macro to get rid of this character, but am inexperienced in VBA (I do well in VB6, though). I recorded a macro for replacing a letter, then modified it to search for the ASCII 253 character. I know this isn't the VBA forum, but would appreciate any help with this macro if there's something wrong with it. It doesn't replace the character like I had hoped, so I suspect I'm missing something.

Code:
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = Chr(253)
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindAsk
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

Lee
 
Hmmmm. ASCII 253 shows as a little "z" kind of character in the ASCII table.

On the other hand, Alt+0253 in Word gives Ý.

I still can not find the arrow character as you describe. If your code above is not working then Chr(253) is not correct.

I inserted Chr(253) like this:
Code:
Selection.TypeText Text:=Chr(253)
and it put in Ý. No arrow. If I then select that character, and execute:
Code:
MsgBox Asc(Selection.Text)
I get 253. So the character Ý does seem to be Chr(253)...not your arrow. Nor the little "z" character that the web site I liked to above shows as 253. How did you determine it was 253? I DO see in the Symbols dialog that the Unicode for 253 is 00fd though (Alt+ 0253)...so I am really confused.

What happens if you select this character - I know you stated you could not but could you try again? Perhaps selecting it and doing some wriggling with the arrow keys to get just that character. Then doing a Asc(Selection.Text) to get its ASCII number.

Regarding your code, it is not working because I suspect the character is not 253. It may be appropriate to move this thread to the VBA forum, but for the moment, no, this is not a VBA question really.

BTW: in terms of replacing, better code would be:
Code:
With ActiveDocument.Range.Find
    .Text = Chr(253)
    .Replacement.Text = ""
    .Execute Replace:=wdReplaceAll
End With
Try to avoid using Selection. The above is simpler and does not use GUI resources (Selection does).

Can you detail where this file is coming from? You state: "from the RTF file that I converted the .doc file to"

My bolding.

Just to clear...you have a .DOC file, and you are converting it to an RTF and it is in the RTF file that you are having this issue? Does that mean these characters are NOT in the .DOC file????

Gerry
 
BTW: I am hoping to get some input/thoughts from the real Word gurus here. Tony? macropod?

Gerry
 
The character doesn't show up in the symbol table unless I select it. In Times New Roman, the character comes after the Arabic characters, and is the third character after the lower case y with a tilde over it. When I get ALL the characters, it's in the 33rd row of 28 characters, the 16th character. If I don't select that character, the symbol table only has 24 rows.

The arrows display in the original Word document, the doc file. I converted the .doc file to an RTF file to see if they still would display, and they did. The same character is in both .doc and .rtf files.


It looks like the font is actually Times New Roman (Hebrew), according to the font reference in the MS Word RTF file.
Code:
{\f182\froman\fcharset177\fprq2 Times New Roman (Hebrew);}
and RTF code in the document:
Code:
{\f182 \'fd}

I also opened the RTF file in WordPad because I know that program strips all the extra MS stuff out of the RTF files. In the resulting file, here is the plain RTF code for that character:

Code:
\lang1037\f1\rtlch\ltrmark\
where Font 1 (f1) is defined as charset177, like in the MS Word RTF document.

I'm going to try to attach a .jpg of a screenshot of a line from the file to show what the arrows look like.

Getting the ASC value of the character returns 63. I tried several different arrows and got the same result, and tested it with other letters to make sure it was returning the correct values. It is correct, though I'm not sure why the MS Word RTF file shows it as character 253 for that font.

The question on how to easily get rid of the character is from my sister-in-law and she has to edit many of the documents she receives from her company to remove the characters before printing them and passing them out to her staff.

I appreciate all your help so far.

Lee
 
fumei, just to experiment, I used AscW instead of Asc in the MsgBox code you provided, and the character came back 8206. I then used the replace VBA code you provided with ChrW(8206), and all the characters were replaced like I wanted.

Thanks, you get a star. Still not sure WHY the character is in there, but that's another question in itself.

Lee
 
I think the glyph is somewhat arbitrary - several fonts show a double quaver. The character is a non-printing left to right mark. It is a control character that newer versions of Word will not show. That doesn't mean it isn't there, nor that it isn't meant to be there.

That you see it in a Hebrew font suggests that someone is throwing English text (which they want to be left to right) into a Hebrew (a right to left language) formatted document.

I don't know if there's anything you can do about the display (except upgrade Word), but if the document is entirely in English, and formatted as left to right anyway then the presence or absence of the character will probably have no effect.

Enjoy,
Tony

------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

I'm working (slowly) on my own website
 
Hi trollacious,

FWIW ChrW(8206) is a 'checked' checkbox character in the Windings font. perhaps that's what was meant to be there?

Cheers

[MS MVP - Word]
 
As Tony hinted, the people sending you the document must be using bi-directional text. That is, the text running left to right or right to left. ???The long shaft up and then short right with an arrow indicates that an LRM (left-to-Right mark) is being inserted at that point. Your Char(8206) is an LRM. If you were using HTML the same bi-directional mark would be inserted using ‎ or ‎ or (U+200E).

Hope that helps.


I don't particularly care about apathy
 
BTW, looking at Word under "Find and Replace", there is a special ^h to replace LRM or as Word describes it, an LTR Mark.

Searching for ltr in Word help brings up "Find and replace special right-to-left characters "

I don't particularly care about apathy
 
It's a document from a company that handles the displays of samples at a grocery store to try to get you to buy the product, and everything is from the U.S.

She said the arrows DO print and that's why she needs to fix them. In the screenshot I attached to one of my posts, you can see that the characters would make no sense as checkboxes if it were the WingDings font.

It sounds like maybe whoever is creating the document has Times New Roman (Hebrew) as their default font (probably accidentally).

As another experiment, I selected all the text and changed the font to SimSun, a Chinese font. The arrows disappeared.

I sent her the macro that I modified with ChrW from fumei's code above to replace text and will see if she can get that working. She's not real familiar with macros, but said she did record one the other day in Open Office and it worked fine. She's not a programmer or geek type, but once she learns something she's good with it.

Thanks for all the input.

Lee

 
she did record one the other day in Open Office and it worked fine."



and there you go. And there I go, if I am ever forced to "upgrade" to [cannon]2007.

In any case, a most interesting problem and I am glad you got something out of here that helped, sort of, I guess.

How could someone have Hebrew accidentally?

Gerry
 



Hey Gerry. Don't go POSTAL on us! ;-)

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top