Gavint
04-04-2007, 10:39 PM
I'm running code from a template and would like to do the following
call up another template
run some code on that template (finds bookmark in table based on specified criteria)
Return to original document with data (using bookmark range copy/paste)Typically I think would be done by storing the 2nd template in a startup directory and referencing the project. However, in this scenario I need to do this without any project references - can it be done?
I'm having trouble loading and switching to the 2nd template to run the code and then returning back to the original document.
I've tried playing with adding and activating without success. eg
dim Doc2 as Document
Doc2 = Documents.Add("DATA.DOT")
Doc2.Activate
As soon as I try and run any code, it crashes out. I guess I'm not sure how to identify both documents appropriately and switch between them to run code.
Bit of a newbie, so please excuse any poor terminology. Thanks!
call up another template
run some code on that template (finds bookmark in table based on specified criteria)
Return to original document with data (using bookmark range copy/paste)Typically I think would be done by storing the 2nd template in a startup directory and referencing the project. However, in this scenario I need to do this without any project references - can it be done?
I'm having trouble loading and switching to the 2nd template to run the code and then returning back to the original document.
I've tried playing with adding and activating without success. eg
dim Doc2 as Document
Doc2 = Documents.Add("DATA.DOT")
Doc2.Activate
As soon as I try and run any code, it crashes out. I guess I'm not sure how to identify both documents appropriately and switch between them to run code.
Bit of a newbie, so please excuse any poor terminology. Thanks!