Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Delete CDO page heading and following matter when printing an emaildocument; to print the document only

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(xlCellTypeVi sible))
.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(xlCellTypeVi sible))
.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(xlCellTypeVi sible))
.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(xlCellTypeVi sible))
.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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
same heading on each page while printing mariekek5 Excel Discussion (Misc queries) 1 July 28th 09 09:26 AM
can i delete a heading recent document drop down file exile New Users to Excel 4 March 10th 09 05:52 AM
Printing a heading on each new page when printing Brian Excel Discussion (Misc queries) 3 November 15th 06 05:22 PM
printing a document print to fit whilst utilizing the whole page Curves Excel Discussion (Misc queries) 0 June 27th 06 05:56 AM
print heading row on every page Betty Excel Discussion (Misc queries) 5 July 20th 05 11:38 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"