Solved

VBA Code

Posted on 2006-07-18
7
332 Views
Last Modified: 2006-11-18
Hi,

We are currently working on stream lining alot of our relative tasks and one of them is sending a standard reply to emails that come into our mail boxes via a macro.

We want the macro to reply to the sender with a new subject line, and a standard message body that we can define with in the macro.

Currently we have it working on forwarding but we are unable to get it working on the reply with a set body text.

Does anyone have any ideas as to how we can do this?

We are using Outlook 2000 and the macro editor with in it.

thanks david jacques

0
Comment
Question by:cmrecruitment
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
7 Comments
 
LVL 76

Expert Comment

by:David Lee
ID: 17132076
Hi cmrecruitment,

Are you forwarding with a macro?  If so, then post the code I can show you how to modify it to send a reply.  

Cheers!
0
 
LVL 2

Expert Comment

by:masoncooper
ID: 17151386
If you are trying to reply with a semi-custom message, you may want to try setting up a rule that replies using a template, I'm not sure what all you want your macro to do, but if it's just a bit of customization, this is the way to go.

Tools > Rules and Alerts > New Rule
Construct the rule to run based on your own criteria, but when you select an Action, choose "Reply using a specific template".  This allows you to choose a template that you can create that has fields to further customize the message beyond boilerplate text.
0
 

Author Comment

by:cmrecruitment
ID: 17166551
Hi bluedevilfan,

here is our current code. It just a forwarding macro at the moment.

thanks david jacques

Sub explorerNames()
 
Dim myOlApp As New Outlook.Application
    Dim myOlExp As Outlook.Explorer
    Dim myOlSel As Outlook.Selection
    Dim MsgTxt As String
   
    Dim x As Integer
    Dim myNms As Outlook.NameSpace
    Dim myFolder As Outlook.MAPIFolder
    Dim myRecipient As Outlook.Recipient
    Dim myItem As MailItem
    MsgTxt = "You have selected items from: "
   
    Set myOlExp = myOlApp.ActiveExplorer
    Set myOlSel = myOlExp.Selection
    Set myItem = myOlSel.Item(1)
    For x = 1 To myOlSel.Count
              MsgTxt = myItem.SenderName
        Set myForward = myItem.Forward
        myForward.To = "davidj@candm.co.uk"
        myForward.Send
    Next x
End Sub
0
 
LVL 76

Accepted Solution

by:
David Lee earned 500 total points
ID: 17180848
Ok, here's your code modified to send a reply.  I also took the liberty of cleaning it up a bit.  Hope you don't mind.

Sub explorerNames()
    Dim MsgTxt As String, _
        myItem As MailItem, _
        myReply As MailItem
    MsgTxt = "You have selected items from: "
    For Each myItem In Application.ActiveExplorer.Selection
        MsgTxt = myItem.SenderName
        Set myReply = myItem.Reply
        'Use HTMLBody instead of Body on the next line if your messages are in HTML format
        myReply.Body = MsgTxt
        myReply.Send
    Next
End Sub
0
 
LVL 76

Expert Comment

by:David Lee
ID: 17220761
Any update, cmrecruitment?
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Are you unable to connect or configure Hotmail email account in Microsoft Outlook 2010, 2007? Or Outlook.com emails are not downloading to Outlook? Lets’ see the problem and resolve Outlook Connector error syncing folder hierarchy (0x8004102A).
This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question