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
| Public Sub createForward(ByVal myTraitement As String)
Dim aujourdhui As String = Format(DateTime.Now, "ddMMyy - ")
Dim refDefaut As String
Dim myinspector As Outlook.Inspector
Dim myItem As Outlook.MailItem
Dim myattachments As Outlook.Attachments
Dim mySubject As String
Dim mySubjectType As String
Dim oldItem As Outlook.MailItem
Select Case myTraitement
Case "okTraite"
mySubjectType = "OK TRAITE" Case "dejaTraite"
mySubjectType = "DEJA TRAITE"
End Select
myinspector = Application.ActiveInspector
If Not TypeName(myinspector) = "Nothing" Then
oldItem = myinspector.CurrentItem
myItem = myinspector.CurrentItem.Forward
If Clipboard.ContainsText Then
refDefaut = Clipboard.GetText()
Else
refDefaut = "maRéférence"
End If
Dim numero = InputBox("Veuillez entrez la référence", "Référence", refDefaut)
If numero <> "" Then
myattachments = myItem.Attachments
mySubject = aujourdhui & mySubjectType & " - " & myItem.Subject
myItem.Subject = mySubject
myItem.BCC = "CDS"
myItem.Display()
If (optionClose = True) Then oldItem.Close(False)
End If
End If
myItem = Nothing
End Sub |
Partager