Automate, but not send

  • Thread starter Thread starter Gary Miller
  • Start date Start date
G

Gary Miller

I have working code that is doing great at automating
sending email from Access, but now I have a reason to
generate the email and attachment, but I want to stop it
with the email window showing to let the user pick the
recipient.

Is this as simple as not populating the 'To' and not coding
'.Send' or would this be a seperate command to display the
email window and leave it open? Outlook 2K.

Gary
 
Maybe. It depends on what the rest of your code looks like -- as in how you're creating the message.
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
Sue,

Thanks for the help. This is what I am doing in integration
with the PDF Mail Pro library from ACG Soft...

' ***********************
Sub SendPDF(rptName As String, rptLoanNum As String,
rptEmail As String, rptSubject As String)

On Error GoTo SendPDF_Error
' Code from the PDF class included in
' PDF Pro Mail Library 10.mde
Dim objPDF As New PDFClass

Dim lngResult As Long

With objPDF
.ReportName = rptName
.ReportWhere = "[LoanNumber] = '" & rptLoanNum & "'"
.OutputFile = "d:\REOSell\" & rptName & ".pdf"
.PDFEngine = 5 'Choose your driver
.PrintImage
lngResult = .Result
End With
DoEvents
' Do Until objPDF.Result = True
' Wail until done
' Loop

Set objPDF = Nothing

' Outlook sending code
Dim i As Integer
Dim Email As String
Dim EBody As String
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim objOutlookAttach As Outlook.Attachment

Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)


EBody = "Please see the following email
attachment from REO World."

'Send email
With objOutlookMsg
Set objOutlookRecip = .Recipients.Add(rptEmail)
objOutlookRecip.Type = olTo
.Subject = rptSubject
.Body = EBody

Set objOutlookAttach =
..Attachments.Add("d:\REOSell\" & rptName & ".pdf")

objOutlookMsg.Send

Set objOutlookMsg = Nothing

End With

Set objOutlook = Nothing
'MsgBox "Done."
End Sub
' *****************
--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
Maybe. It depends on what the rest of your code looks
like -- as in how you're creating the message.
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
Perfect. Thanks for the help!

--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
Should be easy: Just replace .Send with .Display.
 
Back
Top