K
KenR
I have adapted code found here to try to save the selected e-mail to a
specific location external to Outlook. The code crashes on the SaveAs line,
giving an error message, "The messaging interface has returned an unknown
error. If the problem persists, restart Outlook (-278462338)" The error
number varies.
I am using Outlook 2003.
The code in question is:
On Error GoTo Err_SaveMe
Dim TheEmail As MailItem
Dim Path As String
Dim strSubj As String
Set TheEmail = Application.ActiveExplorer.Selection(1)
'remove illegal characters from subject
strSubj = Replace(TheEmail.Subject, "/", "-")
strSubj = Replace(strSubj, "\", "-")
strSubj = Replace(strSubj, ":", "--")
strSubj = Replace(strSubj, "?", sReplace)
strSubj = Replace(strSubj, Chr(34), sReplace)
strSubj = Replace(strSubj, "<", sReplace)
strSubj = Replace(strSubj, ">", sReplace)
strSubj = Replace(strSubj, "|", sReplace)
Path = "K:\"
TheEmail.SaveAs Path & strSubj, olMSG
Exit Sub
Err_SaveMe:
MsgBox Err.Description & " (" & Err.Number & ")"
End Sub
Any help would certainly be appreciated....
specific location external to Outlook. The code crashes on the SaveAs line,
giving an error message, "The messaging interface has returned an unknown
error. If the problem persists, restart Outlook (-278462338)" The error
number varies.
I am using Outlook 2003.
The code in question is:
On Error GoTo Err_SaveMe
Dim TheEmail As MailItem
Dim Path As String
Dim strSubj As String
Set TheEmail = Application.ActiveExplorer.Selection(1)
'remove illegal characters from subject
strSubj = Replace(TheEmail.Subject, "/", "-")
strSubj = Replace(strSubj, "\", "-")
strSubj = Replace(strSubj, ":", "--")
strSubj = Replace(strSubj, "?", sReplace)
strSubj = Replace(strSubj, Chr(34), sReplace)
strSubj = Replace(strSubj, "<", sReplace)
strSubj = Replace(strSubj, ">", sReplace)
strSubj = Replace(strSubj, "|", sReplace)
Path = "K:\"
TheEmail.SaveAs Path & strSubj, olMSG
Exit Sub
Err_SaveMe:
MsgBox Err.Description & " (" & Err.Number & ")"
End Sub
Any help would certainly be appreciated....