I have a macro that I run in Outlook. At the end of that macro there is this code:
job = ImputBox("Enter Job Number") Dim word As Object Set word = CreateObject("Word.Application") Template = "C:\Users\tbaker\Documents\Template.docm" With word .Visible = True .Application.Activate .Documents.Open (Template) End With
I am wondering if there is some code I can put into the "With word" block that would write the "job" variable into the Word document, and then some Word VBA code to read this "job" variable for use inside some Word macros saved in the Template.docm file that this code is opening.
I don't have any idea how to write this, but something like this mock code:
And then in the Template.docm file a macro would be something like this:
Is anything like this possible? I imagine (though I haven't tested it) that it would be possible in excel by using something like "Excel.Sheets("Sheet1").Range("A1") = job" and then in excel "job = Sheets("Sheet1").Range("A1")" or something similar, but don't have any idea how/if its possible with word and outlook?
Thanks in advance.