colinmitton
Technical User
I have recorded a macro to insert text to a part of a document, It effective finds a particular set of text in the document and inserts a word document in the place. As shown here :
Sub text1()
'
' text1 Macro
'
Selection.Find.ClearFormatting
With Selection.Find
.Text = "***"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.InsertFile FileName:="Test.doc", Range:="", ConfirmConversions:= _
False, Link:=False, Attachment:=False
End Sub
The Next step for me is to have the user select the file to insert instead of me having to right a macro for each document! Could anyone help please.
Thanks
Colin
Sub text1()
'
' text1 Macro
'
Selection.Find.ClearFormatting
With Selection.Find
.Text = "***"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.InsertFile FileName:="Test.doc", Range:="", ConfirmConversions:= _
False, Link:=False, Attachment:=False
End Sub
The Next step for me is to have the user select the file to insert instead of me having to right a macro for each document! Could anyone help please.
Thanks
Colin