Solved

VBA Code

Posted on 2006-07-18
7
330 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
  • 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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

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…
Large Outlook files lead to various unwanted errors and corruption issues. Furthermore, large outlook files can also make Outlook take longer to start-up, search, navigate, and shut-down. So, In this article, i will discuss a method to make your Out…
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…
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…

680 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