I am trying to open an Outlook 2010 email template using Excel. I get the following error:
"Runtime error" -2147287038 (80030002): Unable to open file: C: \ My \ Path \ MyTemplate.oft. The file may be missing, you may not have permission to open it, or it may be opened in another program. Right-click the folder that contains the file and select Properties to check its permissions for this folder. "
The file exists (in the right place), I checked the permissions (as far as I know how), and the file is not open yet.
Here is my code:
Sub Mail_experiment() Dim OutApp As Outlook.Application Dim OutMail As Outlook.mailitem Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItemFromTemplate("C:\My\Path\MyTemplate.oft") On Error Resume Next With OutMail .to = " myEmail@aol.com " .CC = "" .BCC = "" .Subject = "This is my Subject line" .Send End With On Error GoTo 0 Set OutMail = Nothing Set OutApp = Nothing End Sub
Thanks for any help !!!
source share