vbaemailoutlookpromptsave-as

How do I suppress Yes/No Prompt when Saving digitally signed Mail in a format that is not secure?


I wrote VBA to save an email as a text file.

For digitally signed emails it prompts me if I want to save the file in a format that is not secure (yes or no to continue). I want to suppress this warning.

I tried the following:

With Application
     .EnableEvents = False
     .ScreenUpdating = False
End With
Application.DisplayAlerts = False
m.SaveAs savePath, olTXT 
With Application
     .EnableEvents = True
     .ScreenUpdating = ture
End With

And

Application.DisplayAlerts = False
m.SaveAs savePath, olTXT 
Application.DisplayAlerts = True

They both do not work (I get a compile error). How do I turn off these alerts in Outlook?


Solution

  • Those properties are for Word or Excel. Outlook does not have the equivalent functionality. The best you can do is use the SendKeys method to simulate clicking the Yes or No buttons: https://msdn.microsoft.com/en-us/library/office/gg278655.aspx