Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2013
    Posts
    23

    Unanswered: Cannot attach and email report from MS Access

    Since upgrading to Office 2013 (365) I can no longer call Outlook and attach a report from with in MS Access. I receive the below error:

    The command or action 'SendObject' isn't available now.

    The code behind the event is below:

    ---------------------------

    Private Sub emailpdf2_Click()
    On Error GoTo Err_emailpdf2_Click

    Dim msgtext(15) As Variant
    Dim attach2 As String
    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "Quotation"
    stLinkCriteria = "[QuoteNumber]=" & Me![quotenumber]

    'attach2 = Forms!frmQuoteViewer2!attach2

    msgtext(1) = "Please find your Quotation attached."
    msgtext(2) = "Kind Regards."
    msgtext(3) = Me.staffname
    msgtext(4) = "Quotation - " & Me.quoteprefix & "" & Me.quotenumber & Me.contractclaim & ". " & Me.branch & " - " & Me.customercontact
    msgtext(5) = "*** Please note that supply on a manufactured to order basis and if Exact Quantities have not been requested we therefore reserve the right to supply and charge for up to a maximum of 5 extra lengths / pieces per section. *** "
    msgtext(6) = "*** Please take this into consideration when pricing your customer ***"

    DoCmd.GoToRecord , "", acPrevious
    DoCmd.GoToRecord , "", acNext


    If Me.customer = "KEYLIN" Then
    MsgBox "prices must all be to 2 decimal places.", vbOKOnly + vbExclamation, "2 Decimal Places"
    End If



    DoCmd.openreport stDocName, acViewPreview, , stLinkCriteria
    DoCmd.SendObject acReport, stDocName, "PDFFormat(*.pdf)", "", "", "", msgtext(4), msgtext(1) + vbCrLf + vbCrLf + msgtext(5) + vbCrLf + vbCrLf + msgtext(6) + vbCrLf + vbCrLf + msgtext(2) + vbCrLf + vbCrLf + msgtext(3), True, ""

    Exit_emailpdf2_Click:
    Exit Sub

    Err_emailpdf2_Click:
    MsgBox Err.Description
    Resume Exit_emailpdf2_Click

    End Sub

    ---------------------------

    Any help would be much appreciated

  2. #2
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    496
    Provided Answers: 24
    I've gotten this. I had to shut down the PC and restart and all the drivers reloaded and it worked.

  3. #3
    Join Date
    Oct 2014
    Posts
    268
    Provided Answers: 6
    Are you using 32 bit or 64 bit Office? I read some of the VB doesn't play nice with the 64 bit office suite.

  4. #4
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    496
    Provided Answers: 24
    Don't know bout that. Never had 64bit apps.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •