PDA

View Full Version : Outlook 2000: How to Attach a File with Macro



taipei
01-11-2009, 12:54 AM
Hello,

I am a beginner with Macros and VBA. I do not know
understand but am slowly trying to learn.

Can someone please make me a "code" for a macro in
Outlook 2000 that will:

1. put in the subject line in my email: Job Resume
2. put in several lines in the body: i.e. I am replying
to your ad for help desk position.
3. Attached my document: Resume.doc

Is there way to make a Macro in Outlook 2000 that will do all these , put in subject line, put several line in the body of message, and then automatically attach my "resume file" which is in the "My documents" folder on my xp computer . I have tried using VBA, but I am a beginner and need a little step by step help. Can someone show me what this code for this macro would look like. Thankyou all for your help. I will be sending out many resumes for a new job and this macro will help me a lot. thanks, Ric

JP2112
01-19-2009, 10:00 AM
Untested but should work.


Sub Create_Msg()
Dim olApp As Outlook.Application
Dim Msg As Outlook.MailItem
Dim MyDocumentsPath As String

Set olApp = Application
Set Msg = olApp.CreateItem(olMailItem)

MyDocumentsPath = Environ("userprofile") & "\My Documents\"

With Msg
.Subject = "Job Resume"
.HTMLBody = "I am replying to your ad for help desk position. Attached is my resume."
.Attachments.Add DocumentsPath & "Resume.doc"
.Display
End With

Set Msg = Nothing
Set olApp = Nothing
End Sub

For further assistance with Outlook macros check out these sites:

http://www.outlookcode.com/
http://www.slovaktech.com/
http://www.codeforexcelandoutlook.com/

HTH


Hello,

I am a beginner with Macros and VBA. I do not know
understand but am slowly trying to learn.

Can someone please make me a "code" for a macro in
Outlook 2000 that will:

1. put in the subject line in my email: Job Resume
2. put in several lines in the body: i.e. I am replying
to your ad for help desk position.
3. Attached my document: Resume.doc

Is there way to make a Macro in Outlook 2000 that will do all these , put in subject line, put several line in the body of message, and then automatically attach my "resume file" which is in the "My documents" folder on my xp computer . I have tried using VBA, but I am a beginner and need a little step by step help. Can someone show me what this code for this macro would look like. Thankyou all for your help. I will be sending out many resumes for a new job and this macro will help me a lot. thanks, Ric

taipei
01-19-2009, 02:29 PM
Thankyou your incredibly kind to help, this advice is priceless thankyou again, ric