From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Barker-Lacerda , Michelle
Sent: Wednesday, May 05, 2004 11:43 AM
To: [EMAIL PROTECTED] COM ([EMAIL PROTECTED])
Subject: [Talk] Outlook Script
Hi,
Has anyone
been able to get a script to send an email from MS Outlook 2k2 running on an
Exchange Server 2k? I know there's been a lot of talk about sending emails via a
script, and I was able to use the code snippet from the archives, but I can't
get the script to deal with the security warning from Outlook. I've tried using
Activate "caption" but BWS never gets past the .Send command. If I try to step
through the script debugging it, when I get to the point that the Outlook
warning message comes up I get the BSS65 message below (An action cannot be
completed because a component (Inbox - Microsoft Outlook) is not responding.
Choose "Switch To" to activate the component and correct the
problem.)
<<...OLE_Obj...>>
Dim strFile, strRec, strCount,
strEmail As String
Dim F As
Integer
Sub SendEmail()
Dim olApp, olItem As Object
Dim strFile, strRec, strEmail,
strDoctor As String
Dim F As
Integer
F = FreeFile
strFile = "C:\queued.prn"
Open strFile For Input As F
Do Until EOF(F)
Line Input #F, strRec
strEmail =
Trim$(Mid(strRec, 27, 30))
strCount = Trim$(Mid(strRec, 1, 2))
Set olApp =
CreateObject("Outlook.Application")
Set olItem = olApp.CreateItem(0)
With
olItem
.To = strEmail
.Subject = "You have documents
to sign"
.Body = "You have documents
ready to sign in your E-Signature Queue."
.Send
Activate "Microsoft
Outlook"
Tab_ ""
Tab_ ""
Enter
End With
Loop
Set olApp = Nothing
Set olItem = Nothing
End Sub
Thanks
Michelle
617-665-3432
617-546-7770 pgr.
Clinical
Application Analyst
CHA Information
Technology
[EMAIL PROTECTED]
