Solved

Silently save digitally signed message to disk

Posted on 2015-01-13
9
538 Views
Last Modified: 2015-01-28
I am using  vba in outlook 2010

When I try to save a digitally signed message to disk, outlook sends a warning message.

You have changed this message. If you save the changes, the message will no longer be digitally signed. Do you want to save your changes?

I want to save the message to disk without any changes. How can I do that?

Dim item As mailItem
    For Each item In ActiveExplorer.Selection
        item.SaveAs "c:\aatmp\test642.msg", olMsg
    Next
End Sub

Open in new window

0
Comment
Question by:rberke
  • 5
  • 4
9 Comments
 
LVL 14

Expert Comment

by:DrTribos
Comment Utility
I think you would have to close the file then copy it to your preferred location... saving, as I understand it, will save changes.  You can, perhaps, make use of close without saving, or write the content of the file to another location.

I think the approach I would use depends on whether or not it is important to retain the certificate.
0
 
LVL 5

Author Comment

by:rberke
Comment Utility
I am saving the contents of my email archive to disk.

99% of the saves work fine, but the program fails when the archive contains a digitally signed email.

As a workaround, i log the troublesome emails, and skip them.

Any body have code that will get around the problem?

Everything I try keeps coming up with "you have changed the message ...".
0
 
LVL 5

Accepted Solution

by:
rberke earned 0 total points
Comment Utility
the problem occurred when a client sent me a digitally signed email. Until this happened, I had never had any interaction with digital signed emails.

But, I decided to get a little experience, so I went to Comodo.com and installed a free digital signature on my computer and changed the outlook configuration to allow me to sign my own messages.

Strangely enough, the .saveas problem has now gone away  !!! I am able to save the message to disk with no problem.

I believe the change to outlook configuration allowed the code to work.

Perhaps one of you experts can test this for me.

open the attached zip, and copy the .msg file into outlook.  Select that message and run the code in my initial post.

If the code gives you the warning message, I'll give you a share of the points.
signed-msg-file.zip
0
 
LVL 14

Assisted Solution

by:DrTribos
DrTribos earned 500 total points
Comment Utility
Hmmm interesting... I have not used VBA in OutLook before so decided to dip my big toe in...

I get RTE -2147287037 (80030003) The operation failed.

I did not have a dir with the name specified so I just used c:\tmp instead, then it worked

The macro ran w/o issues.

I have confirmed that the message was copied to the tmp folder.  I will disclose that I already had my own digital signature for code signing (GoDaddy) - however I don't use outlook and can guarantee that I have not changed any outlook specific settings on this PC to work with signatures (MS Word is a different story and that could impact all of Office).

Hope this helps.

Option Explicit

Sub Robert()
Dim item As MailItem
    For Each item In ActiveExplorer.Selection
        item.SaveAs "c:\tmp\test642.msg", olMSG
    Next
End Sub

Open in new window

0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 5

Author Comment

by:rberke
Comment Utility
Thanks for your input.

Summary so far:
1) my laptop uses Outlook 2010 and originally gave the error message
2) after installing a signature and reconfiguring Outlook, the error message went away.
3) A desktop computer with outlook 2003, no signatures and no reconfigurations does give the error message.
4) I will install a signature on that computer and see what happens. That will be definitive, but it might be a day or two before I get around to it.

DrTribos recent post adds the following
5) DrTribos has a computer with signatures installed, His does not give the error message even though Outlook has not be reconfigured.

rberke
0
 
LVL 14

Expert Comment

by:DrTribos
Comment Utility
No worries, I don't think I can add much more as I don't really have suitable test environments. But the behavior you describe seems odd to me! Nothing new, just saying!
0
 
LVL 14

Expert Comment

by:DrTribos
Comment Utility
Thanks, glad you got it working.
0
 
LVL 5

Author Closing Comment

by:rberke
Comment Utility
DrTribos gets points for confirming that my code works on his Windows 7 computer even though it did not work on mine.

But, I "fixed" my Windows 7 computer by installing a first digital email certificate.  That idea was mine, so I am awarding myself the best answer.

In a few months, I will check to see if the "fix" also works on another computer with windows XP, but that computer cannot be touched right now.
0
 
LVL 14

Expert Comment

by:DrTribos
Comment Utility
Thanks - glad to contribute
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

In case Office 2010 has not been deployed in your environment, this article may be quite useful. In our office, we wanted a way to deploy Microsoft Office Professional Plus 2010 through an automated batch file via logon script. This article is docum…
My experience with Windows 10 over a one year period and suggestions for smooth operation
This video shows the viewer how to set up and create Footnotes in their document. Click on the References tab: Select "Insert Footnote": Type in desired text:
This video shows and describes the main difference between both orientations in Microsoft Word. Viewers will understand when to use each orientation and how to get the most out of them.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now