Hey,
There are a couple of ways..........
The ShowMailItem can be used and you can set the To, CC, BCC, Subject and Body of the email message.
Function OpenEmailWindow(eventObj)
'Opens an email window with prefilled subject line and with form as xml attachment (no HTML version).
On Error Resume Next
If Err.number <> 0 Then
eventObj.ReturnStatus = False
Exit Function
End If
Set oFormNum = XDocument.DOM.selectSingleNode("//my:FORMINFO/my:FormNumber")
Set oFormName = XDocument.DOM.selectSingleNode("//my:FORMINFO/my:FormTitle")
formSubj = oFormNum.text & " - " & oFormName.text
XDocument.UI.ShowMailItem "", "", "", formSubj,""
eventObj.ReturnStatus = True
Exit Function
End Function
Or if you have MS Outlook 2003, you can code directly to it:
Sub CreateMailMsg(sTo, sCC, sBCC, sSubj, sBody, sAttachFile)
'purpose creates an outlook message and attaches the MHT file created above
'date 04/19/2006
Dim objOlApp
Dim objItm
Set objOlApp = CreateObject("Outlook.Application")
Set objItm = objOlApp.CreateItem(olMailItem)
With objItm
.To = sTo
.CC = sCC
.BCC = sBCC
.Subject = sSubj
.Body = sBody
.Attachments.Add sAttachFile
.Display
End With
End Sub
Hope that helps,
Mary