Apologies if this is the wrong place to post this question, this is my first visit here. I have set up an email template and I want to use a macro to open it because I have to do this around 500 times. When I save my template it is by default saved in: C:\Users\username\AppData\Roaming\Microsoft\Templates\*.oft
I'm a VBA newbie but found this code to open a template:
but the problem is, running the macro opens up a new blank email. I'm guessing it has to do with the file path the macro is referring to. How would I change the code to reference the correct folder where my template is saved, so that when the macro is run, it opens up my template, rather than a blank email? Assume my template is called MyTemplateName.
Many thanks
I'm a VBA newbie but found this code to open a template:
Code:
Sub OpenCustomTemplate()
'Open template from a macro button added to the ribbon.
Set myFolder = Session.GetDefaultFolder(olFolderInbox)
Set myItem = myFolder.Items.Add("IPM.Form.MyTemplateName")
myItem.Display
End Sub
but the problem is, running the macro opens up a new blank email. I'm guessing it has to do with the file path the macro is referring to. How would I change the code to reference the correct folder where my template is saved, so that when the macro is run, it opens up my template, rather than a blank email? Assume my template is called MyTemplateName.
Many thanks