-
Problem with my search/replace macro
I trying to use this macro in excell, but it only opens the document, and not replacing. Can someone please help me finding whats wrong? The goal is to get the macro to fing where it sais XXXXX in the document, and replace it with the numbers given in Replacement.Text..
Sub Find_and_Replace()
Dim appWD As Object
Dim docWD As Object
Set appWD = CreateObject("Word.Application")
Set docWD = appWD.documents.Open("M:\Fugro_filer\testing\XXX.02 Project_manual_template.doc")
appWD.Visible = True
With docWD.Content.Find
.Text = "XXXXX"
.Replacement.Text = "123"
.Forward = True
.Wrap = 1
.Execute Replace:=2
End With
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules