Add pdf attachment to new mail

T

Thanks

I'm sending out a new mail message and attaching the current excel worksheet.
I would like to also include a pdf file from a seperate folder. This is the
code for the attachment of the excel document. What else would I have to
include to find the pdf and place in the same email? Thanks !

Dim mySend As Integer
mySend = MsgBox("Would you like to send document by email?", vbYesNo)
If mySend = vbNo Then
Exit Sub
End If
Application.Dialogs(xlDialogSendMail).Show


End Sub
 
T

Thanks

I've seen the variations of the code begining with

Dim olApp As Outlook.Application
Dim objMail As Outlook.MailItem

Set olApp = Outlook.Application
Set objMail = olApp.CreateItem(olMailItem)

However, I can't get past this point without an error. It is not
recognizing the outlook.application and responding with an error of "user
defined type not defined".
I am using Outlook 2003.
 
R

Ron de Bruin

I use this in all my examples (late binding) because I get to many mails from people that say"It is not working"
Dim olApp As Outlook.Application
Dim objMail As Outlook.MailItem

In my examples you not have to set a reference to the Outlook library in the VBE

Below every example you can see how you must change the code if you want to use Early binding
 
T

Thanks

I still can't get the code to work by using either option(early or late
binding). I can't seem to get it to recognize the "outlook" portion of the
code. I've tried selecting different references but that hasn't worked.
I've copied some of your code ver batum and still comes up with errors at the
same point. How specifically do set a reference to the Outlook library?
 

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