B
Brian McCullough
Hello all!
I am trying to automate the Find and Replace functionality in Word XP. My
VBA code is below and i am having problems when I try to use a " (double
quote) in the Replacement.Text value. Word tries to convert it to an open
quote character, rather than just a double quote character, i think.
Set m_objWord = New Word.Application
Set objDoc = m_objWord.Documents.Add(Template:="MyTemplate.dot",
NewTemplate:=False)
Set objRange = objDoc.Content
'objField below is a custom object that stores Name/Value pair...
With objRange.Find
.Text = "<<" & objField.Key & ">>"
.Replacement.Text = cstr(objField.Value) 'the value i am trying
to use as replacement text is: Ë88534"Î
.Forward = True
.Wrap = 1 'wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute Replace:=2 'wdReplaceAll
End With
Any help/input is greatly appreciated!!!
Thanks!
Brian
I am trying to automate the Find and Replace functionality in Word XP. My
VBA code is below and i am having problems when I try to use a " (double
quote) in the Replacement.Text value. Word tries to convert it to an open
quote character, rather than just a double quote character, i think.
Set m_objWord = New Word.Application
Set objDoc = m_objWord.Documents.Add(Template:="MyTemplate.dot",
NewTemplate:=False)
Set objRange = objDoc.Content
'objField below is a custom object that stores Name/Value pair...
With objRange.Find
.Text = "<<" & objField.Key & ">>"
.Replacement.Text = cstr(objField.Value) 'the value i am trying
to use as replacement text is: Ë88534"Î
.Forward = True
.Wrap = 1 'wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute Replace:=2 'wdReplaceAll
End With
Any help/input is greatly appreciated!!!
Thanks!
Brian