OVH Cloud OVH Cloud

pb macro

1 réponse
Avatar
Oliv'
Bonjour à toutes et tous,
J'ai une macro qui se lance à partir d'un mail ouvert dans une fenêtre, je
soushaiterai aussi pouvoir la lancer à partir de la boite de réception
lorsque le mail est selectionné mais non ouvert.
Par quoi dois je remplacer activeInspector ? ou quelle opération ajouter
avant ?

Sub LaunchPictureAttachmentsHelper()
'Map toolbar button to this macro

On Error Resume Next

If Application.ActiveInspector Is Nothing Then Exit Sub
If Application.ActiveInspector.CurrentItem.Attachments.Count = 0 Then
Exit Sub
frmPictureAttachments.FillList
frmPictureAttachments.Show

End Sub

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Have a nice day
Oliv'
Pour me joindre : http://cerbermail.com/?V8r2o1YHl4
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

1 réponse

Avatar
Oliv'
Oliv' <(supprimerceci) que je salut a écrit
dans
Bonjour à toutes et tous,
J'ai une macro qui se lance à partir d'un mail ouvert dans une
fenêtre, je soushaiterai aussi pouvoir la lancer à partir de la boite
de réception lorsque le mail est selectionné mais non ouvert.
Par quoi dois je remplacer activeInspector ? ou quelle opération
ajouter avant ?

Sub LaunchPictureAttachmentsHelper()
'Map toolbar button to this macro

On Error Resume Next

If Application.ActiveInspector Is Nothing Then Exit Sub
If Application.ActiveInspector.CurrentItem.Attachments.Count = 0
Then Exit Sub
frmPictureAttachments.FillList
frmPictureAttachments.Show

End Sub


Trouvé :
Sub GetSelectedItems()
Dim myOlApp As New Outlook.Application
Dim myOlExp As Outlook.Explorer
Dim myOlSel As Outlook.Selection
Dim MsgTxt As String
Dim x As Integer
MsgTxt = "Vous devez selectionner un seul mail"
Set myOlExp = myOlApp.ActiveExplorer
Set myOlSel = myOlExp.Selection
x = myOlSel.Count
If x <> 1 Then
MsgBox MsgTxt
Exit Sub
End If
myOlSel.Item(x).Display
End Sub
Merci à ceux qui ont cherché

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Have a nice day
Oliv'
Pour me joindre : http://cerbermail.com/?V8r2o1YHl4
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~