Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please help me attach this PDF file to Outlook:-)

Status
Not open for further replies.

bluemat

Technical User
Feb 5, 2002
61
MX
I make a report then have a button to send the report in pdf format to whoever the user wants.

Basically this document gets saved as a pdf file to a shared folder. The name of the file is always the same.

I would like after the user clicks and creates this file, that outlook opens and grabs the file as an attachment.

I know it is possible and isn't difficult, but I just need alittle help.

Thanks:)

Mathew
 
This is how I send emails with attachments in code:

If (Not lstrTo = vbNullString) Then
'start outlook application
Set lobjOutlook = CreateObject(Outlook.application")
Set lobjMail = lobjOutlook.createitem(0)

Let lobjMail.subject = lstrSubject
Let lobjMail.HTMLBody = lstrBody 'add body
Let lobjMail.to = lstrTo 'apply To list
'Let objMail.cc = lstrCc 'apply CC list
'Let lobjMail.bcc = lstrBCC 'apply bcc list
Set lobjAttachment = lobjMail.attachments 'add attachments
lobjAttachment.Add &quot;<file path>&quot;
lobjMail.send
lobjOutlook.Quit
End If

Just make a method to included code similar to the above, and call that method whenever u want Outlook to send the attachment.
Hope this helps a little.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top