devi modificare la funzione del link!
a cui passerai il tuo rs|!idmail
questa:
Function Outlook_OpenEmail(ByVal sEntryId As String)
'REF:
https://docs.microsoft.com/en-us/office/vba/api/outlook.namespace.getitemfromid
' #Const EarlyBind = 1 'Use Early Binding
#Const EarlyBind = 0 'Use Late Binding
#If EarlyBind Then
Dim oOutlook As Outlook.Application
Dim oOutlookMsg As Outlook.MailItem
#Else
Dim oOutlook As Object
Dim oOutlookMsg As Object
#End If
On Error Resume Next
Set oOutlook = GetObject(, "Outlook.Application") 'Bind to
existing instance of Outlook
If Err.Number <> 0 Then 'Could not get instance, so create a
new one
Err.Clear
Set oOutlook = CreateObject("Outlook.Application")
End If
On Error GoTo Error_Handler
Set oNameSpace = oOutlook.GetNamespace("MAPI")
'Find the item, if not found it generates a -
2147221233 error
Set oOutlookMsg = oNameSpace.GetItemFromID(sEntryId)
'Open/Display the item to the user
'versione originale tii mostra la mail a video <<<<<<<<<<<<<<
' oOutlookMsg.Display
'tu invce vuoi salvarla quindi DEVI MODIFICARLA QUI...<<<<<<<<<
oOutlookMsg.SaveAs percorso etc etc
Error_Handler_Exit:
On Error Resume Next
If Not oOutlookMsg Is Nothing Then Set oOutlookMsg = Nothing
If Not oOutlook Is Nothing Then Set oOutlook = Nothing
Exit Function
Error_Handler:
If Err.Number = "287" Then
MsgBox "You clicked No to the Outlook security warning. " & _
"Rerun the procedure and click Yes to access e-mail " & _
"addresses to send your message. For more information, " & _
"see the document at
http://www.microsoft.com/office" & _
"/previous/outlook/downloads/security.asp."
ElseIf Err.Number = -
2147221233 Then
MsgBox "Outlook item not found.", vbInformation + vbOKOnly
Else
MsgBox "The following error has occurred" & vbCrLf & vbCrLf & _
"Error Number: " & Err.Number & vbCrLf & _
"Error Source: Outlook_OpenEmail" & vbCrLf & _
"Error Description: " & Err.Description & _
Switch(Erl = 0, "", Erl <> 0, vbCrLf & "Line No: " & Erl) _
, vbOKOnly + vbCritical, "An Error has Occurred!"
End If
Resume Error_Handler_Exit
End Function