?
Solved

Can you email an access report as a .pdf file and if not - can you send the SnapShot viewer in the email?

Posted on 2008-09-30
16
Medium Priority
?
170 Views
Last Modified: 2013-11-28
This is a line of code I have from an old program:
             DoCmd.SendObject acReport, rec!ReportName, acFormatRTF, rec!EmailAddress, "", "", "" & GlobalCurrentDate & " - " & rec!TypeDesc & " - " & rec!ReportType & "", "", False, """"""

It works great, but for the report I'm sending now - it drops a lot of the formatting I need.  I'd like to send as a .pdf and we do have PDFCreator on the server.  I'm using Access 2003.  Again, if this is not possible, perhaps I can send the SnapShot Viewer in the email as well?  
Thanks!
0
Comment
Question by:c9k9h
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 5
16 Comments
 

Author Comment

by:c9k9h
ID: 22611464
...and another twist that is different from above.  When I sent the above report, it was one report that I sent to many people by looping through code.  This time, I have a report with 83 pages that I need to email to 83 different authors - and each author should only get there own page.  So I need to put a filter in there somewhere.  This is the function - it reads through a table.

Public Function EmailStatements() As String
    Dim DB As DAO.Database
    Dim rec As DAO.Recordset
    Set DB = CurrentDb()
    Set rec = DB.OpenRecordset("Testing_Table", dbOpenDynaset)
   
On Error GoTo ErrorHandling_Resume
   
With rec
    .MoveFirst
        Do While Not .EOF
                DoCmd.SendObject acReport, rec!ReportName, acFormatRTF, rec!TestEmail, "", "", rec!MonthYr, "", False, """"""
            rec.MoveNext
        Loop
End With

MsgBox "Files have been sent!", _
vbOKOnly + vbExclamation, "Success!"
   
ErrorHandling_Resume:
    Resume Next
   
End Function
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 22623042
c9k9h,

Your "twist" should actually be in a new question.
Remember, you are only allowed 1 question per post:
http://www.experts-exchange.com/help.jsp#hi23.

Question 1:
If you wish to send the report as a snapshot change:
acFormatRTF
to...
acFormatSNP

Question2.
Here is a sample of how to email individual reports (Filter loop)
You should change the Customer Email addresses to yours to test this, at first.
I am sure you can adapt this sample to work in your own database.
;-)

JeffCoachman
 
0
 
LVL 93

Expert Comment

by:Patrick Matthews
ID: 22623231
Jeff,

I think you forgot to attach the sample :)

Regards,

Patrick
0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 2000 total points
ID: 22623462
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 22623480
Matt,

I think I was too busy "Counting excel rows backwards" and I got confused!
:-)

Jeff
0
 

Author Comment

by:c9k9h
ID: 22634407
Jeff . . . you're absolutely correct.  This is two questions.  I'll withdraw this (if I can figure out how).
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 22634801
c9k9h,

As  jesture of good faith, I proposed a solution to both questions here.
;-)

So the question becomes,:
Did you investigate both solutions, and what were the results?

JeffCoachman
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 22634818
Let's keep the Q open because I had already proposed a solution to both "questions".
0
 

Author Comment

by:c9k9h
ID: 22634892
I'm confused.  I'm sorry.  I read through it quickly and thought no one wanted to touch it because it's two questions.  

So do I need to do something else to keep the question open?

Jeff . . . I won't have a chance to look at your proposed solution until tonight, but will respond then.  Thank you VERY much for you response!!!!
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 22635020
If all goes according to plan, my post (22634818) should have "stopped" the delete request.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 22641057
Thanks WAM,
LOL
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 22641086
c9k9h,

OK, just let me know what the results of my two proposals were.
(using the SNP format and the sample database)

Thanks!
;-)

Jeff
0
 

Author Comment

by:c9k9h
ID: 22665372
Jeff . . . I apologize for the delay in getting back to this.  This looks good.  So if I understand correctly, this line:             DoCmd.OpenReport "rptEmailCustReportCustomers", acViewPreview, , "CustomerID=" & "'" & strCustID & "'"

. . . puts the filter in for getting just the sheet needed, then emails it in the next line.  Very cool.  I wish I could double the points, because you did answer two questions.  I appreciate your good faith - it is very appreciated.

I'll have tons more questions coming and I'll be more careful.  Thank you Jeff!
0
 

Author Closing Comment

by:c9k9h
ID: 31501839
I like the way this works.  I'm not sure if I can use the SnapShot, however.  I'm going to continue researching (or maybe post another question) around sending it in a .pdf format.  If I send it as an .rtf file - it loses too much of the formatting.  Many thanks for this!!!
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 22675264
Glad I could help!
:-)

JeffCoachman
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question