How can insert acute accent for selection of character into word?

A

avkokin

Hi. How can insert acute accent for selection of character into word?
For example, I inserting acute accent like this:

Selection.InsertSymbol Font:="Times New Roman",
CharacterNumber:=769, Unicode:=True

But it replace my selection character. If I add:

Selection.Collapse direction:=wdCollapseEnd

That nothing do.

There is screenshot that show what I want:
http://img.photobucket.com/albums/v190/baston/toaccent.gif

P.S. Acute accent is diacritical mark.
 
G

Graham Mayor

If you use a Greek Keyboard layout in Windows the accent key is located in
the position of the semi colon key on an English keyboard. It is easier to
type the word correctly in the first place that to use vba to change it
afterwards, however to do so with your macro, you need to move the cursor to
the end of the selected character *before* adding the accent.

With Selection
.MoveRight Unit:=wdCharacter, Count:=1
.InsertSymbol Font:="Times New Roman", CharacterNumber:=769,
Unicode:=True
End With

or using collapse

With Selection
.Collapse direction:=wdCollapseEnd
.InsertSymbol Font:="Times New Roman", CharacterNumber:=769,
Unicode:=True
End With

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
A

avkokin

If you use a Greek Keyboard layout in Windows the accent key is located in
the position of the semi colon key on an English keyboard. It is easier to
type the word correctly in the first place that to use vba to change it
afterwards, however to do so with your macro, you need to move the cursor to
the end of the selected character *before* adding the accent.

With Selection
.MoveRight Unit:=wdCharacter, Count:=1
.InsertSymbol Font:="Times New Roman", CharacterNumber:=769,
Unicode:=True
End With

or using collapse

With Selection
.Collapse direction:=wdCollapseEnd
.InsertSymbol Font:="Times New Roman", CharacterNumber:=769,
Unicode:=True
End With

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web sitewww.gmayor.com
Word MVP web sitehttp://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>










- Show quoted text -

Yes, Thank you. It's work. But why my variant (with Collapse) don't
worked? mysticism...
 
A

avkokin

Yes, Thank you. It's work. But why my variant (with Collapse) don't
worked? mysticism...- -

- -

I have next code:
Sub accent()
Dim selChar As Long
selChar = AscW(Selection.Range.Characters(1))
If Selection.Type = wdSelectionIP Then
MsgBox prompt:="Nothing selection", Title:="Select a character"
Else
' How delete accent mark?
With Selection
.Collapse direction:=wdCollapseEnd
.InsertSymbol CharacterNumber:=769, Unicode:=True
End With
End If
End Sub

Now I need delete Character (769) from selection text (if it exist).
How I can delete it?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top