RE: Hyperlink for email



I'm sorry for the bother, but I'm still not clear on this. Do I put this in
the OnClick event for the command button? Where do I put in the report names
I want to save or select? Can you please explain how it works?
Thanks again for your time and help.
Pam


"Access101" wrote:

Sorry, this was a fill in for code I'd given you previously:

Instead of this, which would only attach one file (see previous email for
full code):

With outMsg
.To = strEmail
.Subject = strSubject
.Body = strMsg
.Attachments.Add strPhoto
.Send
End With

You could do this:

With outMsg
.To = strEmail
For i = 1 to CountFilesInMyHoldingTankTmpDir
.Attachments.Add strFile(i)
next i
.Send
End With

Then you would be able to attach all the files you wanted, not only the ones
created by Cute PDF, but also the stray PDF file created outside of Access.




"PHisaw" wrote:

I'm sorry - I think I'm really confused now!! Do I put all of this code in
the OnClick event of the command button? Not sure what you mean by repeat
"Attachment" line of code.

"Access101" wrote:

I may not have read your question correctly either ... easy to do when I'm in
a rush.

I'm now thinking you have something like this:

C:\AcRptSavedbyCute Pdf_1.pdf
C:\AcRptSavedbyCute Pdf_2.pdf
C:\AcRptSavedOutSideAccess_1.pdf

strFile(0) = "C:\AcRptSavedbyCute Pdf_1.pdf"
strFile(1) ="C:\AcRptSavedbyCute Pdf_2.pdf"
strFile(2) = "C:\AcRptSavedOutSideAccess_1.pdf"

If this is the case, you could just repeat the "Attachment" line of code

For i = 1 to CountFilesInMyHoldingTankTmpDir
.Attachments.Add strFile(i)
next i

Let me know if this helps.

"PHisaw" wrote:

Thank you for the reply. I don't think my first message may have been clear.
The code I use takes the reports I have in Access and uses the Cute Pdf
Writer to convert them from snapshot to pdf's and then I save them from
dialog box that pops up to a file that I use to store all documents in that I
want to email. I have a command button to click to take me to this file and
then select all and email.

I was hoping there would be some way to select this pdf file that is outside
the database and pull it into this temp file with the other Access reports
that are saved as pdf's. I may be asking for too much, but thought it worth
a try anyway.
If you have any other suggestions, I would appreciate hearing from you.
Thanks,
Pam

"Access101" wrote:

Let me know if this helps

Sub EmailPDF()

Dim outApp As Outlook.Application, outMsg As MailItem
Set outApp = CreateObject("Outlook.Application")
Set outMsg = outApp.CreateItem(olMailItem)

strEmail = "myemail@xxxxxxxxxxxxx"
strCC = "myemail@xxxxxxxxxxxxx"
strBCC = "myemail@xxxxxxxxxxxxx"

strSubject = "My PDF"

strPhoto = strMyPath & strMyPDF

strMsg = "Here's your PDF"

With outMsg
.Importance = olImportanceHigh
.To = strEmail
.CC = strCC
.BCC = strBCC
.Subject = strSubject
.Body = strMsg
If IsNull(Me.PhotoFileName) Then
Else
.Attachments.Add strPhoto
End If
.Display
.Send
End With

Set outApp = Nothing
Set outMsg = Nothing

End Sub


"PHisaw" wrote:

Hi Again,

I use the code below to email reports. I have the report Decontamination
Guidelines set up in Access. I needed something other than Snapshot reports,
as not everyone had or was willing to use Snapshot viewer. Did some research
and found valuable help at this site on the Cute PDF writer and setting
application printers. Worked great until boss wanted something different.
Decided we needed something more illiustrated. Set up Powerpoint
presentation and saved as a pdf file.

Now the problem I have (and I so hope someone will have an idea to make it
work) is that the pdf file is outside my database and I would very much like
to still click my command button and have all reports, including the pdf file
outside the db, show up on the email message as attachments automatically.

If someone has a solution, I would very much appreciate it.
Thanks in advance,
Pam

Private Sub CommandEmailRMA_Click()
On Error GoTo Err_CommandEmailRMA_Click
Me.Refresh

If Me.PumpType = "SCMP" Then
Set Application.Printer = Application.Printers("CutePDF Writer")
DoCmd.OpenReport "rRMAPage1", , , "JobNumber=" &
[Forms]![f*GeneralInformationWITHQUOTE]![JobNumber]
DoCmd.OpenReport "rScmpDecontaminationGuidelines"
Set Application.Printer = Nothing
Else
Set Application.Printer = Application.Printers("CutePDF Writer")
DoCmd.OpenReport "rRMAPage1", , , "JobNumber=" &
[Forms]![f*GeneralInformationWITHQUOTE]![JobNumber]
Set Application.Printer = Nothing

End If

Exit_CommandEmailRMA_Click:
Exit Sub

Err_CommandEmailRMA_Click:
MsgBox Err.Description
Resume Exit_CommandEmailRMA_Click

End Sub
.