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

x
?
Solved

Editing an Outlook Macro to Reply

Posted on 2014-03-07
2
Medium Priority
?
335 Views
Last Modified: 2014-03-17
I have an outlook macro that creates a new email based on a selected message. I am wanting it to create a reply instead of a new message. I am mainly wanting this so that the original email is viewable. Can this be done?

Sub MailItemContent()

    Dim OutApp As Outlook.Application
    Dim OutMail As Outlook.MailItem
    Dim sText As String

    Set olItem = ActiveExplorer.Selection.Item(1)
    sText = olItem.Body
    Lines = Split(sText, vbCrLf)
    
    Set OutApp = CreateObject("Outlook.Application")
    Set OutMail = OutApp.CreateItem(olMailItem)

    On Error Resume Next
    With OutMail
        .To = Replace(Lines(4), "Opened By: ", "")
        .Subject = Lines(3)
        .Body = ""
        .SendUsingAccount = OutApp.Session.Accounts.Item(1)

        .Display
    End With
    On Error GoTo 0

    Set OutMail = Nothing
    Set OutApp = Nothing
End Sub

Open in new window

0
Comment
Question by:Joseph Moody
[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
2 Comments
 
LVL 35

Accepted Solution

by:
mvidas earned 2000 total points
ID: 39912703
Hi,

It sure can be done. When you create the message, use this instead:
'    Set OutMail = OutApp.CreateItem(olMailItem)
    Set OutMail = olItem.Reply

Open in new window

You'll likely want to remove the     .body=""      line later though.

Matt
0
 
LVL 22

Author Closing Comment

by:Joseph Moody
ID: 39934186
Thank you!
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

In this article I discuss my selections of the Top Four free Outlook OST File Viewers available. Open, view and read even damaged OST files by using these tools. They all provide a clear preview of all data such as emails, notes, tasks, calendars, e…
As much as Microsoft wants to kill off PST file support, just as they tried to do with public folders, there are still times when it is useful or downright necessary to export Exchange mailboxes to PST files. Thankfully, it is still possible to e…
In this video we show how to create a mailbox database in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Servers >> Data…
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…
Suggested Courses

656 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