ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Add pdf attachment to new mail (https://www.excelbanter.com/excel-programming/415251-add-pdf-attachment-new-mail.html)

thanks

Add pdf attachment to new mail
 
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

Ron de Bruin

Add pdf attachment to new mail
 
You need other code for that

See the Outlook Object model section on this page
http://www.rondebruin.nl/sendmail.htm


See this in the code
.Attachments.Add ("C:\test.txt")



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Thanks" wrote in message ...
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


thanks

Add pdf attachment to new mail
 
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.

"Ron de Bruin" wrote:

You need other code for that

See the Outlook Object model section on this page
http://www.rondebruin.nl/sendmail.htm


See this in the code
.Attachments.Add ("C:\test.txt")



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Thanks" wrote in message ...
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



Ron de Bruin

Add pdf attachment to new mail
 
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


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Thanks" wrote in message ...
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.

"Ron de Bruin" wrote:

You need other code for that

See the Outlook Object model section on this page
http://www.rondebruin.nl/sendmail.htm


See this in the code
.Attachments.Add ("C:\test.txt")



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Thanks" wrote in message ...
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



thanks

Add pdf attachment to new mail
 
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?

"Ron de Bruin" wrote:

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


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Thanks" wrote in message ...
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.

"Ron de Bruin" wrote:

You need other code for that

See the Outlook Object model section on this page
http://www.rondebruin.nl/sendmail.htm


See this in the code
.Attachments.Add ("C:\test.txt")



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Thanks" wrote in message ...
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



Ron de Bruin

Add pdf attachment to new mail
 
Do you have Outlook ?
With Outlook Express the code is not working


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Thanks" wrote in message ...
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?

"Ron de Bruin" wrote:

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


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Thanks" wrote in message ...
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.

"Ron de Bruin" wrote:

You need other code for that

See the Outlook Object model section on this page
http://www.rondebruin.nl/sendmail.htm


See this in the code
.Attachments.Add ("C:\test.txt")



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Thanks" wrote in message ...
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



Ron de Bruin

Add pdf attachment to new mail
 
If you use Outlook see
http://www.rondebruin.nl/mail/problems.htm

Good night



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Ron de Bruin" wrote in message ...
Do you have Outlook ?
With Outlook Express the code is not working


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Thanks" wrote in message ...
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?

"Ron de Bruin" wrote:

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


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Thanks" wrote in message ...
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.

"Ron de Bruin" wrote:

You need other code for that

See the Outlook Object model section on this page
http://www.rondebruin.nl/sendmail.htm


See this in the code
.Attachments.Add ("C:\test.txt")



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Thanks" wrote in message ...
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



thanks

Add pdf attachment to new mail
 
Sorry for delayed response, yes I'm using Microsoft Office Outlook 2003.

"Ron de Bruin" wrote:

If you use Outlook see
http://www.rondebruin.nl/mail/problems.htm

Good night



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Ron de Bruin" wrote in message ...
Do you have Outlook ?
With Outlook Express the code is not working


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Thanks" wrote in message ...
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?

"Ron de Bruin" wrote:

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


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Thanks" wrote in message ...
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.

"Ron de Bruin" wrote:

You need other code for that

See the Outlook Object model section on this page
http://www.rondebruin.nl/sendmail.htm


See this in the code
.Attachments.Add ("C:\test.txt")



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Thanks" wrote in message ...
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





All times are GMT +1. The time now is 01:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com