Create email with body and doc attachment

  • Thread starter Thread starter ms
  • Start date Start date
M

ms

I am having alot of problems with finshing this task...i have read alot
of post and i cant seem to find the one that will work for me and i
dont know VBA enough to manipulate it enough...

I am trying to create a VBA script for sending my resume.....I go to a
job site, see a email link for a job i would like to apply to and i
click the link, an outlook email opens up with the To: address fill out
and the subject as the job title (i dont need to worry about these
steps)

I want to create a keyboard command to attach "myresume.doc" file and
to enter text into the body of the email.

everything i find is more complex then this and i cant seem to break it
down for my use.. anyhelp? thanks.
 
Simply add this to your VBA project:

Public Sub MyResume()
Dim Mail as Outlook.MailItem

Set Mail=Application.ActiveInspcetor.CurrentItem
Mail.BOdy="your text"
Mail.Attachments.Add "d:\your filedoc"
End Sub

Then open an e-mail and customize the toolbar, add a button that calls the
macro.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Keep your Outlook categories organized!
http://www.shareit.com/product.html?productid=300120654&languageid=1
(German: http://www.VBOffice.net/product.html?pub=6)

Am 17 Jan 2007 17:52:03 -0800 schrieb ms:
 
Help

Hi

I had a similar problem and used the attachment command below, the only difference is that i used a variable to specify the file location:
i.e.
olMail.Attachement.Add Filename
-- Filename already defined and is the full path & the file name.

Problem: It attaches the file but when i try to send it, it says The operation cannot be performed because the object has been deleted.
Add info: the file is closed when it is attached.

and could you also tell me how to convert the body of the email to HTML
the .bodyformat = olFormatHTML
gives run time error 5
invalid procedure call or argument

Michael Bauer [MVP - Outlook] said:
Simply add this to your VBA project:

Public Sub MyResume()
Dim Mail as Outlook.MailItem

Set Mail=Application.ActiveInspcetor.CurrentItem
Mail.BOdy="your text"
Mail.Attachments.Add "d:\your filedoc"
End Sub

Then open an e-mail and customize the toolbar, add a button that calls the
macro.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Keep your Outlook categories organized!
http://www.shareit.com/product.html?productid=300120654&languageid=1
(German: http://www.VBOffice.net/product.html?pub=6)

Am 17 Jan 2007 17:52:03 -0800 schrieb ms:

> I am having alot of problems with finshing this task...i have read alot
> of post and i cant seem to find the one that will work for me and i
> dont know VBA enough to manipulate it enough...
>
> I am trying to create a VBA script for sending my resume.....I go to a
> job site, see a email link for a job i would like to apply to and i
> click the link, an outlook email opens up with the To: address fill out
> and the subject as the job title (i dont need to worry about these
> steps)
>
> I want to create a keyboard command to attach "myresume.doc" file and
> to enter text into the body of the email.
>
> everything i find is more complex then this and i cant seem to break it
> down for my use.. anyhelp? thanks.
 
Last edited:
Back
Top