RIAS
asked on
Wordmerge
Hello,
I have a code for wordmerge but, the match case doesnt seem to work .
I have TO: and To: to replace and it is not able to distinguish between the cases and replaces everthing .
I have a code for wordmerge but, the match case doesnt seem to work .
I have TO: and To: to replace and it is not able to distinguish between the cases and replaces everthing .
If dtSQL.Rows(0)("Guestname").ToString Is DBNull.Value = False Then
With oDoc.Content.Find
.Forward = True
.Format = False
.MatchCase = True
.MatchWholeWord = True
.MatchWildcards = True
.MatchSoundsLike = True
.MatchAllWordForms = False
.Font.Bold = False
oDoc.Content.Find.Execute(FindText:="TO:",
ReplaceWith:="TO: " & dtSQL.Rows(0)("Guestname").ToString, Replace:=Microsoft.Office.Interop.Word.WdReplace.wdReplaceAll)
End With
End If
ASKER
Cheers! will try and get back!
ASKER
wdFindContinue is not declared?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Mate,
This code worked
This code worked
With oDoc.Content.Find
.Text = "To:"
.Replacement.Text = "^& " & dtSQL.Rows(0)("Guestname").ToString
.Forward = True
.Wrap = Microsoft.Office.Interop.Word.WdFindWrap.wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute(Replace:=Microsoft.Office.Interop.Word.WdReplace.wdReplaceAll)
End With
ASKER
Cheers!.
Is there a way I can replace the text with lower case?
Is there a way I can replace the text with lower case?
try by replacing ^& in the replacement text with to:
ASKER
Cheers mate!
pls try
Open in new window
Regards