Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Silently save digitally signed message to disk

Posted on 2015-01-13
9
Medium Priority
?
899 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 15

Expert Comment

by:DrTribos
ID: 40548026
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
ID: 40548186
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
ID: 40549518
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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
LVL 15

Assisted Solution

by:DrTribos
DrTribos earned 2000 total points
ID: 40549907
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
 
LVL 5

Author Comment

by:rberke
ID: 40550191
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 15

Expert Comment

by:DrTribos
ID: 40550210
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 15

Expert Comment

by:DrTribos
ID: 40567729
Thanks, glad you got it working.
0
 
LVL 5

Author Closing Comment

by:rberke
ID: 40574821
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 15

Expert Comment

by:DrTribos
ID: 40574855
Thanks - glad to contribute
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
Microsoft has changed the look and feel of Azure AD and Microsoft account sign-in pages so that you will have a more unified look and feel when moving between the two interfaces.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

618 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