Hello all,
I am not very good with access code but here is my issue: We create a Work Order and print that for each call. Works fine. If we click on "Email Work Order" it converts it to a pdf , and attaches it to Outlook. This worked seamlessly in XP/2003 version. Just upgraded to Windows 7 and Office 2013 and when you email the same Work Order, it flips it to landscape (11"x8.5") but not any of the characters so it's cropped. Is it something in the code? See code below. And thank you all in advance.
Private Sub E_Mail_Work_Order_Click()
'On Error GoTo Err_E_Mail_Work_Order_Click
Dim stDocName As String
DoCmd.RunCommand acCmdSaveRecord
Set db = CurrentDb
strFrontEndPath = db.Name
Do While Right(strFrontEndPath, 1) <> "\"
strFrontEndPath = Left(strFrontEndPath, Len(strFrontEndPath) - 1)
Loop
strReportPathandName = strFrontEndPath & "WorkOrder-" & Forms!Callsheet!WO & ".pdf"
'MsgBox strReportPathandName
Call ConvertReportToPDF("Work Order", , strReportPathandName, , False)
'stDocName = "Work Order"
'DoCmd.SendObject acReport, strReportPathandName
Dim myolApp As Outlook.Application
Dim myItem As Outlook.MailItem
Dim strDataFileName As String
Set myolApp = CreateObject("Outlook.Application")
Set myItem = myolApp.CreateItem(olMailItem)
strEmail = Nz(DLookup("fldCustomerEmail", "tblCustomerPerson", "fldCustomerID = " & Me.fldCustomerID))
myItem.To = strEmail
myItem.Subject = "Docu-Flow = Work Order # " & Me.WO
myItem.Attachments.Add strReportPathandName
'myItem.Send
myItem.Display
Exit_E_Mail_Work_Order_Click:
Exit Sub
Err_E_Mail_Work_Order_Click:
MsgBox Err.Description
Resume Exit_E_Mail_Work_Order_Click
End Sub