Locked Reset/Change signature of existing mail item

  • Tuesday, December 11, 2012 2:20 PM
     
     

    Hi,

    Outlook does not support changing the signature of existing (unsent) mail items by simple code like MailItem.SetSignature("mysigtemplate") or sth like that..

    Up to Outlook 2010 you can use a trick by executing the signatures list item in the "message" ribbon or context menu (using Inspector.CommandBars.ActiveMenuBar.FindControl(...)). A code sample is shown at this link: Change signature using a macro.

    For Outlook 2013 the Commandbars object is not longer supported (see article Compatibility issues in Outlook 2013 ), so the solution above cannot be used for resetting/changing the signature.

    MS recommend to substitute Commandbar functions by using the IRibbonExtensibility interface but this supports only controls with static IdMso. Runtime defined Controls (like signature list control) cannot be accessed/executed.

    Does anybody know if there is another way to do the job by code?

    Many thanks,

    Andreas

All Replies

  • Wednesday, December 12, 2012 1:05 PM
    Moderator
     
     

    Hi Andreas,

    Thank you for posting in the MSDN Forum.

    The page Change signature using a macro is not accessible to non subscription user. It will be nice if you can post it here.

    I'll do some research over this issue, and will reply back if there's any discovery.

    Thank you for your patient.

    Best regards,


    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Wednesday, December 12, 2012 1:29 PM
     
      Has Code

    Hi Quist,

    oops, sorry...

    Please see the code example below.

        Dim colCBControls As Office.CommandBarControls
        Dim objCBP, objCBP2 As Office.CommandBarPopup
        Dim objCBB As Office.CommandBarButton
        'Find "Insert" menu popop
        Set objCBP = ActiveInspector.CommandBars.ActiveMenuBar.FindControl(, 30005)
        'Find "Signatures" list popup
        Set objCBP2 = objCBP.CommandBar.FindControl(, 5608)
        If Not objCBP2 Is Nothing Then
            'Find "mysigtemplate" item
            Set colCBControls = objCBP2.Controls
            For Each objCBB In colCBControls
                If objCBB.Caption = "mysigtemplate" Then
                    objCBB.Execute
                    Exit For
                End If
            Next
        End If
    

    Andreas
  • Tuesday, December 18, 2012 9:36 AM
     
     

    Hi Quist,

    have you found out anything helpful?

    Andreas

  • Tuesday, December 18, 2012 4:52 PM
    Moderator
     
     

    Hi Andreas,

    Sorry I haven't found any solution to this issue yet.

    Best Regards,


    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.