jasonoski
New Member
- Joined
- Sep 8, 2004
- Messages
- 27
I need to rename the emailed object I'm sending so it attaches as the name of a variable I define, "MyTerr" not the name of the object. I am using a MAPI compliant email system (GroupWise) so I don't think I can use any of the snazzy Outlook commands. Here is the simple code I have:
Any assistance is GREATLY appreciated.
Code:
Private Sub emailStuff_Click()
On Error GoTo Err_emailStuff_Click
Dim MyTerr As String
Dim MyAddr As String
Dim stDocName As String
Dim strSubject As String
Dim strBody As String
MyTerr = "1101"
stDocName = "qry_emailfile"
MyAddr = "me@anyemail.com"
strSubject = "Attachment Test"
strBody = "Look! I can insert a message into the body of an email!"
DoCmd.SendObject acSendQuery, stDocName, acFormatXLS, strAddress, , , strSubject, strBody, 0
Exit_emailStuff_Click:
Exit Sub
Err_emailStuff_Click:
MsgBox Err.Description
Resume Exit_emailStuff_Click
End Sub