Email EXACTLY the report viewed

C

Carlos

Hello Everyone,

I am having a strange problem.

I have a form generate a single vertical report for the information in it.
It's usually only one page long.

The report is all set up to a specific layout, with images and grids and
lines.

Now everytime I choose the option of sending it to someone's email, access
prompts me with a couple options:
I can choose from different types of files: HTML, Rich Text, Excel, etc.
My original report has the looks of a Word document, so I chose Rich Text.

Problem is that the computer re-calculates the report and ignores all of my
original layout. I have the same problem when using it in HTML.

I was wondering how it is that I can send EXACTLY what my original report
shows to the recipient's email address using Outlook.

Thank you all for every bit of information this forum has already given me.
 
A

Allen Browne

The snapshot format is the only one that correctly simulates the report as
you see it on screen.

The recipient will need the snapshot viewer on their machine to view it.
They may have that already if they have a recent version of Office
installed; otherwise it is a free download from Microsoft.
 
B

Brian

A couple of options (there may be others):

1. Print the report to an Acrobat PDF and then e-mail that.
2. Distribute/install the MS Snapshot Viewer to the recipients and then
e-mail snapshot images instead of RTF or HTML. This works only if you have a
limited number of clients and they are willing to install the viewer.

For either option, there are lots of posts in the Access forums already
describing how to do them. Just search for "export to PDF" or "snapshot
viewer".
 
6

'69 Camaro

Hi, Carlos.
I was wondering how it is that I can send EXACTLY what my original report
shows to the recipient's email address using Outlook.

Export the report to the Snapshot format. It's native to Access, so all the
report's formatting will remain as is. If Microsoft Access is installed on
the recipient's computer, then the SnapShot Viewer is available to view the
report. Otherwise, the SnapShot Viewer can be downloaded from the following
Web page:

http://www.microsoft.com/downloads/...3F-6D74-423D-8274-8B7E6313EDFB&displaylang=en

First, set a Reference to Microsoft Outlook, then try the following code to
save a report as a Snapshot file, then E-mail it:

Private Sub EmailRptBtn_Click()

On Error GoTo ErrHandler

Dim ol As New Outlook.Application
Dim olns As Outlook.NameSpace
Dim objFolder As Outlook.MAPIFolder
Dim objItem As Outlook.MailItem
Dim atch As Outlook.Attachments
Dim sFileName As String

sFileName = "C:\Test\test.snp"
DoCmd.OutputTo acOutputReport, "rptMyReport", _
acFormatSNP, sFileName

'------------------------------------------
' Init.
'------------------------------------------

Set olns = ol.GetNamespace("MAPI")
Set objFolder = olns.GetDefaultFolder(olFolderOutbox)
Set objItem = objFolder.Items.Add(olMailItem)

'------------------------------------------
' Create the mail item.
'------------------------------------------

objItem.Recipients.Add("(e-mail address removed)").Resolve
objItem.Subject = "The Subject"
objItem.Body = "Type whatever you want on line 1." & _
vbCrLf & "More on line 2."
Set atch = objItem.Attachments
atch.Add sFileName, olByValue, 1, "Test Invoice"
objItem.Display ' Or use objItem.Send

CleanUp:

Set atch = Nothing
Set objItem = Nothing
Set objFolder = Nothing
Set olns = Nothing
Set ol = Nothing

Exit Sub

ErrHandler:

MsgBox "Error in EmailRptBtn_Click( ) in" & vbCrLf & _
Me.Name & " form." & vbCrLf & vbCrLf & _
"Error #" & Err.Number & vbCrLf & vbCrLf & Err.Description
Err.Clear
GoTo CleanUp

End Sub ' EmailRptBtn_Click( )

One issue is that Outlook's security will warn the user that an application
is trying to access the mail client. There's an application available which
will automate this, but I don't have the link available at the moment. I'll
try to find it and post it later.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact info.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top