A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Printing Outlook Emails with List of Attachments by Copy Macro



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 16th 07, 08:35 PM posted to microsoft.public.outlook.program_vba
Bert
external usenet poster
 
Posts: 1
Default Printing Outlook Emails with List of Attachments by Copy Macro

The following code is supposed to make a copy of the current email,
convert it from HTML to plain text, print it out, and then delete the
copy.

The reason for this is that Outlook will not print the list of
attachments of an HTML email but will do so for a plain text email. I
want to be able to have a button the end-user can click that converts
a copy of the email, prints it, and then discards the converted copy
without saving.

It works fine excapt that it doesn't discard the copy-- each time the
macro runs, another copy of the email is created in the inbox.

Can anyone tell me how to get the copy to go away?

Thanks,
-Bert

Code follows...


Sub FormatPlainTextMail()

Dim colCB As CommandBars
Dim objCBB As CommandBarButton
Dim obj As Object

Set obj = Application.ActiveExplorer.Selection(1).Copy
obj.Display

Set colCB = ActiveInspector.CommandBars
Set objCBB = colCB.FindControl(, 5604)
If Not objCBB Is Nothing Then
objCBB.Execute
End If
Set objCBB = colCB.FindControl(, 5563)
If Not objCBB Is Nothing Then
objCBB.Execute
End If


obj.PrintOut
'obj.Close 1
obj.Delete

End Sub

Ads
  #2  
Old May 21st 07, 07:21 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Printing Outlook Emails with List of Attachments by Copy Macro



What happens if you first close and then delete the item? it should be
deleted (in the Deleted Items folder) then.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Quick-Cats - Categorize Outlook data:
http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6


Am 16 May 2007 11:35:54 -0700 schrieb Bert:

The following code is supposed to make a copy of the current email,
convert it from HTML to plain text, print it out, and then delete the
copy.

The reason for this is that Outlook will not print the list of
attachments of an HTML email but will do so for a plain text email. I
want to be able to have a button the end-user can click that converts
a copy of the email, prints it, and then discards the converted copy
without saving.

It works fine excapt that it doesn't discard the copy-- each time the
macro runs, another copy of the email is created in the inbox.

Can anyone tell me how to get the copy to go away?

Thanks,
-Bert

Code follows...


Sub FormatPlainTextMail()

Dim colCB As CommandBars
Dim objCBB As CommandBarButton
Dim obj As Object

Set obj = Application.ActiveExplorer.Selection(1).Copy
obj.Display

Set colCB = ActiveInspector.CommandBars
Set objCBB = colCB.FindControl(, 5604)
If Not objCBB Is Nothing Then
objCBB.Execute
End If
Set objCBB = colCB.FindControl(, 5563)
If Not objCBB Is Nothing Then
objCBB.Execute
End If


obj.PrintOut
'obj.Close 1
obj.Delete

End Sub

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Showing attachments when printing emails from Outlook 2002, XP Isissoft Outlook - General Queries 4 March 31st 07 09:04 PM
Printing groups of emails and attachments [email protected] Outlook and VBA 1 October 27th 06 07:58 AM
Outlook printing with attachments CAMC1 Outlook - General Queries 0 August 23rd 06 10:16 PM
vba macro to print email and attachments outlook 2000 Dan over in IT Outlook and VBA 2 June 7th 06 09:08 PM
Copy Attachments from Outlook to a Web Form? Pankil Outlook - General Queries 0 May 15th 06 08:27 PM


All times are GMT +1. The time now is 05:56 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.