[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

VBA Code

Posted on 2006-07-18
7
Medium Priority
?
338 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 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Outlook for dependable use in a very small business   This article is about using the Outlook application (part of Microsoft Office) in a very small business, or for homeowners where dependability and reliability are critical requirements. This …
Are you looking for the options available for exporting EDB files to PST? You may be confused as they are different in different Exchange versions. Here, I will discuss some options available.
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 …
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…

649 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