Opening a Word Document within CURRENT Word Application - SOLVED!
Hi there
I am using the following code to open a Word Document:
Set oWord = CreateObject("Word.Application")
Set oDoc = oWord.Documents.Add(strHeaderLocation)
The problem is that each time a Word document is opened, it starts in a new application of Word rather than opening a new document within the current instance of Word.
Can somebody please help me with the code to open a Word document within the current instance of Word rather than creating a new Word application? I imagine i will also need to test whether Word is currently running so i can use my existing code if the user doesn't already have Word open.
Thanks
Richard
--------------------
I have such a bad habit of posting then solving my problem right away!
Solution was as follows:
Set oWord = Word.Application
Hi there
I am using the following code to open a Word Document:
Set oWord = CreateObject("Word.Application")
Set oDoc = oWord.Documents.Add(strHeaderLocation)
The problem is that each time a Word document is opened, it starts in a new application of Word rather than opening a new document within the current instance of Word.
Can somebody please help me with the code to open a Word document within the current instance of Word rather than creating a new Word application? I imagine i will also need to test whether Word is currently running so i can use my existing code if the user doesn't already have Word open.
Thanks
Richard
--------------------
I have such a bad habit of posting then solving my problem right away!
Solution was as follows:
Set oWord = Word.Application
Last edited: