Den Patrino
patrinod at gmail.com
Thu Aug 25 12:29:05 CDT 2011
I have the following procedure the works in Access 2003 and Outlook 2003 but does nothing in Access 2007 and Outlook 2007. I hate to say 'does nothing' but the user is in another location and I haven't stepped through the code or seen 1st hand what is happening except no one gets the mail. using the Access.mde (Access 2003) on the Access 2007 pc. There are no other problems. At this point, I'd like to know if anyone has had trouble with the DoCmd.SendObject acSendReport TIA, Patty Private Sub cmdMailReport_Click() On Error GoTo Err_cmdMailReport_Click Dim strDocName As String Dim strLinkCriteria As String Dim strEMailRecipient As String Dim strEMailCC As String Dim strSubject As String Dim strMessage As String If Me.Dirty Then DoCmd.RunCommand acCmdSaveRecord End If strDocName = "rptOffQuality" strLinkCriteria = "[ID_Num]=" & "'" & Me![txtID_Num] & "'" ' Print the current record on the printer DoCmd.OpenReport strDocName, acNormal, , strLinkCriteria strEMailRecipient = "userx at somewhere.com; usery at somewhere.com" strEMailCC = "userz at someone.com" strSubject = "Disposition of Product" strMessage = "The attached file was sent via the Production Foreman and" & _ vbCrLf & "contains important inspection requirements" ' Send the report via email DoCmd.SendObject ObjectType:=acSendReport, _ objectname:=strDocName, _ outputformat:="SnapshotFormat", _ To:=strEMailRecipient, _ Cc:=strEMailCC, _ Subject:=strSubject, _ MessageText:=strMessage Exit Sub Exit_cmdMailReport_Click: Exit Sub Err_cmdMailReport_Click: MsgBox Err.Description Resume Exit_cmdMailReport_Click End Sub