Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
same heading on each page while printing | Excel Discussion (Misc queries) | |||
can i delete a heading recent document drop down file | New Users to Excel | |||
Printing a heading on each new page when printing | Excel Discussion (Misc queries) | |||
printing a document print to fit whilst utilizing the whole page | Excel Discussion (Misc queries) | |||
print heading row on every page | Excel Discussion (Misc queries) |