T
Tony Broadbent
I want to have a standard word document, which fills itself with data from
the database, based on an order number. I then want to call this document
from either Outlook, or Excel, passing in a parameter of the order number.
Currently I have all the code in Outlook to populate the document, but I
really want to move the code into the word template, to avoid having to
replicate the same code in both Outlook and Excel.
How, from Outlook or Excel, do I get this parameter into my Word procedure?
Currently I use something like:
Set myWord = GetObject(, "Word.Application")
Set myWordDoc = myWord.Documents.Add(strTemplatePath)
Ideally I want to just call
myWordDoc.myMacro(myOrderNo)
or something like that, but I suspect it's not so simple.
Any suggestions or guidance much appreciated.
(Apologies if this is a repeat post, I got 'page not found' when I tried to
submit).
the database, based on an order number. I then want to call this document
from either Outlook, or Excel, passing in a parameter of the order number.
Currently I have all the code in Outlook to populate the document, but I
really want to move the code into the word template, to avoid having to
replicate the same code in both Outlook and Excel.
How, from Outlook or Excel, do I get this parameter into my Word procedure?
Currently I use something like:
Set myWord = GetObject(, "Word.Application")
Set myWordDoc = myWord.Documents.Add(strTemplatePath)
Ideally I want to just call
myWordDoc.myMacro(myOrderNo)
or something like that, but I suspect it's not so simple.
Any suggestions or guidance much appreciated.
(Apologies if this is a repeat post, I got 'page not found' when I tried to
submit).