D
Diane
Group,
I am testing code that will find text such as "##" and replace it with a
docvariable.
I can successfully read a directory of over 500 MSWORD documents and find
text and replace text, but I need to find text and replace with a docvariable
field.
I want to add this code for my "replacement" but not having any luck doing
this:
"Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"DOCVARIABLE abc ", PreserveFormatting:=True
Selection.Font.color = wdColorDarkRed
My code that works with find/replace text :
With oWord.Selection.Find
.ClearFormatting()
.Text = "##"
If oWord.Selection.Find.Found = True Then
Numberoffiles += 1
End If
With .Replacement
.ClearFormatting()
.Text = "**TEST**"
.Font.Color = Word.WdColor.wdColorRed
End With
.Execute(Replace:=Word.WdReplace.wdReplaceAll)
End With
I am coding a VB.NET application with a MSWORD template.doc.
Using MSOFFICE 2003.
Diane
I am testing code that will find text such as "##" and replace it with a
docvariable.
I can successfully read a directory of over 500 MSWORD documents and find
text and replace text, but I need to find text and replace with a docvariable
field.
I want to add this code for my "replacement" but not having any luck doing
this:
"Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"DOCVARIABLE abc ", PreserveFormatting:=True
Selection.Font.color = wdColorDarkRed
My code that works with find/replace text :
With oWord.Selection.Find
.ClearFormatting()
.Text = "##"
If oWord.Selection.Find.Found = True Then
Numberoffiles += 1
End If
With .Replacement
.ClearFormatting()
.Text = "**TEST**"
.Font.Color = Word.WdColor.wdColorRed
End With
.Execute(Replace:=Word.WdReplace.wdReplaceAll)
End With
I am coding a VB.NET application with a MSWORD template.doc.
Using MSOFFICE 2003.
Diane