T
TJ Forshee
I am using VB6 and Word97 - from VB I can open a new doc, I can find text, I
can add text, I can add Inline pics....... but I can't for the life of me get
it to replace text.
I have tried all kinds of examples and ideas......
This works..... but will only do the 1st find... and puts text in even if
the find fails....
msword.Selection.Find.Execute FindText:=oldStuff, Forward:=True
msword.Selection.TypeText Text:=newStuff
This does not work for me.....it does nothing......
msword.Selection.Find.Execute FindText:=oldStuff, ReplaceWith:=newStuff,
Forward:=True
Resetting the Find does not help make the above work.......
With msword.Selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute
End With
This should be easy..... HELP ! I liked Word.Basic so much better
can add text, I can add Inline pics....... but I can't for the life of me get
it to replace text.
I have tried all kinds of examples and ideas......
This works..... but will only do the 1st find... and puts text in even if
the find fails....
msword.Selection.Find.Execute FindText:=oldStuff, Forward:=True
msword.Selection.TypeText Text:=newStuff
This does not work for me.....it does nothing......
msword.Selection.Find.Execute FindText:=oldStuff, ReplaceWith:=newStuff,
Forward:=True
Resetting the Find does not help make the above work.......
With msword.Selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute
End With
This should be easy..... HELP ! I liked Word.Basic so much better