i need some help with a macro i am wring in MS Word 2010.
my master document has one page only (page1). On this page i have various information and also a combobox in the middle of this page within a table.
The combobox is used to insert other word documents into my master document. So basically if i select "Concrete" from the dropdown it will insert "W:\concrete.docx" into my master, same if i was to select "Steel" it will insert "W:\steel.docx" into my master.
The above works but here is the problem i need help with please:
I need the inserted file to be inserted at the end of my document, however it seems to go on my first page, at the top of page 1 and it moves my header to the last page, very wierd.
Secondly, as there are multiple options within the drop down, if someone picks one, and the file is inserted, then changes thier option in the dropdown, i want it to delete all page from 2 to the end, and insert the new file, i can do the insert part from cannot figure out how to delete pages from 2 to the end.
Here is the code i have so far:
Private Sub ComboBox1_Change()
FilePath = "W:\FileLocation\"
Set TheRange = ActiveDocument.Content
TheRange.Start = TheRange.End
TheRange.InsertFile FileName:=FilePath & ComboBox1.Text & ".docx"
any assistance would be greatfully recieved. thanks.