Help with macro to create new email message

  • Thread starter Steve M (remove wax for reply)
  • Start date
S

Steve M (remove wax for reply)

I am writing my second VBA macro for Outlook 2000 (lots of experience
in Word). Several questions:

1. Is there any way to record a macro and then tweak it like in VBA
for Word?

2. The new message is a form letter for spam complaints. I found
something in the Online help and what I have so far is at the bottom
of this message.

It works, mostly, but there are some little problems. First, my
default setting for new postings is Plain text (Tools / Options / Mail
Format, Send in this message format).

However, the new message created by this macro is in Rich Text. I
want the new email to be in Plain text format.

3. While working up a spam complaint, I often right click on the link
in the spam and "Copy Shortcut", then paste the link into the email
message. I want the text of the link to be pasted at that spot of the
email message, like
http://www.vfwspkc.com.thepojjuhyfcx.biz/
and NOT to add the link as an attachment. Is there a setting that
will allow this?

4. Is there an online tutorial or some other good introduction to VBA
in Outlook? I have written thousands of lines of Word macros, and
quite a few in Excel, but there isn't much onscreen help for Outlook.

Thanks.
Steven


===================

Sub NewLart()

Dim myOLApp As New Outlook.Application
Dim myOLItem As Outlook.MailItem
Set myOLItem = myOLApp.CreateItem(olMailItem)
With myOLItem
.To = "nanas"
.Subject = " "
.Body = "The message below is unsolicited advertising, or
spam." & _
Chr(13) & "Sending IP:" & Chr(13) & Chr(13) & _
"Link advertised in spam:" & Chr(13) & Chr(13) & _
"Complete headers of spam." & Chr(13) & _
"Original message, including full headers." & Chr(13) & _
"Address(es) of original recipient(s) have been replaced
with ****" _
& Chr(13) & "-------------"
End With
myOLItem.Display

End Sub

===================
 
S

Steve M (remove wax for reply)

2) Outlook version?

Outlook 2000 (it's in the first line of my posting)

Remaining question:

Steven



P.S. Susan, I don't know what causes it, but the characters "=20"
appear at the ends of most of the lines that you type.


Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx=20


Steve M (remove wax for reply) said:
I am writing my second VBA macro for Outlook 2000 (lots of experience
in Word). Several questions:
=20
1. Is there any way to record a macro and then tweak it like in VBA
for Word?
=20
2. The new message is a form letter for spam complaints. I found
something in the Online help and what I have so far is at the bottom
of this message.
=20
It works, mostly, but there are some little problems. First, my
default setting for new postings is Plain text (Tools / Options / Mail
Format, Send in this message format).
=20
However, the new message created by this macro is in Rich Text. I
want the new email to be in Plain text format.
=20
3. While working up a spam complaint, I often right click on the link
in the spam and "Copy Shortcut", then paste the link into the email
message. I want the text of the link to be pasted at that spot of the
email message, like=20
http://www.vfwspkc.com.thepojjuhyfcx.biz/
and NOT to add the link as an attachment. Is there a setting that
will allow this?
=20
4. Is there an online tutorial or some other good introduction to VBA
in Outlook? I have written thousands of lines of Word macros, and
quite a few in Excel, but there isn't much onscreen help for Outlook.
=20
Thanks.
Steven
=20
=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=20
Sub NewLart()
=20
Dim myOLApp As New Outlook.Application
Dim myOLItem As Outlook.MailItem
Set myOLItem =3D myOLApp.CreateItem(olMailItem)
With myOLItem
.To =3D "nanas"
.Subject =3D "(e-mail address removed)
 
S

Sue Mosher [MVP]

It's Sue, not Susan. Sorry I missed the version before.

To create a plain text message with Outlook 2000, you have to use CDO, not Outlook objects. If you don't know CDO, you can get some basics from http://www.slipstick.com/dev/cdo.htm.

Re: =20, your newsreader apparently doesn't handle quoted-printable format messages gracefully. (Sending QP makes it possible to post long URLs without them breaking in the middle and without resorting to HTML.) I wonder if there's a newer version that does.

--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers



Steve M (remove wax for reply) said:
2) Outlook version?

Outlook 2000 (it's in the first line of my posting)

Remaining question:

P.S. Susan, I don't know what causes it, but the characters "=20"
appear at the ends of most of the lines that you type.
Steve M (remove wax for reply) said:
I am writing my second VBA macro for Outlook 2000 (lots of experience
in Word). Several questions:
=20
1. Is there any way to record a macro and then tweak it like in VBA
for Word?
=20
2. The new message is a form letter for spam complaints. I found
something in the Online help and what I have so far is at the bottom
of this message.
=20
It works, mostly, but there are some little problems. First, my
default setting for new postings is Plain text (Tools / Options / Mail
Format, Send in this message format).
=20
However, the new message created by this macro is in Rich Text. I
want the new email to be in Plain text format.
=20
3. While working up a spam complaint, I often right click on the link
in the spam and "Copy Shortcut", then paste the link into the email
message. I want the text of the link to be pasted at that spot of the
email message, like=20
http://www.vfwspkc.com.thepojjuhyfcx.biz/
and NOT to add the link as an attachment. Is there a setting that
will allow this?
=20
4. Is there an online tutorial or some other good introduction to VBA
in Outlook? I have written thousands of lines of Word macros, and
quite a few in Excel, but there isn't much onscreen help for Outlook.
=20
Thanks.
Steven
=20
=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=20
Sub NewLart()
=20
Dim myOLApp As New Outlook.Application
Dim myOLItem As Outlook.MailItem
Set myOLItem =3D myOLApp.CreateItem(olMailItem)
With myOLItem
.To =3D "nanas"
.Subject =3D "(e-mail address removed)
 

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