Print email with a pop-up print dialog box?

  • Thread starter Thread starter Bingo
  • Start date Start date
B

Bingo

I'm using MailItem.PrintOut method to print the selected
email. I need to know how to open the email and populate
the print dialog box instead of print the email
directly. The PrintOut method does not take any
parameters. Thanks.
 
Hi Bingo,

MailItem.Display shows the mail. Than you can use the
Inspector.CommandBars-Collection to look for an CommandBarButton, maybe
called "Print out" (?). The CommandBarButton has an Execute method that
should display the dialog.
 
Michael,

I cannot find a button for Print out. Any idea if what
you recommended is really working? Thanks. B
 
You can't do that. That dialog is not configurable or even accessible. You
would have to create your own dialog and your own print method, possibly
using Word or Excel to print.

Outlook's printing facilities are extremely limited and haven't been
improved since Outlook 97 for developers. You can't even select or change
the default printer in Outlook.
 
Ken,

Actually I was able to access the Print button on the tool bar and call the
execute method on it. Forgot to check if the email was printed out or not.
:-)

But what I really need is to access the drop-down menu print, which will pop
up the dialog box. But I was only able to access all the top level menu
options, File, Edit, View, ... Could not figure out how to access Print
under the File Menu. Is that something possible? Thanks.
 
Bingo,
Any idea if what you recommended is really working?

What I recommended was, that you can display the dialog - not more.

(Sorry, this is not my native language and it happens sometimes, that I
don´t realize the core of a question...)

I´m not sure, but think, that the FaceID of a control is the same
whether it is an english, german or something else system. On OL 2000
this shows up the dialog:

Dim cmd As CommandBarButton
Set cmd = Application.ActiveInspector.CommandBars.FindControl(, 4)
cmd.Execute

As Ken said, there is no way to configure the dialog via OOM. If you
have a tool like Spy++ (e.g. from Visual Basic) and a lot of time, than
you can get the window handles of some controls on this dialog and try
to manipulate them. But probably it is more effective to create your own
dialog.

--
Viele Grüße
Michael Bauer

Michael,

I cannot find a button for Print out. Any idea if what
you recommended is really working? Thanks. B
 
Michael,

It solved my problem! Using MailItem.Display and what
you recommended, I'm able to do exactly what I wanted
to. Thanks so much! B
-----Original Message-----
Bingo,


What I recommended was, that you can display the dialog - not more.

(Sorry, this is not my native language and it happens sometimes, that I
don´t realize the core of a question...)

I´m not sure, but think, that the FaceID of a control is the same
whether it is an english, german or something else system. On OL 2000
this shows up the dialog:

Dim cmd As CommandBarButton
Set cmd =
Application.ActiveInspector.CommandBars.FindControl(, 4)
 
Yes, you can access any of those buttons such as the ones under the File
menu. However that will only bring up the dialog itself and not give you any
access to any of the internals of the dialog or control over it.

File is a CommandBarPopup control. It has a CommandBar property as well as a
Controls collection. Variations #2 and #3 at
http://www.outlookcode.com/d/code/sendnow.htm show some ways of getting to
controls in top level menus like File.

http://www.slovaktech.com/code_samples.htm#SendReceive also has samples like
that.
 
Back
Top