Results 1 to 7 of 7
  1. #1
    Star Lounger
    Join Date
    Jun 2004
    Location
    Gtr London, England
    Posts
    90
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Using OnAction in Outlook (Office 2003)

    Can anyone help?

    I would like to override one of the icons (Reply to all) on the Outlook toolbar with a different Icon and Caption (which I am able to do). I am using the "OnAction" event and would like to run a message box then runs the Reply to all function. As I am very new at Outlook I am unsure how to run the "Reply to all" function. I have taken a look and have found "olActionCopyLike.olReplyAll" but am unable to do anything with it.

    Any help would be greatly appreciated.
    Jack

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Using OnAction in Outlook (Office 2003)

    <P ID="edit" class=small>(Edited by JohnBF on 13-Oct-04 10:58. Bad syntax! Bad!)</P>Not sure exactly what you are trying to do, but see if calling this via OnAction gets you in the right direction:

    Sub jackreplytoall()
    Dim item As Object
    On Error Resume Next
    If TypeName(Application.ActiveWindow) = "Explorer" Then
    Set item = ActiveExplorer.Selection(1)
    Else
    Set item = ActiveInspector.CurrentItem
    End If
    On Error GoTo 0
    If Not item Is Nothing Then
    With item
    .ReplyAll
    .Save
    .Display
    End With
    Else
    MsgBox "Nothing selected"
    End If
    Set item = Nothing
    End Function
    -John ... I float in liquid gardens
    UTC -7ąDS

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Using OnAction in Outlook (Office 2003)

    Off the top of my head, I don't know the ID associated with the Reply All button/menu item. Let's pretend it's 500. Let me also assume that your new button does not have the same ID. You should be able to "run" the missing button or menu item by executing the control with that ID:

    ActiveInspector.CommandBars.FindControl(Id:=500).E xecute

    On the other hand, if your code works by intercepting this command ID, you'd have to invoke this feature another way.

  4. #4
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Using OnAction in Outlook (Office 2003)

    It's 355. <post#=386242>post 386242</post#>.

    I always forget the .Execute Method, but many of the dialogs in Outlook don't return any information and so are a nuisance to use.
    -John ... I float in liquid gardens
    UTC -7ąDS

  5. #5
    Star Lounger
    Join Date
    Jun 2004
    Location
    Gtr London, England
    Posts
    90
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Using OnAction in Outlook (Office 2003)

    Thanks for your help John. I'll give it a try.

    Regards
    Jack

  6. #6
    New Lounger
    Join Date
    Oct 2004
    Location
    Sydney, New South Wales, Australia
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Using OnAction in Outlook (Office 2003)

    I really think just lik in Word you need to capture the "event".

    Have a look at event trapping:

    "with events" is the key search word


    Dim MyClass As New clsWordApp

    Sub AutoOpen()
    Dim wdSaveProtectionType As Integer

    On Error GoTo ErrorHandler

    Call Register_Event_Handler
    End Sub

    Sub Register_Event_Handler()
    Set MyClass.appWord = Word.Application
    End Sub

    Pete

  7. #7
    Star Lounger
    Join Date
    Jun 2004
    Location
    Gtr London, England
    Posts
    90
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Using OnAction in Outlook (Office 2003)

    Thanks Pete.

    PS: Nice picture !!!!

Posting Permissions

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