Mollethewizard
IS-IT--Management
Is it possible to put some text at the top of the body in a fetched template via VBA code?
The main body of the template is sent to different users with a text at the top of the body that differs (a text string that have a number of variables from textboxes in the user form. I hope that you understand what i am trying to achieve.
Sub Win7medarb()
Set myOlApp = CreateObject("Outlook.Application")
Set MyItem = myOlApp.CreateItemFromTemplate("K:\Outlook\Nymedarb.oft")
With frmWin7medarb
.Show
End With
With MyItem
.To = frmREXxp.txtRecipient
End With
MyItem.display
frmREXxp.txtRecipient = ""
Set MyItem = Nothing
Set myOlApp = Nothing
End Sub
The main body of the template is sent to different users with a text at the top of the body that differs (a text string that have a number of variables from textboxes in the user form. I hope that you understand what i am trying to achieve.
Sub Win7medarb()
Set myOlApp = CreateObject("Outlook.Application")
Set MyItem = myOlApp.CreateItemFromTemplate("K:\Outlook\Nymedarb.oft")
With frmWin7medarb
.Show
End With
With MyItem
.To = frmREXxp.txtRecipient
End With
MyItem.display
frmREXxp.txtRecipient = ""
Set MyItem = Nothing
Set myOlApp = Nothing
End Sub