Results 1 to 9 of 9
  1. #1
    Compufreak is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jul 2012
    Posts
    70

    can your report name be sent to an email subject

    Hi all

    just out of curiosity ... i would like to know if it is possible to get the report name as an email subject ... once the report has been put in pdf?

  2. #2
    DatabaseMakers is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2012
    Location
    London
    Posts
    12
    You would have to do it when creating the pdf and normally you would do something like:
    DoCmd.SendObject acSendReport, "YourReportName", acFormatPDF, "SendToEmail", , , "YourReportName", "YourText", True

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,900
    I will say yes. What procedure are you using to create the pdf?

    Here is one example of code sending email. https://www.accessforums.net/access/...ess-28311.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    Compufreak is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jul 2012
    Posts
    70
    im using a macro to send the report in pdf to be emailed.

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,900
    I use only VBA so not sure how macro would handle this. I would have to review code if you want to provide db. Follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    Compufreak is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jul 2012
    Posts
    70
    i would upload the database but it is to huge ....

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,900
    Did you make copy, remove confidential data, delete records (a few for testing would be nice), run Compact & Repair, zip? Still too large? Can upload to fileshare site such as Box.com and post link to the file.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #8
    Compufreak is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jul 2012
    Posts
    70
    Private Sub Command21_Click()
    On Error GoTo Command21_Click_Err
    DoCmd.SendObject acSendReport, "Search_by_Clusters and date", "PDFFormat(*.pdf)", "", , , Text28.Value = namepri, "", True
    Command21_Click_Exit:
    Exit Sub
    Command21_Click_Err:
    Select Case Err.Number
    Case 2501
    MsgBox "You have not sent an email.", vbInformation
    Case Else
    MsgBox "Error " & Err.Number & " " & Err.Description
    End Select
    Resume Command21_Click_Exit
    End Sub

    so the above code works well with putting the report in PDF , but my subject line does not seem to wanna bring the report name

    June 7 i aint sure if you can help but i have recoded this thing from a macro to VBA

  9. #9
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,900
    The argument cannot be an equation. That makes no sense. The result of the equation is either True or False (-1 or 0) and that would be the Subject. What were you intending by using the equation: Text28.Value = namepri ?

    DoCmd.SendObject acSendReport, "Search_by_Clusters and date", "PDFFormat(*.pdf)", "", , , "Search_by_Clusters and date", "", True
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 04-13-2011, 10:11 AM
  2. Email from report to Email body
    By Ehmke66 in forum Programming
    Replies: 4
    Last Post: 01-03-2011, 01:06 PM
  3. VBA check for email subject line
    By problem_addic in forum Access
    Replies: 4
    Last Post: 03-12-2010, 02:33 PM
  4. Field Name into Subject/Body of an email?
    By Stanggirlie in forum Programming
    Replies: 0
    Last Post: 01-05-2009, 11:51 AM
  5. Email field name into subject/body?
    By Stanggirlie in forum Access
    Replies: 0
    Last Post: 01-02-2009, 11:07 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums