PC Review


Reply
Thread Tools Rate Thread

Add pdf attachment to new mail

 
 
Thanks
Guest
Posts: n/a
 
      6th Aug 2008
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
 
Reply With Quote
 
 
 
 
Ron de Bruin
Guest
Posts: n/a
 
      6th Aug 2008
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" <(E-Mail Removed)> wrote in message news:66616982-C1FC-4B89-B253-(E-Mail Removed)...
> 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

 
Reply With Quote
 
Thanks
Guest
Posts: n/a
 
      6th Aug 2008
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" <(E-Mail Removed)> wrote in message news:66616982-C1FC-4B89-B253-(E-Mail Removed)...
> > 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

>

 
Reply With Quote
 
Ron de Bruin
Guest
Posts: n/a
 
      6th Aug 2008
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" <(E-Mail Removed)> wrote in message news:55CE6C62-4E96-41FA-8F92-(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message news:66616982-C1FC-4B89-B253-(E-Mail Removed)...
>> > 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

>>

 
Reply With Quote
 
Thanks
Guest
Posts: n/a
 
      6th Aug 2008
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" <(E-Mail Removed)> wrote in message news:55CE6C62-4E96-41FA-8F92-(E-Mail Removed)...
> > 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" <(E-Mail Removed)> wrote in message news:66616982-C1FC-4B89-B253-(E-Mail Removed)...
> >> > 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
> >>

>

 
Reply With Quote
 
Ron de Bruin
Guest
Posts: n/a
 
      6th Aug 2008
Do you have Outlook ?
With Outlook Express the code is not working


--

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


"Thanks" <(E-Mail Removed)> wrote in message news:C7EBEF1C-D5F4-426F-BB5A-(E-Mail Removed)...
>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" <(E-Mail Removed)> wrote in message news:55CE6C62-4E96-41FA-8F92-(E-Mail Removed)...
>> > 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" <(E-Mail Removed)> wrote in message news:66616982-C1FC-4B89-B253-(E-Mail Removed)...
>> >> > 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
>> >>

>>

 
Reply With Quote
 
Ron de Bruin
Guest
Posts: n/a
 
      6th Aug 2008
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" <(E-Mail Removed)> wrote in message news:OvEjsGB%(E-Mail Removed)...
> Do you have Outlook ?
> With Outlook Express the code is not working
>
>
> --
>
> Regards Ron de Bruin
> http://www.rondebruin.nl/tips.htm
>
>
> "Thanks" <(E-Mail Removed)> wrote in message news:C7EBEF1C-D5F4-426F-BB5A-(E-Mail Removed)...
>>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" <(E-Mail Removed)> wrote in message news:55CE6C62-4E96-41FA-8F92-(E-Mail Removed)...
>>> > 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" <(E-Mail Removed)> wrote in message news:66616982-C1FC-4B89-B253-(E-Mail Removed)...
>>> >> > 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
>>> >>
>>>

 
Reply With Quote
 
Thanks
Guest
Posts: n/a
 
      14th Aug 2008
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" <(E-Mail Removed)> wrote in message news:OvEjsGB%(E-Mail Removed)...
> > Do you have Outlook ?
> > With Outlook Express the code is not working
> >
> >
> > --
> >
> > Regards Ron de Bruin
> > http://www.rondebruin.nl/tips.htm
> >
> >
> > "Thanks" <(E-Mail Removed)> wrote in message news:C7EBEF1C-D5F4-426F-BB5A-(E-Mail Removed)...
> >>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" <(E-Mail Removed)> wrote in message news:55CE6C62-4E96-41FA-8F92-(E-Mail Removed)...
> >>> > 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" <(E-Mail Removed)> wrote in message news:66616982-C1FC-4B89-B253-(E-Mail Removed)...
> >>> >> > 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
> >>> >>
> >>>

>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows Mail crashes when opening or saving a mail-attachment PayWay Windows Vista Mail 2 25th Feb 2009 02:01 AM
When Replying To An E-Mail With Attachment, The Text Goes But NotThe Attachment. Morton Windows Vista Mail 3 28th May 2008 01:48 AM
Macro: Excel mail attachment - celle-value as Subject of mail Snoopy Microsoft Excel Discussion 2 18th Sep 2007 08:22 AM
opening mail attachment attachment in Outlook? =?Utf-8?B?SnVsaW8=?= Microsoft Outlook Discussion 1 27th Mar 2005 06:10 AM
e-mail with an attachment after opening the attachment, when clos. =?Utf-8?B?Q296?= Microsoft Outlook Discussion 6 17th Dec 2004 03:34 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:58 AM.