jthomas666
Technical User
Word 07
I'm working on a project to automate document generation. To do this, I need to be able to input some variables, and then replace certain strings in the document with those variables.
I've managed to cobble together the following code, but it isn't working.
------------------
Main = InputBox("What is the Release Line for this bulletin? (CS08 V2, CS08 V3, V5.57, etc.")
With Selection.Find
.Text = "[Release Line]"
.Replacement.Text = Main
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
With Selection.Find
.Text = "[Release Name]"
.Replacement.Text = SBName
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
------------------------------------
What am I doing wrong?
I'm working on a project to automate document generation. To do this, I need to be able to input some variables, and then replace certain strings in the document with those variables.
I've managed to cobble together the following code, but it isn't working.
------------------
Main = InputBox("What is the Release Line for this bulletin? (CS08 V2, CS08 V3, V5.57, etc.")
With Selection.Find
.Text = "[Release Line]"
.Replacement.Text = Main
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
With Selection.Find
.Text = "[Release Name]"
.Replacement.Text = SBName
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
------------------------------------
What am I doing wrong?