...

View Full Version : Sending mail with VBSCRIPT problem



Toc666
08-27-2008, 09:38 PM
i'm using this script to automatically send a mail

Sub SendMailOutlook(aTo, Subject, TextBody, aFrom)

Dim Outlook 'As New Outlook.Application
Set Outlook = CreateObject("Outlook.Application")

Dim Message 'As Outlook.MailItem
Set Message = Outlook.CreateItem(olMailItem)
With Message
.Subject = Subject
.HTMLBody = TextBody
.Recipients.Add (aTo)
Const olOriginator = 0
.Send
End With
End Sub

i'm using the Active directory to send mail, the problem is when i enter a name to the Sub, if the name (such as John) is common and has more then one match. the Sub breaks...

is there anyway to tell Outlook to open the name check (Ctrl + K) function?

thank in advance...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum