1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
| Option Explicit
Private WithEvents objOLApp As Outlook.Application
Implements IRibbonExtensibility
Private Sub AddinInstance_OnConnection(ByVal Application As Object, _
ByVal ConnectMode As AddInDesignerObjects.ext_ConnectMode, _
ByVal AddInInst As Object, custom() As Variant)
'Set my object to the host application.
On Error GoTo AddinInstance_OnConnection_Error
Set objOLApp = Application
If Verif_VERSION = True Then
Application.Quit
Else
Call FICHIER_config
End If
On Error GoTo 0
Exit Sub
AddinInstance_OnConnection_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure AddinInstance_OnConnection of Concepteur Connect"
'Resume
End Sub
Private Sub AddinInstance_OnDisconnection(ByVal RemoveMode As _
AddInDesignerObjects.ext_DisconnectMode, custom() As Variant)
'Clean up objects that are created during the OnConnection event.
Set objOLApp = Nothing
End Sub
Public Function IRibbonExtensibility_GetCustomUI(ByVal RibbonID As String) As String
'RibbonID indicates type of Inspector that is about to be displayed,
' valid RibbonID values are as follows:
'Microsoft.Outlook.Mail.Read
'Microsoft.Outlook.Mail.Compose
'Microsoft.Outlook.MeetingRequest.Read
'Microsoft.Outlook.MeetingRequest.Send
'Microsoft.Outlook.Appointment
'Microsoft.Outlook.Contact
'Microsoft.Outlook.Journal
'Microsoft.Outlook.Task
'Microsoft.Outlook.DistributionList
'Microsoft.Outlook.Report
'Microsoft.Outlook.Resend
'Microsoft.Outlook.Response.Read
'Microsoft.Outlook.Response.Compose
'Microsoft.Outlook.Response.CounterPropose
'Microsoft.Outlook.RSS
'Microsoft.Outlook.Post.Read
'Microsoft.Outlook.Post.Compose
'Microsoft.Outlook.Sharing.Read
'Microsoft.Outlook.Sharing.Compose
Select Case RibbonID
Case "Microsoft.Outlook.Explorer"
'IRibbonExtensibility_GetCustomUI = GetRibbonXML_EXP()
Case "Microsoft.Outlook.Mail.Compose"
IRibbonExtensibility_GetCustomUI = GetRibbonXML_COMPOSE()
Case "Microsoft.Outlook.Mail.Read"
' IRibbonExtensibility_GetCustomUI = GetRibbonXML()
End Select
End Function
Public Function GetRibbonXML_COMPOSE() As String
Dim sRibbonXML As String
sRibbonXML = "<customUI xmlns=""http://schemas.microsoft.com/office/2009/07/customui"" >" & _
"<commands>" & _
"<!-- Désactive le bouton AttachFile -->" & _
"<command idMso=""AttachFile"" onAction=""SaveOverride"" />" & _
"</commands>" & _
"</customUI>"
GetRibbonXML_COMPOSE = sRibbonXML
End Function
Public Sub SaveOverride(control As IRibbonControl, ByRef cancelDefault)
MsgBox "remplacement de attach"
End Sub |
Partager