+ Reply to Thread
Results 1 to 3 of 3

Reply All With Attachment+Prefix Sunject (macros)

  1. #1
    Registered User
    Join Date
    07-13-2014
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    2

    Reply All With Attachment+Prefix Sunject (macros)

    Hi,

    I am trying to custom made my MS outlook function, what i need is to have functions below to work in 1 time:
    1) Reply all with attachment
    2) Reply all with prefix/custom subject title.

    I found both macros and tried by inserting them into outlook VBA, but it only works independently, means either 1st function work, or 2nd function work, or 1st work then 2nd work. But both cannot work parallel.
    May i know who knows how to join/merge/combine the 2 macros into one, and make the functions into one by pressing only one ribbon in outlook?

    Extra information:
    Function 1 macros:
    Sub ReplyWithAttachments()
    Dim oReply As Outlook.MailItem
    Dim oItem As Object

    Set oItem = GetCurrentItem()
    If Not oItem Is Nothing Then
    Set oReply = oItem.Reply
    CopyAttachments oItem, oReply
    oReply.Display
    End If

    Set oReply = Nothing
    Set oItem = Nothing
    End Sub

    Sub ReplyAllWithAttachments()
    Dim oReply As Outlook.MailItem
    Dim oItem As Object

    Set oItem = GetCurrentItem()
    If Not oItem Is Nothing Then
    Set oReply = oItem.ReplyAll
    CopyAttachments oItem, oReply
    oReply.Display

    End If

    Set oReply = Nothing
    Set oItem = Nothing
    End Sub

    Function GetCurrentItem() As Object
    Dim objApp As Outlook.Application

    Set objApp = Application
    On Error Resume Next
    Select Case TypeName(objApp.ActiveWindow)
    Case "Explorer"
    Set GetCurrentItem = objApp.ActiveExplorer.Selection.Item(1)
    Case "Inspector"
    Set GetCurrentItem = objApp.ActiveInspector.CurrentItem
    End Select

    Set objApp = Nothing
    End Function

    Sub CopyAttachments(objSourceItem, objTargetItem)
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set fldTemp = fso.GetSpecialFolder(2) ' TemporaryFolder
    strPath = fldTemp.Path & "\"
    For Each objAtt In objSourceItem.Attachments
    strFile = strPath & objAtt.FileName
    objAtt.SaveAsFile strFile
    objTargetItem.Attachments.Add strFile, , , objAtt.DisplayName
    fso.DeleteFile strFile
    Next

    Set fldTemp = Nothing
    Set fso = Nothing
    End Sub

    Function 2 macros:
    Sub CustomReply()
    Set oOutlook = CreateObject("Outlook.Application")
    Set oMail = CreateItem(Mail)
    Set myReply = oMail.Actions("Reply").Execute

    With myReply
    Dim Reply As MailItem
    .Subject = "release-authorised:"
    .Display
    End With

    Set oMail = Nothing
    Set oOutlook = Nothing
    End Sub

  2. #2
    Forum Contributor
    Join Date
    08-27-2006
    Posts
    136

    Re: Reply All With Attachment+Prefix Sunject (macros)

    Try this

    Please Login or Register  to view this content.
    To mark "Solved" go to Thread Tools.

  3. #3
    Registered User
    Join Date
    07-13-2014
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    2

    Re: Reply All With Attachment+Prefix Sunject (macros)

    It works!!! Thanks a lot dude!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Reply/Forward All with Attachment Macro
    By Kyle1978 in forum Outlook Programming / VBA / Macros
    Replies: 1
    Last Post: 03-10-2014, 02:18 AM
  2. Replies: 8
    Last Post: 05-14-2013, 01:11 PM
  3. [SOLVED] Adding a Prefix 0 to column using macros
    By dvega1819 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-16-2012, 06:34 PM
  4. Personal.xls macros not available when opening email attachment
    By Eric Winegarner in forum Excel General
    Replies: 0
    Last Post: 06-29-2006, 11:45 AM
  5. [SOLVED] Send Macros with an Excek attachment using Outlook 2003
    By Dannyboy1001 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-03-2005, 01:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1