How to replace the specifical characters?

  • Thread starter Thread starter Togetherwith
  • Start date Start date
T

Togetherwith

Hi,
I have a simple problem. I search the solution in the internet for
while, but still can not find it.
My question is how to repalce the specifical characters with othe
characters.
My code:

ActiveDocument.Paragraphs(2).Range(2, 3).TypeText Text:="zh"

The objective of the code is to replace the second and third character
in 2nd paragraph with "zh". But it does not work. Could somebody tel
me how to sovle it? Thanks a lot.

moreover, if I want to replace the to characters with a number, such a
25, how to code it?

ActiveDocument.Paragraphs(2).Range(2, 3).TypeText Text:= "25"

is right
 
Not sure if that means you worked it out or not.

Dim myrange As Range
Set myrange = ActiveDocument.Paragraphs(2).Range
myrange.Start = myrange.Start + 1
myrange.End = myrange.Start + 2
myrange = 25


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
Back
Top