I have a database where users are entering information into a form and
can attach word, mail, powerpoint, etc files. I have code to print word
and excel files, but am having difficulty with printing mail(.msg and
..oft). Below is one of the codes i have tried, but am getting an error:
"The remote server machine does not exist or is unavailable." on the
line that sets the EmDoc. Any help would be appreciated.
Private Sub PrintEmail(strPath As String)
On Error GoTo Err_Handler
Dim EmApp As Outlook.Application
Dim EmDoc As Outlook.MailItem
Set EmDoc = GetObject(strPath)
EmDoc.PrintOut
Exit_Handler:
On Error Resume Next
EmDoc.Close
Set EmDoc = Nothing
EmApp.Quit
Set EmApp = Nothing
Exit Sub
Err_Handler:
MsgBox Err.Description, vbExclamation, "Error No: " & Err.Number
Resume Exit_Handler
End Sub