KarenB2
02-21-2020, 12:50 PM
Hi -I am a first time poster
I have a word document with many bookmarks. I created the macro below to simply go to a bookmark in my file and insert it to a new file. If I open the file and click on the macro right away, it works. But after that, it throws the error 5174. Any help is appreciated. I am not very practiced in exploring these things in word
Private Sub CommandButton2_Click()
Windows("Master Documents file").Activate
Documents.Add Template:="Normal", NewTemplate:=False, DocumentType:=0
Selection.InsertFile FileName:="Master Documents file.docm", Range:= _
"Charter", ConfirmConversions:=False, Link:=False, Attachment:=False
Windows("Master Documents file").Activate
End Sub
Thanks for even reading and help would be sooooooooooo appreciated
I have a word document with many bookmarks. I created the macro below to simply go to a bookmark in my file and insert it to a new file. If I open the file and click on the macro right away, it works. But after that, it throws the error 5174. Any help is appreciated. I am not very practiced in exploring these things in word
Private Sub CommandButton2_Click()
Windows("Master Documents file").Activate
Documents.Add Template:="Normal", NewTemplate:=False, DocumentType:=0
Selection.InsertFile FileName:="Master Documents file.docm", Range:= _
"Charter", ConfirmConversions:=False, Link:=False, Attachment:=False
Windows("Master Documents file").Activate
End Sub
Thanks for even reading and help would be sooooooooooo appreciated