Tbomb65
05-26-2017, 01:53 PM
I'm going crazy.
I feel like what I am trying to do is very simple but I cant work out how to do it nor find anywhere that specifically gives me my answers.
I am trying to add into the body of an already open email (Be it a reply or a new email) at whichever point the cursor currently is an "object" using VBA.
Effectively I want to automate doing the Insert > Object > Create from file commands and specify a file path so that I can create a button that allows a one click solution.
I started investigating using templates but that only seemed to work well when creating a brand new email and didn't appear to be able to be done multiple times in the same email (in the case where 2 or 3 templates needed to be used).
As there is no ability to record in Outlook I cant replicate the steps without writing the code, which outside of excel I have no idea how to do.
I have this code which im trying to modify to be relevent but im not getting anywhere
Sub CreateFromTemplateCPDR()
Dim myOlApp As Outlook.Application
Dim myItem As Outlook.MailItem
Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItemFromTemplate("C:\Users\File.xls")
myItem.Display
End Sub
I feel like what I am trying to do is very simple but I cant work out how to do it nor find anywhere that specifically gives me my answers.
I am trying to add into the body of an already open email (Be it a reply or a new email) at whichever point the cursor currently is an "object" using VBA.
Effectively I want to automate doing the Insert > Object > Create from file commands and specify a file path so that I can create a button that allows a one click solution.
I started investigating using templates but that only seemed to work well when creating a brand new email and didn't appear to be able to be done multiple times in the same email (in the case where 2 or 3 templates needed to be used).
As there is no ability to record in Outlook I cant replicate the steps without writing the code, which outside of excel I have no idea how to do.
I have this code which im trying to modify to be relevent but im not getting anywhere
Sub CreateFromTemplateCPDR()
Dim myOlApp As Outlook.Application
Dim myItem As Outlook.MailItem
Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItemFromTemplate("C:\Users\File.xls")
myItem.Display
End Sub