Results 1 to 5 of 5

Calling a Macro from Outlook Ribbon

Threaded View

  1. #1
    Forum Contributor
    Join Date
    07-04-2011
    Location
    London, Ontario
    MS-Off Ver
    Excel 365
    Posts
    119

    Calling a Macro from Outlook Ribbon

    I have this Macro which I am trying to call from the outlook Ribbon. The macro basically needs to run whenever I click it so it can reply to the message I select.
    (I went through the right click ->customize->Macros-> and created this macro shortcut (replywithHTML) onto a new menu toolbar on the ribbon.
    however I keep getting a "Project1.RepllywithHTMl macro cannot be found". However when I go into the VB editor the code works.
    What seems to be the issue here?
    here is the macro in a module in outlook 2007
    Public Sub ReplyWithHtml()
    Dim oMail As Outlook.MailItem
    Dim oFSO
    Dim oFS
    If Application.ActiveExplorer.Selection.Count Then
    If TypeOf Application.ActiveExplorer.Selection(1) Is Outlook.MailItem Then
    Set oMail = Application.ActiveExplorer.Selection(1).ReplyAll
    
    Set oFSO = CreateObject("Scripting.FileSystemObject")
    
    Set oFS = oFSO.OpenTextFile("C:\Quarantine.htm")
    
    stext = oFS.ReadAll
    oMail.BodyFormat = olFormatHTML
    oMail.HTMLBody = stext & vbCr & oMail.HTMLBody
    oMail.Display
    End If
    End If
    
    
    End Sub
    Last edited by sonny.thind; 03-21-2012 at 08:01 AM. Reason: Solved

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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