Help with Print Macro

  • Thread starter Thread starter dvpetta
  • Start date Start date
D

dvpetta

Hello,

I recently installed internet explorer 7 beta 3 update to my system and
I'm having a problem printing emails from the preview pane. However I
can print the email if I open it (doulbe click) and then print it.

Doesn't look like microsoft has a fix for this yet so I was hoping
someone can help me with a work around - create a macro that would open
an email (already selected), print it and then close the email. Pretty
simple, but outlook doesn't have a macro recorder so I have no idea how
to write this.

So can someone provide me with the code I need to do this. Again the
situation would be that I have the email already highlighted in the
preview plane and I'd like to have the marco open the email, print it
and then close it.

Thanks,
Dan
 
Am 10 Aug 2006 12:46:55 -0700 schrieb (e-mail address removed):

Public Sub PrintMail()
Dim obj as Object
Set obj=Application.ActiveExplorer.Selection(1)
obj.Display
obj.Printout
End Sub
 
Thanks for trimming the groups!

--
Milly Staples [MVP - Outlook]

Post all replies to the group to keep the discussion intact. All
unsolicited mail sent to my personal account will be deleted without
reading.

After furious head scratching, Michael Bauer [MVP - Outlook] asked:

| Am 10 Aug 2006 12:46:55 -0700 schrieb (e-mail address removed):
|
| Public Sub PrintMail()
| Dim obj as Object
| Set obj=Application.ActiveExplorer.Selection(1)
| obj.Display
| obj.Printout
| End Sub
|
|
|| Hello,
||
|| I recently installed internet explorer 7 beta 3 update to my system
|| and I'm having a problem printing emails from the preview pane.
|| However I can print the email if I open it (doulbe click) and then
|| print it.
||
|| Doesn't look like microsoft has a fix for this yet so I was hoping
|| someone can help me with a work around - create a macro that would
|| open an email (already selected), print it and then close the email.
|| Pretty simple, but outlook doesn't have a macro recorder so I have
|| no idea how to write this.
||
|| So can someone provide me with the code I need to do this. Again the
|| situation would be that I have the email already highlighted in the
|| preview plane and I'd like to have the marco open the email, print it
|| and then close it.
||
|| Thanks,
|| Dan
 
Thanks for the macro code. I created the macro, changed my security
levels to allow it now I get a message saying that "items in this
message are still loading. Please wait a moment and then try again.".
The message opens, nothing prints, I get the error message and the
email window remains open. I'm guessing Outlook needs more time to
load the email before it can print it? I tried this with all different
size emails (KB) and I got the same message.

Thanks again,
Dan
 
Am Thu, 10 Aug 2006 21:54:21 -0700 schrieb Milly Staples [MVP - Outlook]:

Milly, nice to meet you! I didn´t realize that Dan asked in several groups.
 
Am 11 Aug 2006 08:18:39 -0700 schrieb (e-mail address removed):

You could try to insert the command: DoEvents
between the line .Display and .Printout.

Are you using IMAP?

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --

Thanks for the macro code. I created the macro, changed my security
levels to allow it now I get a message saying that "items in this
message are still loading. Please wait a moment and then try again.".
The message opens, nothing prints, I get the error message and the
email window remains open. I'm guessing Outlook needs more time to
load the email before it can print it? I tried this with all different
size emails (KB) and I got the same message.

Thanks again,
Dan



Thanks for trimming the groups!

--
Milly Staples [MVP - Outlook]

Post all replies to the group to keep the discussion intact. All
unsolicited mail sent to my personal account will be deleted without
reading.

After furious head scratching, Michael Bauer [MVP - Outlook] asked:

| Am 10 Aug 2006 12:46:55 -0700 schrieb (e-mail address removed):
|
| Public Sub PrintMail()
| Dim obj as Object
| Set obj=Application.ActiveExplorer.Selection(1)
| obj.Display
| obj.Printout
| End Sub
|
|
|| Hello,
||
|| I recently installed internet explorer 7 beta 3 update to my system
|| and I'm having a problem printing emails from the preview pane.
|| However I can print the email if I open it (doulbe click) and then
|| print it.
||
|| Doesn't look like microsoft has a fix for this yet so I was hoping
|| someone can help me with a work around - create a macro that would
|| open an email (already selected), print it and then close the email.
|| Pretty simple, but outlook doesn't have a macro recorder so I have
|| no idea how to write this.
||
|| So can someone provide me with the code I need to do this. Again the
|| situation would be that I have the email already highlighted in the
|| preview plane and I'd like to have the marco open the email, print it
|| and then close it.
||
|| Thanks,
|| Dan
 
Thanks the DoEvents insert helped. Now the macro opens the email &
prints it.

To end the macro I'd like for it to close the email window. What can
be added to this macro at the end to close the email window after
printing.

Also, is it not OK to post in multiple groups? I've done this in the
past in hopes of reaching more professionals like yourselves.

Thanks for your help,
Daniel

Am 11 Aug 2006 08:18:39 -0700 schrieb (e-mail address removed):

You could try to insert the command: DoEvents
between the line .Display and .Printout.

Are you using IMAP?

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --

Thanks for the macro code. I created the macro, changed my security
levels to allow it now I get a message saying that "items in this
message are still loading. Please wait a moment and then try again.".
The message opens, nothing prints, I get the error message and the
email window remains open. I'm guessing Outlook needs more time to
load the email before it can print it? I tried this with all different
size emails (KB) and I got the same message.

Thanks again,
Dan



Thanks for trimming the groups!

--
Milly Staples [MVP - Outlook]

Post all replies to the group to keep the discussion intact. All
unsolicited mail sent to my personal account will be deleted without
reading.

After furious head scratching, Michael Bauer [MVP - Outlook] asked:

| Am 10 Aug 2006 12:46:55 -0700 schrieb (e-mail address removed):
|
| Public Sub PrintMail()
| Dim obj as Object
| Set obj=Application.ActiveExplorer.Selection(1)
| obj.Display
| obj.Printout
| End Sub
|
|
|| Hello,
||
|| I recently installed internet explorer 7 beta 3 update to my system
|| and I'm having a problem printing emails from the preview pane.
|| However I can print the email if I open it (doulbe click) and then
|| print it.
||
|| Doesn't look like microsoft has a fix for this yet so I was hoping
|| someone can help me with a work around - create a macro that would
|| open an email (already selected), print it and then close the email.
|| Pretty simple, but outlook doesn't have a macro recorder so I have
|| no idea how to write this.
||
|| So can someone provide me with the code I need to do this. Again the
|| situation would be that I have the email already highlighted in the
|| preview plane and I'd like to have the marco open the email, print it
|| and then close it.
||
|| Thanks,
|| Dan
 
Thanks the DoEvents insert helped. Now the macro opens the email &
prints it.

To end the macro I'd like for it to close the email window. What can
be added to this macro at the end to close the email window after
printing.


Also, is it not OK to post in multiple groups? I've done this in the
past in hopes of reaching more professionals like yourselves.


Thanks for your help,
Daniel
Am Thu, 10 Aug 2006 21:54:21 -0700 schrieb Milly Staples [MVP - Outlook]:

Milly, nice to meet you! I didn´t realize that Dan asked in several groups.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --

Thanks for trimming the groups!

--
Milly Staples [MVP - Outlook]

Post all replies to the group to keep the discussion intact. All
unsolicited mail sent to my personal account will be deleted without
reading.

After furious head scratching, Michael Bauer [MVP - Outlook] asked:

| Am 10 Aug 2006 12:46:55 -0700 schrieb (e-mail address removed):
|
| Public Sub PrintMail()
| Dim obj as Object
| Set obj=Application.ActiveExplorer.Selection(1)
| obj.Display
| obj.Printout
| End Sub
|
|
|| Hello,
||
|| I recently installed internet explorer 7 beta 3 update to my system
|| and I'm having a problem printing emails from the preview pane.
|| However I can print the email if I open it (doulbe click) and then
|| print it.
||
|| Doesn't look like microsoft has a fix for this yet so I was hoping
|| someone can help me with a work around - create a macro that would
|| open an email (already selected), print it and then close the email.
|| Pretty simple, but outlook doesn't have a macro recorder so I have
|| no idea how to write this.
||
|| So can someone provide me with the code I need to do this. Again the
|| situation would be that I have the email already highlighted in the
|| preview plane and I'd like to have the marco open the email, print it
|| and then close it.
||
|| Thanks,
|| Dan
 
What people object to is posting the same thing in multiple groups in
separate messages. If you post to a number of groups with 1 message then
marking it read prevents you from seeing the post in other groups.




Thanks the DoEvents insert helped. Now the macro opens the email &
prints it.

To end the macro I'd like for it to close the email window. What can
be added to this macro at the end to close the email window after
printing.


Also, is it not OK to post in multiple groups? I've done this in the
past in hopes of reaching more professionals like yourselves.


Thanks for your help,
Daniel
 
Am 14 Aug 2006 11:25:20 -0700 schrieb (e-mail address removed):

Add an obj.Close please.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --

Thanks the DoEvents insert helped. Now the macro opens the email &
prints it.

To end the macro I'd like for it to close the email window. What can
be added to this macro at the end to close the email window after
printing.


Also, is it not OK to post in multiple groups? I've done this in the
past in hopes of reaching more professionals like yourselves.


Thanks for your help,
Daniel
Am Thu, 10 Aug 2006 21:54:21 -0700 schrieb Milly Staples [MVP - Outlook]:

Milly, nice to meet you! I didn´t realize that Dan asked in several groups.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --

Thanks for trimming the groups!

--
Milly Staples [MVP - Outlook]

Post all replies to the group to keep the discussion intact. All
unsolicited mail sent to my personal account will be deleted without
reading.

After furious head scratching, Michael Bauer [MVP - Outlook] asked:

| Am 10 Aug 2006 12:46:55 -0700 schrieb (e-mail address removed):
|
| Public Sub PrintMail()
| Dim obj as Object
| Set obj=Application.ActiveExplorer.Selection(1)
| obj.Display
| obj.Printout
| End Sub
|
|
|| Hello,
||
|| I recently installed internet explorer 7 beta 3 update to my system
|| and I'm having a problem printing emails from the preview pane.
|| However I can print the email if I open it (doulbe click) and then
|| print it.
||
|| Doesn't look like microsoft has a fix for this yet so I was hoping
|| someone can help me with a work around - create a macro that would
|| open an email (already selected), print it and then close the email.
|| Pretty simple, but outlook doesn't have a macro recorder so I have
|| no idea how to write this.
||
|| So can someone provide me with the code I need to do this. Again the
|| situation would be that I have the email already highlighted in the
|| preview plane and I'd like to have the marco open the email, print it
|| and then close it.
||
|| Thanks,
|| Dan
 
I added obj.Close and it causes an error.

Here is the marco I'm currently working with:

Public Sub PrintMail()
Dim obj As Object
Set obj = Application.ActiveExplorer.Selection(1)
obj.Display
DoEvents
obj.PrintOut
obj.Close
End Sub

This causes a "runtime error 449" which then launches me into the
debugger which has the obj.Close line selected.

Am 14 Aug 2006 11:25:20 -0700 schrieb (e-mail address removed):

Add an obj.Close please.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --

Thanks the DoEvents insert helped. Now the macro opens the email &
prints it.

To end the macro I'd like for it to close the email window. What can
be added to this macro at the end to close the email window after
printing.


Also, is it not OK to post in multiple groups? I've done this in the
past in hopes of reaching more professionals like yourselves.


Thanks for your help,
Daniel
Am Thu, 10 Aug 2006 21:54:21 -0700 schrieb Milly Staples [MVP - Outlook]:

Milly, nice to meet you! I didn´t realize that Dan asked in several groups.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --


Thanks for trimming the groups!

--
Milly Staples [MVP - Outlook]

Post all replies to the group to keep the discussion intact. All
unsolicited mail sent to my personal account will be deleted without
reading.

After furious head scratching, Michael Bauer [MVP - Outlook] asked:

| Am 10 Aug 2006 12:46:55 -0700 schrieb (e-mail address removed):
|
| Public Sub PrintMail()
| Dim obj as Object
| Set obj=Application.ActiveExplorer.Selection(1)
| obj.Display
| obj.Printout
| End Sub
|
|
|| Hello,
||
|| I recently installed internet explorer 7 beta 3 update to my system
|| and I'm having a problem printing emails from the preview pane.
|| However I can print the email if I open it (doulbe click) and then
|| print it.
||
|| Doesn't look like microsoft has a fix for this yet so I was hoping
|| someone can help me with a work around - create a macro that would
|| open an email (already selected), print it and then close the email.
|| Pretty simple, but outlook doesn't have a macro recorder so I have
|| no idea how to write this.
||
|| So can someone provide me with the code I need to do this. Again the
|| situation would be that I have the email already highlighted in the
|| preview plane and I'd like to have the marco open the email, print it
|| and then close it.
||
|| Thanks,
|| Dan
 
Am 15 Aug 2006 14:23:17 -0700 schrieb (e-mail address removed):

The error description says what´s to do: The close method expects an
argument.

Please place the cursor after "close" and press the spacebar. IntelliSense
then shows you what´s expected.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --

I added obj.Close and it causes an error.

Here is the marco I'm currently working with:

Public Sub PrintMail()
Dim obj As Object
Set obj = Application.ActiveExplorer.Selection(1)
obj.Display
DoEvents
obj.PrintOut
obj.Close
End Sub

This causes a "runtime error 449" which then launches me into the
debugger which has the obj.Close line selected.

Am 14 Aug 2006 11:25:20 -0700 schrieb (e-mail address removed):

Add an obj.Close please.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --

Thanks the DoEvents insert helped. Now the macro opens the email &
prints it.

To end the macro I'd like for it to close the email window. What can
be added to this macro at the end to close the email window after
printing.


Also, is it not OK to post in multiple groups? I've done this in the
past in hopes of reaching more professionals like yourselves.


Thanks for your help,
Daniel

Michael Bauer [MVP - Outlook] wrote:
Am Thu, 10 Aug 2006 21:54:21 -0700 schrieb Milly Staples [MVP - Outlook]:

Milly, nice to meet you! I didn´t realize that Dan asked in several groups.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --


Thanks for trimming the groups!

--
Milly Staples [MVP - Outlook]

Post all replies to the group to keep the discussion intact. All
unsolicited mail sent to my personal account will be deleted without
reading.

After furious head scratching, Michael Bauer [MVP - Outlook] asked:

| Am 10 Aug 2006 12:46:55 -0700 schrieb (e-mail address removed):
|
| Public Sub PrintMail()
| Dim obj as Object
| Set obj=Application.ActiveExplorer.Selection(1)
| obj.Display
| obj.Printout
| End Sub
|
|
|| Hello,
||
|| I recently installed internet explorer 7 beta 3 update to my system
|| and I'm having a problem printing emails from the preview pane.
|| However I can print the email if I open it (doulbe click) and then
|| print it.
||
|| Doesn't look like microsoft has a fix for this yet so I was hoping
|| someone can help me with a work around - create a macro that would
|| open an email (already selected), print it and then close the email.
|| Pretty simple, but outlook doesn't have a macro recorder so I have
|| no idea how to write this.
||
|| So can someone provide me with the code I need to do this. Again the
|| situation would be that I have the email already highlighted in the
|| preview plane and I'd like to have the marco open the email, print it
|| and then close it.
||
|| Thanks,
|| Dan
 
Thanks for everyone's help. in the end I just added a "PrintOut" after
the obj.Close to the end and now it works great.

Public Sub PrintMail()
Dim obj As Object
Set obj = Application.ActiveExplorer.Selection(1)
obj.Display
DoEvents
obj.PrintOut
obj.Close PrintOut
End Sub


Thanks - Dan
Am 15 Aug 2006 14:23:17 -0700 schrieb (e-mail address removed):

The error description says what´s to do: The close method expects an
argument.

Please place the cursor after "close" and press the spacebar. IntelliSense
then shows you what´s expected.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --

I added obj.Close and it causes an error.

Here is the marco I'm currently working with:

Public Sub PrintMail()
Dim obj As Object
Set obj = Application.ActiveExplorer.Selection(1)
obj.Display
DoEvents
obj.PrintOut
obj.Close
End Sub

This causes a "runtime error 449" which then launches me into the
debugger which has the obj.Close line selected.

Am 14 Aug 2006 11:25:20 -0700 schrieb (e-mail address removed):

Add an obj.Close please.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --


Thanks the DoEvents insert helped. Now the macro opens the email &
prints it.

To end the macro I'd like for it to close the email window. What can
be added to this macro at the end to close the email window after
printing.


Also, is it not OK to post in multiple groups? I've done this in the
past in hopes of reaching more professionals like yourselves.


Thanks for your help,
Daniel

Michael Bauer [MVP - Outlook] wrote:
Am Thu, 10 Aug 2006 21:54:21 -0700 schrieb Milly Staples [MVP - Outlook]:

Milly, nice to meet you! I didn´t realize that Dan asked in several
groups.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --


Thanks for trimming the groups!

--
Milly Staples [MVP - Outlook]

Post all replies to the group to keep the discussion intact. All
unsolicited mail sent to my personal account will be deleted without
reading.

After furious head scratching, Michael Bauer [MVP - Outlook] asked:

| Am 10 Aug 2006 12:46:55 -0700 schrieb (e-mail address removed):
|
| Public Sub PrintMail()
| Dim obj as Object
| Set obj=Application.ActiveExplorer.Selection(1)
| obj.Display
| obj.Printout
| End Sub
|
|
|| Hello,
||
|| I recently installed internet explorer 7 beta 3 update to my system
|| and I'm having a problem printing emails from the preview pane.
|| However I can print the email if I open it (doulbe click) and then
|| print it.
||
|| Doesn't look like microsoft has a fix for this yet so I was hoping
|| someone can help me with a work around - create a macro that would
|| open an email (already selected), print it and then close the email.
|| Pretty simple, but outlook doesn't have a macro recorder so I have
|| no idea how to write this.
||
|| So can someone provide me with the code I need to do this. Again the
|| situation would be that I have the email already highlighted in the
|| preview plane and I'd like to have the marco open the email, print it
|| and then close it.
||
|| Thanks,
|| Dan
 
Am 16 Aug 2006 11:44:07 -0700 schrieb (e-mail address removed):

If that works then just by chance. What is "PrintOut" for a value?

The available enums are:
- olDiscard
- olPromptForSave
- olSave

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --

Thanks for everyone's help. in the end I just added a "PrintOut" after
the obj.Close to the end and now it works great.

Public Sub PrintMail()
Dim obj As Object
Set obj = Application.ActiveExplorer.Selection(1)
obj.Display
DoEvents
obj.PrintOut
obj.Close PrintOut
End Sub


Thanks - Dan
Am 15 Aug 2006 14:23:17 -0700 schrieb (e-mail address removed):

The error description says what´s to do: The close method expects an
argument.

Please place the cursor after "close" and press the spacebar. IntelliSense
then shows you what´s expected.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --

I added obj.Close and it causes an error.

Here is the marco I'm currently working with:

Public Sub PrintMail()
Dim obj As Object
Set obj = Application.ActiveExplorer.Selection(1)
obj.Display
DoEvents
obj.PrintOut
obj.Close
End Sub

This causes a "runtime error 449" which then launches me into the
debugger which has the obj.Close line selected.


Michael Bauer [MVP - Outlook] wrote:
Am 14 Aug 2006 11:25:20 -0700 schrieb (e-mail address removed):

Add an obj.Close please.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --


Thanks the DoEvents insert helped. Now the macro opens the email &
prints it.

To end the macro I'd like for it to close the email window. What can
be added to this macro at the end to close the email window after
printing.


Also, is it not OK to post in multiple groups? I've done this in the
past in hopes of reaching more professionals like yourselves.


Thanks for your help,
Daniel

Michael Bauer [MVP - Outlook] wrote:
Am Thu, 10 Aug 2006 21:54:21 -0700 schrieb Milly Staples [MVP - Outlook]:

Milly, nice to meet you! I didn´t realize that Dan asked in several
groups.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --


Thanks for trimming the groups!

--
Milly Staples [MVP - Outlook]

Post all replies to the group to keep the discussion intact. All
unsolicited mail sent to my personal account will be deleted without
reading.

After furious head scratching, Michael Bauer [MVP - Outlook] asked:

| Am 10 Aug 2006 12:46:55 -0700 schrieb (e-mail address removed):
|
| Public Sub PrintMail()
| Dim obj as Object
| Set obj=Application.ActiveExplorer.Selection(1)
| obj.Display
| obj.Printout
| End Sub
|
|
|| Hello,
||
|| I recently installed internet explorer 7 beta 3 update to my system
|| and I'm having a problem printing emails from the preview pane.
|| However I can print the email if I open it (doulbe click) and then
|| print it.
||
|| Doesn't look like microsoft has a fix for this yet so I was hoping
|| someone can help me with a work around - create a macro that would
|| open an email (already selected), print it and then close the email.
|| Pretty simple, but outlook doesn't have a macro recorder so I have
|| no idea how to write this.
||
|| So can someone provide me with the code I need to do this. Again the
|| situation would be that I have the email already highlighted in the
|| preview plane and I'd like to have the marco open the email, print it
|| and then close it.
||
|| Thanks,
|| Dan
 
Back
Top