PDA

View Full Version : How insert emphasis for selection character



akokin
09-11-2007, 02:25 AM
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
or http://img.photobucket.com/albums/v190/baston/toaccent-2.gif

acute accent is diacritical mark.

Charlize
09-11-2007, 03:19 AM
- type your letter ?
- directly push the keys shift and left arrow
- push the keys shift and F3
- push right arrow

or you could try this macroSub accent_e_to_accent_E()
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Range.Case = wdNextCase
Selection.MoveRight Unit:=wdCharacter, Count:=1
End SuborSub o_accent()
Selection.TypeText Text:="?"
End Sub

akokin
09-11-2007, 03:53 AM
- type your letter ?
- directly push the keys shift and left arrow
- push the keys shift and F3
- push right arrow
... Thank you but it not that I want. I want to insert acute accent (or to accent or emphasis). That you suggested is letter case.

akokin
09-11-2007, 08:57 AM
OK. I did it. That code:

Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.InsertSymbol CharacterNumber:=769, Unicode:=True

TonyJollans
09-11-2007, 09:03 AM
If I understand correctly ...

Unicode character 301 (decimal 769) is the combining acute accent.

If you want one by itself use U+00B4 (decimal 180) instead.

TonyJollans
09-11-2007, 09:05 AM
Looks like I didn't understand - and still don't :)

fumei
09-11-2007, 09:26 AM
Neither do I. Why are you adding (or combining as Tony mentions) an accent? For example, why are you adding the accent to the "E" of "YELLOW"??????

akokin
09-11-2007, 10:20 AM
I have put an accent sign on Y but probably was mistaken.

akokin
09-12-2007, 08:35 PM
Ok. 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? Check here.
With Selection
.Collapse direction:=wdCollapseEnd
.InsertSymbol CharacterNumber:=769, Unicode:=True
End With
End If
End Sub
Now I want delete Character (769) from selection text (if it exist).
How I can delete it? :banghead:
Thank you!

fumei
09-16-2007, 09:47 PM
I am not following this at all. You ask how to add the accent, now you are asking how to delete it?

What are you doing???????

akokin
09-16-2007, 11:28 PM
I am not following this at all. You ask how to add the accent, now you are asking how to delete it?

What are you doing???????
Sorry if I confused you. I just wanted to get solution that first set accent and then delete it (for selection text). I solved this problem:

Sub accent2()
Dim rAcc As Range
Dim rTmp As Range
Set rTmp = Selection.Range
If Selection.Type = wdSelectionIP Then
MsgBox prompt:="Selection not found", Title:="Check"
ElseIf Len(rTmp) = 2 Then
For Each rAcc In rTmp.Characters
If AscW(Right(rAcc, 1)) = 769 Then
rAcc = Left(rAcc, 1)
End If
Next rAcc
Else
Selection.Collapse direction:=wdCollapseEnd
Selection.InsertSymbol characternumber:=769, unicode:=True
End If
End Sub
Thank you very much.

fumei
09-17-2007, 08:56 AM
Ummm