View Single Post
  #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

Ads