473,320 Members | 1,955 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Help with printing out a .msg

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

Apr 25 '06 #1
0 1000

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: fabien | last post by:
Hi, I am writing a POV-RAY editor with Python using either QT or GTK as GUI 'wrapper'. ( I am still trying both ) * * * * PYGTK * * * * I have downloaded PygtkScintilla-1.99.5. There is a...
1
by: steven | last post by:
I am creating some financial reports in Access 2000, and I am having problem that I can't resolve. The report sorts information first by vendor, then by budget line number. It generates the...
0
by: Nigel | last post by:
I successfully create a .NET Component (Visual Basic .NET) that would print, unfortunately when used within a web browser it appears that .NET security doesn't allow you to run code that interacts...
1
by: Mika M | last post by:
Hi! I have some problems with setting PrintDocument margins using PageSetupDialog. Here some code to explain my problem... First PrintDocument declaring this way... Private pd As...
2
by: Sukh | last post by:
Hi I am stuck with a problem Can anyone help me out from this... I am printing a report on pre-printed continue paper using dot-matrix printer using vb.net. Data is printing on all the...
0
by: Sukh | last post by:
Hi I am stuck with a problem Can anyone help me out from this... I am printing a report on pre-printed continue paper using dot-matrix printer using vb.net. Data is printing on all the...
6
by: Siv | last post by:
Hi, I am getting into printing with VB.NET 2005 and want to implement the usual capability that a user can select a selection of pages. I have a report that is generated by my application that if...
10
by: preethamkumark | last post by:
- The program first creates a shared memory buffer containing an array of 20 integers. - Each slot of the buffer can have either 0 or 1, where 0 represents an empty slot, and 1 represents an...
0
by: Scotty | last post by:
Hi, Hope someone can help me I have a datagridview sith data Code below works fine if I print the data if there is only 1 page (without using '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! If...
1
by: srinivasarv | last post by:
Dear Friends, kindly help me in correcting the following code This code is for printing the report from the combo box after selection which connects to different reports as selected. I have...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.