![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
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
|
|||
|
|||
![]() 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 |
Display Modes | |
|
|
![]() |
||||
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 |