PC Review


Reply
Thread Tools Rate Thread

Delete CDO page heading and following matter when printing an emaildocument; to print the document only

 
 
Michael Lanier
Guest
Posts: n/a
 
      9th Apr 2010
I have used a modified form of Ron de Bruin's macro for sending Excel
generated email via CDO. I would like to be able to print the CDO
generated document without printing the heading (To: From: Subject:
etc.) or any tags that may follow. Does anyone have a suggestion?
Thanks.

Michael


If Worksheets("DataBase").Range("R348").Value = 1 And
Worksheets("Record").Range("C21").Value > 0 Then
Dim iMsg As Object
Dim iConf As Object
Dim ws As Worksheet
Dim Sourcewb As Workbook
Dim Flds As Variant
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
Set iConf = CreateObject("CDO.Configuration")
iConf.Load -1
Set Flds = iConf.Fields
With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/
sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/
smtpserver") = Worksheets("DataBase").Range("H338")
.Item("http://schemas.microsoft.com/cdo/configuration/
smtpserverport") = 25
.Update
End With
Set Sourcewb = ThisWorkbook
For Each ws In Sourcewb.Worksheets
If ws.Range("AF49").Value Like "?*@?*.?*" And
Worksheets("Record").Range("V6").Value = 1 Then 'CUSTOMER'S
CONFIRMATION
ws.Unprotect "Mimi&Papa1948"
Set iMsg = CreateObject("CDO.Message")
With iMsg
Set .Configuration = iConf
.To = ws.Range("AF49").Value
.From = Worksheets("Record").Range("AC52")
.Subject = "The " &
Worksheets("Record").Range("C5") & " Project Customer's E-
mail Confirmation"
.HTMLBody =
RangetoHTML(ws.UsedRange.SpecialCells(xlCellTypeVisible))
.Send
End With
Set iMsg = Nothing
ws.Protect "Mimi&Papa1948"
End If
If ws.Range("AF49").Value Like "?*@?*.?*" And
Worksheets("Record").Range("V6").Value > 1 Then 'SUB'S CONFIRMATION
ws.Unprotect "Mimi&Papa1948"
Set iMsg = CreateObject("CDO.Message")
With iMsg
Set .Configuration = iConf
.To = ws.Range("AF49").Value
.From = Worksheets("Record").Range("AC52")
.Subject = "The " &
Worksheets("Record").Range("C5") & " Project Information
Worksheet E-mail Confirmation"
.HTMLBody =
RangetoHTML(ws.UsedRange.SpecialCells(xlCellTypeVisible))
.Send
End With
Set iMsg = Nothing
ws.Protect "Mimi&Papa1948"
End If
If ws.Range("AF50").Value Like "?*@?*.?*" And
Worksheets("Record").Range("V6").Value = 1 Then 'CUSTOMER'S EMAIL
ws.Unprotect "Mimi&Papa1948"
Set iMsg = CreateObject("CDO.Message")
With iMsg
Set .Configuration = iConf
.To = ws.Range("AF50").Value
.From = Worksheets("Record").Range("AC52")
.Subject = "The " &
Worksheets("Record").Range("C5") & " Project"
.HTMLBody =
RangetoHTML(ws.UsedRange.SpecialCells(xlCellTypeVisible))
.Send
End With
Set iMsg = Nothing
ws.Protect "Mimi&Papa1948"
End If
If ws.Range("AF50").Value Like "?*@?*.?*" And
Worksheets("Record").Range("V6").Value > 1 Then 'SUB'S EMAIL
ws.Unprotect "Mimi&Papa1948"
Set iMsg = CreateObject("CDO.Message")
With iMsg
Set .Configuration = iConf
.To = ws.Range("AF50").Value
.From = Worksheets("Record").Range("AC52")
.Subject = "The " &
Worksheets("Record").Range("C5") & " Project Information Worksheet"
.HTMLBody =
RangetoHTML(ws.UsedRange.SpecialCells(xlCellTypeVisible))
.Send
End With
Set iMsg = Nothing
ws.Protect "Mimi&Papa1948"
End If
Next ws
With Application
.EnableEvents = True
.ScreenUpdating = True
End With
End If
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Page numbers printing, but not in document. Can't delete. Leslie Microsoft Word Document Management 4 4th Jan 2008 06:00 PM
printing a document print to fit whilst utilizing the whole page =?Utf-8?B?Q3VydmVz?= Microsoft Excel Misc 0 27th Jun 2006 05:56 AM
I can't print more than one copy of a document no matter how many =?Utf-8?B?SGl0YWM=?= Microsoft Word Document Management 1 19th Jan 2006 04:33 PM
delete column heading for print =?Utf-8?B?RGFmZnk=?= Microsoft Excel Worksheet Functions 1 10th Dec 2005 07:37 PM
Supress Printing Empty Final Page With Just Page Heading =?Utf-8?B?Uml0YUc=?= Microsoft Access Form Coding 0 9th Nov 2004 10:59 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:00 PM.