Hi,

I'm trying to write a VBA code in outlook that creates an email from the outlook template and references that email. I can do this if the template is located in my computer's hard drive. I can't do this when I try to open the template from outlook's folder itself. I want to create the email from outlook's folder, because this macro will be used on different computers.

The code below opens the template and creates an email. But I cannot find a way to reference that email to save/close/manipulate. Can anybody help me with this? Here's the code I have so far.

Sub GetTemplateInbox()
Dim olApp As Outlook.Application
Dim objNS As Outlook.NameSpace
Dim olFolder As Outlook.MAPIFolder
Dim olFolder1 As Outlook.MAPIFolder
Dim msg As Outlook.DocumentItem
Dim msg2 As Outlook.MailItem
Dim str As String


Set olApp = CreateObject("Outlook.Application")
Set objNS = olApp.GetNamespace("MAPI")
Set olFolder = objNS.Folders("Mailbox - Me") 'References the desired inbox
Set olFolder1 = olFolder.Folders("0 - 0 Inbox Storage").Folders("0. Templates") 'References the desired folder in the inbox

Set msg = olFolder1.Items("testing2.oft") 'References the template
msg.Display 'Opens the template

msg.Close (olPromptForSave) 'This does nothing
End Sub