As a newbie to VBA i apologize in advance if this seems a little simple!
i am trying to code a document so when a specific option is checked an existing word doc is added to the document in question.
currently i have the following code
Private Sub CheckBox1_Click()
If (CheckBox1.Value = True) Then Selection.EndKey Unit:=wdStory
ChangeFileOpenDirectory "C:\Users\FILE LOCATION HERE"
Selection.InsertFile FileName:="Event Risk Assessment 1.docx", _
Link:=False, Attachment:=False
End Sub
this works fine upon 'checking' the box however when 'unchecking' it simply repeats the process however instead of inserting at the end of the document it places it where the checkbox is.
The ideal is so that when the box is 'unchecked' it deletes/removes the inserted document altogether.
as another point i could only find out how to insert the document after the last paragraph using code
Selection.EndKey Unit:=wdStory
I was hoping you might be able to share a code which will insert it at the bottom of the existing doc on a new page
any help greatly appreciated.
Bookmarks