Attached is script you are looking for.


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Shawn M. Yeaton
Sent: Friday, October 08, 2004 9:42 AM
To: [EMAIL PROTECTED]
Subject: RE: [Talk] Emailing a log file

William,

 

There’s an example of using the Outlook object on our website under script samples.  Download it and feel free to give me a call with any questions.

 

Shawn M. Yeaton

Technical Support

Boston Software Systems

Direct: 978.921.9037

AIM: BWS Support

 

www.bostonworkstation.com


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of William Bogle
Sent: Friday, October 08, 2004 9:43 AM
To: [EMAIL PROTECTED]
Subject: [Talk] Emailing a log file

 

I am trying to have Boston Workstation email out the log of the file I have processed.  Has anyone done this before and have some code on how to do it.

 

Thanks,

William Bogle
Network Administrator
North Arkansas Regional Medical Center
Office:870.365.2011
eFax:309.415.5194

Confidentiality Notice:  This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed.  The recipient of this information is required to destroy the information after its stated need has been fulfilled.  If you are not the intended recipient of the transmission, or an employee or agent responsible for delivering this transmission to the intended recipient, you must not review, retransmit, convert to hard copy, copy or use this transmission or any attachments transmitted within.  If you have received this transmission in error, have any problems with this transmission, or need additional information, please notify the originator of the message immediately by return email or phone (870) 365-2011 and permanently delete this email.  Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of North Arkansas Regional Medical Center.

 

 


Saint Clare's Health System Confidentiality Notice:

This e-mail and any accompanying documents may be confidential and/or legally privileged. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or the taking of any action in reliance on the contents of this information is strictly prohibited.

If you have received this e-mail in error, please notify the sender immediately by reply e-mail and delete the message and any attachments. Thank you.


 

Sub EmailCaller()
'------- Email Address + Subject ---------
Dim strEmailAddress As String
Dim strSubject As String
Dim strBodyLine As String
Dim strAttachment As String

strEmailAddress = "[EMAIL PROTECTED]"
strSubject = "Med Order Entry Report"
strAttachment = "C:\boston\pharmacy\Rx order entry.xls.log"

'------- Create Message Body -------------
strBodyLine = "This is a message to let you know you got report in mail " & vbCrLf & 
"that saves lots of time."
'the attachment option is optional, you can add a path & filename to be sent
SendEmail strSubject, strBodyLine, strEmailAddress, strAttachment


End Sub
Function SendEmail(pSubject As String, pBodyLine As String, pEmailAddress As String, 
pAttachment As String)
'set an object reference to Microsoft Outlook object
Dim objOutlook As New Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
On Error GoTo err_handler_send_email

' ------- Create new message -------------
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)

With objOutlookMsg
.To = pEmailAddress
.Subject = pSubject
.Body = pBodyLine
If Not Trim(pAttachment) = "" Then
.Attachments.Add pAttachment
End If
'.Display 'to show message
.Send 'to send message
End With

Set objOutlookMsg = Nothing
Set objOutlook = Nothing
Exit Function

err_handler_send_email:
MsgBox Err.Description
End Function

Reply via email to