Hey guys,
I have the following code. I am trying to have a macro that when it is executed from word it will attach the active document in an outlook email. The new email needs to be a template that is already created.
Public Function emailtemplate()
Dim MyOLApp As Outlook.Application
Dim MyItem As Outlook.MailItem
Set MyOLApp = CreateObject("Outlook.Application")
Set MyItem = MyOLApp.CreateItemFromTemplate("C:\Users\oneilp6\Documents\test.oft")
Set MyItem = Nothing
Set MyOLApp = Nothing
End Function
Right now I get a Compile Error:
User-defined type not defined
at Line 2
Thanks for any help
Bookmarks