Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Outlook & VBScript - Getting Email Addresses


Hi,Does anyone know how I can access outlook's SMTP addresses using the object Outlook.Application?This is my current code:Function GlobalAddrLstNames() Dim objNameSpc as NameSpace Dim objGlobalAddLst Dim objAddrEntry as AddressEntry Dim strList Dim objOutlook set objOutlook = RecupererObjetApplication("Outlook.Application") set objNameSpc = objOutlook.GetNamespace("MAPI") set objGlobalAddLst = objNameSpc.AddressLists("Global Address List") strList = "" for Each objAddrEntry In objGlobalAddLst.AddressEntries strList = strList + objAddrEntry.Name + ";" + vbCrLf next strList = Left(strList, len(strList) - 1) GlobalAddrLstNames = strListEnd FunctionFunction RecupererObjetApplication(strClasse) on error resume next set RecupererObjetApplication = GetObject(, strClasse) If Err.Number <> 0 then set RecupererObjetApplication = CreateObject(strClasse) Err.Clear End IfEnd FunctionThat does work, in my simple project, it gives me the NAME in my address book, but not the SMTP email addresse.. Technically, I'd like to have both to be able to email somebody using CDONTS and the SMTP service of IIS 4.0 as I'm doing right now, except I have to enter the email address manually, and I would like to automate this task.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Reading Email Addresses From Outlook
Dear Outlook users,

Is there any possibility to get, via VB6.0, the email addresses out of outlook?
If yes can someone give me please source.

Nice regards,

Michelle.

Email Addresses, From A Query, To A String, To Outlook
Basically, I'm trying to write a loop that takes all of the email addresses in the CaseWorkerName column of the Diane query and compiles them into a string with ";"'s in between before sending to outlook.

I haven't been able to get very far because whenever I try to run my code, it says "User defined type not defined" for the line "Dim dbs As Database" This is the line everyone seems to use though in the code that I find on the internet. What am I doing wrong?

Right now i have the code linked to a button on a form for testing purposes but eventually it will be something that runs when the database is opened.

Also, would the following line work if Diane is a query and not a table?

Set rst = dbs.OpenRecordset("SELECT [Diane].[CaseWorkerName] FROM [Diane]")

I'm using Access 2000 SR-1 Any help would be much appreciated.

Here's the section of code that I'm working on:

Dim dbs As Database
Dim rst As DAO.Recordset
mailto = ""

Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("SELECT [Diane].[CaseWorkerName] FROM [Diane]")

If Not rst.EOF Then
rst.MoveFirst
While Not rst.EOF
mailto = mailto & rst![CaseWorkerName] & ";"
rst.MoveNext
Wend
End If

Set rst = Nothing

DoCmd.SendObject acSendReport, "Due Next Week", acFormatHTML, mailto, mailcc, , mailsubject, mailtext, -1

Grabbing Email Addresses OFF Of Outlook Emails???
I have thousands of emails here at work in Outlook 2000. In the actual body of the message are email addresses that are very important for us to include into a database.

How then can I open each email and parse out the addresses AND how can I grab the sender's email as well?

Thanks

How To Extract Email Addresses From Outlook Express?
I have hundreds of old emails in a folder in my Outlook Express. I need to write a quick program in VB that will scan this folder, read the emails and then copy each and every email address to a text file.

Anybody have code to do this?
Thanks again!

Extracting Email Addresses
i have a couple thousand emails that have been returned to my inbox as undeliverable. i need to extract the email address that is in the body of the returned email and then send it to an access database. i've done all of this except extracting the email address. i have the body assigned to the string 'emailbody'. but how do i create a substring that contains the email address? any help would be great.

Add Email Addresses To String??
How do I add two emails to this? vonoven@hotmail.com and geo7t@hotmail.com


VB Code:
varTo = DLookup("[strRAemail]", "tblSquadrons", stWhere)


I then use this string for my emails To: box


VB Code:
DoCmd.SendObject , , acFormatTXT, varTo, , , stSubject, stText, 0

Retrieving Email Addresses
Does anyone know how to retrieve the Recipients Email address from Outlook using VB?

How Can I Validate Email Addresses With CDO?
I use CDO to send shipment notification emails to customers for orders that have shipped, the typical email you would receive if you order anything online. There is no problem with sending emails.
The issue I have is that sometimes the email addresses are wrong or invalid, and CDO does not provide information on invalid email addresses - unless I am missing something.
What we would like to do is validate the email addresses somehow and create an exception list.
At this stage I am trying to figure out what the next step would be, so any suggestions are welcome.

Getting Email Addresses From Exchange
Hi Everyone

I'm using VB6 and I need to get email addresses & Names from our Email Exchange server.

Can anyone assist with code?

Regards
Lorna

Validate Email Addresses
How do I validate email addresses (not only checking the syntax of the email address inputted, but also to check it against their provider to see if the email address is actually valid) with the use of SMTP server or MX record?

Parsing Email Addresses In A Message...HOW?
Hello,

I hope you can help me with this as I am stuck with it.

I'm trying to know the recipients of a message received by a mail server. I could get hold of the message (as a file and as HEADER VALUES, which includes the TO and CC fields..).. the idea is.. I'm trying to split those addresses.. but there is no specifica format.. like some mail services add <name@address.com> while others name@address.com... others even put the name "Name Here" <name@domain.com> .... I could parse it when it is ONLY ONE ADDRESS.. but what if MORE THAN ONE ADDRESS??

Example:


Code:
"Name1 Goes Here" <name1@address.com>, "Name2 Goes Here" name2@address.com, <name3@address.com>, name4@address.com


See there is no specific shape... even some might put " ; " instead of " , "

I thought maybe I can suppose whats between the quotations " " is the name.... but then I thought that maybe the sender might put a name like "NAME ONE GOES" HERE" so then we have three quotations.. this will be a problem for parsing as which one is the ending of Name...

Is there any type of ready made function in VB or a method to easily split those addresses and know the names of the people (if it was mentioned near the address "Name1 Goes Here" )?? The way the mail clients do it.. how? how do they parse the addresses and know each one separately?

Any suggestions or examples?

THANKS alot in advance!

Labels With Hyperlinks And Email Addresses
Does anyone no how to make a label which will make the users using the program able to click on a link which will load there outlook up. Or a hyperlink

How To Check The Email Addresses Existence
Hi

How to check the existence of an eMail Address?
Is that a way to ping the mail id??
NOT THE VALIDATION OF THE EMAIL ADDRESS
Karthik

Recognizing URL’s And Email Addresses
Hi I am doing a project and need to add some web functionality in, my problem is that I have lots textboxes where the  user can input what they want, I need to recognise if that text is a url or email address and then turn it blue, same way as it does in work or outlook. And then launch the website or email.

Thought about:
    If InStr(txtnotes, "http://") Or InStr(txtnotes, "www.") Then

But I am sure there must be a better way of doing this and it cant be that difficult can it???

Any Ideas

Thanks


Email Addresses And Text Boxes?
Is there a way to setup a text box that is bound to a filed in an acess database that when a user clicks on the email address it opens outlook to send an email to that person. Kinda like a hyperlink to Outlook or other email program.

Outlook Addresses In Vb
How to access the addresses stored in MS-Outlook Address book from within visual basic code?

Parsing Email Addresses From A Text File
I have developed a complicated parsing routine in Words VBA to add field delimiters to a text file. The VBA routine has evolved with the dataset Now, the dataset has changed on me and my email routine no longer performs.

The previous method would replace multiple spaces with a tab character inherently before email addresses in my text file. Then a find and replace routine would insert the email header in conjunction with the tab character and the @ symbol. See below.

Now, the email addresses are preceded by one space. The find and replace routine can not perform a wildcard adjacent to a space. It picks up every space before the @ symbol.

Let me know if you have any ideas for my parsing routine within Word. My database routines work in conjunction with my Word routine, so I rather not go to another script language.



Code:
With Selection.Find
.Text = "^t*^064"
.Replacement.Text = "^pEMAIL:^&"
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = "EMAIL:^t"
.Replacement.Text = "EMAIL:"
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
+++++++++++
SAMPLE DATA
+++++++++++

ADDR:13425 Ventura Boulevard, # 301 Sherman Oaks, CA 91423 kellyg@xyzfilms.com

Linking MS Access To MS Exchange - Email Addresses
I have an Access 2000 database which has a linked table to our Global Address book from Microsoft Exchange. The problem I have is that it displays the email address as type EX, not SMTP. I want to produce a report of every contact and write their details to Excel, including their email address. At the moment the email address displayed in Excel does not make any sense. How can I convert the email address from type EX to SMTP for the purpose of the report, and can it be done using VBA in Access. Any thoughts would be much appreciated.

Checking Email Addresses Exist Before Sending Them
I was just wondering if there is anyway that I can check whether or not a the email host exists before I send emails. I am currently writing a system that will send a large number of emails (not spam) and don't want the system to waste valuable processing time sending emails to host that don't exist.

If somebody can help it would be most helpful.

How To Use RegExp To Find All Email Addresses In A String
Hi Guys,

How can I do this. Please help

Looking For A Nice Looking Way To Collect Names And Email-addresses
I wonder if there exists an application or programma with only 2 open boxes on the screen, one to fill in for example your name and one to fill in your email address. The idea is that you can run such an application or programme on a laptop so that each visitor of that laptop (for example on a stand of an Exhibition, so the apllication is not run on internet) can fill in his name and email address, that should be added (automatically) to an Excel of Access-file or any other databse.
I heard it can be done with VB but I'm normally working in HTML and have never done anything in VB. Are there any already made scripts I could use for this?

Kippie

MsgBox With Addresses In Outlook
Hi!

I want Outlook to confirm all email messages with a msgBox witch contains all e-mail addresses (SMTP) where the email is being sent. I kind of managed it, but I didn't get it to show SMTP addresses, since MS doesnt want scripts to see SMTP addresses (Big security risc).

I have read that You can override it with Redemtion. Can anyone please show how can i make the following script work with redemtion and SMTP addresses:


Code:

Private Sub Application_ItemSend(ByVal item As Object, Cancel As Boolean)
addresses = "Sending e-mail to:" + vbNewLine


If Not item.To = "" Then
addresses = addresses + item.To + "; "
End If


If Not item.CC = "" Then
addresses = addresses + item.CC + "; "
End If

If Not item.BCC = "" Then
addresses = addresses + item.BCC + "; "
End If

msg = MsgBox(addresses, vbYesNo, "Check your recipients: ")

If msg = vbYes Then
Item_Send = True
Else
Item_Send = False
Cancel = True
End If

End Sub

How To Get A Group Addresses From Outlook
Hello,
I created a group for only the people who will receive a report from me. Could anyone tell me know how to get a group address from outlook(2003)?? thanks.

sherry

Importing Addresses From Outlook (Express)
Hi!

I'd like to let user to import addresses (contacts) from Outlook (Express). Is it possible to import it directly from Outlook or must they first be exported to CSV file (or some other)?

Also, what is the easiest way to import data from CSV file?


Thanks so much,
Bostjan

Read Addresses In Outlook Express 6
Hi,

I need to read all the addresses in outlook express 6.
I want it to be done programatically.

Any help is appreciated.

Thanks,
Pradeep

E-mail Addresses From Outlook Or Exchange
Hello VB folks. I am new to VB from C++ and I need to connect to an exchange server and get all of the e-mail addresses from a Global Address Book [GAB] I know it is possible, i just don't know how. If anyone has some VB code that does this I would be very grateful.. Thank you in advance.

regards,
alan rencher

{ Resolved }Export Outlook/express Addresses
Hi- I'm a decent VBscript ASP developer, but have no experience with either VB.net or VB.

A client has asked us to create an automated system for exporting the user's address list from Outlook and Outlook Express to a webmail application. I understand that its probably fairly complex for a beginner, but I am willing ( and eager! ) to learn.

I have found a couple of code snippets using the search facility, and would like some advice: I am unsure of how to go about the creation of the tool. I'd imagine either a downloaded .exe - like the one from http://www.plaxo.com- or an activeX componant. Any suggestions?





Edited by - scudsucker on 4/28/2004 7:25:32 AM

Extract E-mail Addresses Form Outlook 2002 Via VBA
Hi,

I'm trying to write VBA code to iterate all folders and extract the senderemailaddress (not the sendername). I have Outlook version 2002 which does not support senderemailaddress.

Please help.

Thank You,

Chaim Bochner

Complete / Update Addresses In Outlook (contacts) From An VB6 Application ?
Hi - I'm new in the forum - pls excuse my limited English (German !)

I was able to install code into my VB6 application to send an email plus attachment into / through Outlook.
Although the email was received with the recipient, outlook shows a message: " ... some or none recipients may not have received the email ...".

The reason I found is, that the address was not stored in the file "contacts" of Outlook.

Question: How can I check (and update) wether the recpient's address is stored in contacts ? I have all my clients addresses in my access customer master !

Can somebody help - thanks in advance - lupo

COM - Outlook 2003 : Giving Prob : A Program Is Trying To Access E-mail Addresses You Have
hi,
    iam creating a com addin for outlook,which creates a tool bar in outlook,

when u click on the button of my tool bar it will show the email id of currently

selected mail in message box

its working well, but it outlook 2003 its giving problem, its giving error

message
            "a program is trying to access e-mail addresses you have stored in

outlook

iam using references :
    micosoft outlook 9.0 object library
    micosoft office 9.0 object library
code is:
Set oMsg = Application.ActiveExplorer.Selection.Item(1)
                name = Trim(oMsg.SenderName)
                EmailId = Trim(oMsg.Reply.Recipients.Item(1).address)

how to avoid the message box please help me

Trigger VB App To Run When Outlook Email Received? Can VB App Read Email From Inbox?
Is it possible for a VB application to be triggered to run when a new email message is received in an Outlook Inbox?

Furthermore, can a VB application read in the subject and message body on an email directly from Outlook's Inbox?

Thanks for your help!!

How Do I Send An Email Thru Outlook 98 Whitout Needing To Have Outlook Running?
Does anyone know how to send an email without needing Outlook running?
I have written this code, which works fine when Outlook is running on my machine, but when Outlook is not running I get a MVB error (see attachment mvberror.jpg). When I hit debug it returns me to; Set ObjOutlookMsg = objOutlook.CreateItem(olMailItem). I cant be having this, please help.

CODE:

Dim response
response = MsgBox("Do you want to send a message to Bev telling her you made a copy of " & lstfiles.FileName, vbYesNo, "STOP")
If response = vbYes Then
Dim objOutlook As New Outlook.Application
Dim ObjOutlookMsg As Outlook.MailItem

Set ObjOutlookMsg = objOutlook.CreateItem(olMailItem)
With ObjOutlookMsg
.To = "user@here.com"
.Subject = "test"
.Body = "Bev, " & vbNewLine
.Body = .Body & "I made a copy of drawing number: ** " & lstfiles.FileName
.Body = .Body & " **, from the Bravo folder. " & vbNewLine & vbNewLine
.Body = .Body & "Thanks"
.Send
End With

Set ObjOutlookMsg = Nothing
Set objOutlook = Nothing




Any help would be greatly appreciated,

Thanks in advance,
el guapo

VBScript Email
How would you send an email to "visualblind@onebox.com" in vbscipt? if you could, just provide the function so I can ad it into a button, thanks.

http://visualblind.tsx.org

"Can you execute code, if there is nobody to write it?"

How To Load Email From MS Outlook Or Outlook Express To VB Application?
I need to create an application, that downloads emails from MS Outlook and Outlook Express, edits the email, and sends the results back.

Can someone atleast direct me to where i should look for more info on this?

Thanks

Send Email With VBScript - PROBLEMS!
Hi!
I am using winsock to send email over SMTP. I have a problem.

When i send email over SMTP i send this DATA:

****************************************************

Subject: My Subject
To: user01@test.com
From: admin@test.si
MIME-Version: 1.0
Content-Type: text/html;
charset="iso-8859-1"
<HTML>
<BODY>
<P>
<B>This is the HTML body of the message.</B>
<P>

<SCRIPT language="VBScript">
Sub Execute()
MsgBox "Hello!",vbOkOnly
End Sub
</SCRIPT>


<FORM>
<input id="x" type="button" value="Press!" onClick="vbscript:Execute()">
</FORM>

<P>

</BODY>
</HTML>

***************************************************


i recive in my mail this source:
****************************************************
<HTML>
<BODY>
<P>
<B>This is the HTML body of the message.</B>
<P>



<FORM>
<input id="x" type="button" value="Press!" onClick="vbscript:Execute()">
</FORM>

<P>

</BODY>
</HTML>
****************************************************


I don't know why but smtp CUT me the SCRIPT tag!


Anyone can help me.



I am trying to send an email with buttons which open applications that i installed.


I am using VB6!

Please Help :Sending Auto-email Using VBScript
Hi All,

In my project I have requirement to send an auto-email on script failure. I have written the following code in VBscript to do that but I am not receiving any email. Also I am not getting any error:
Note: I am using local IIS SMTP server to send an email.

Function SendMail()
Set objMessage = CreateObject("CDO.Message")
'objMessage.Configuration.Load cdoIIS
objMessage.Subject = "Example CDO Message"
objMessage.From = "test4@gmail.com"
objMessage.To = "test34@gmail.com"
objMessage.CC = "test2@gmail.com"
objMessage.BCC="test1@gmail.com"
objMessage.TextBody = "This is some sample message text. with local IIS"


objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "Localhost" 'Modify to your SMTP Server Address
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objMessage.Configuration.Fields.Update


objMessage.Send
End Function

Note: I am seeing my emails in 'Badmail' folder of IIS SMTP. so looks like Code is doing its job but IIS SMTP fails to deliver the email. Please let me know if I need to configure my local IIS SMTP server.

Please help. Thanks in advance.

Save Email From Outlook And Outlook Express
How can I save all email to text files in a specific folder in outlook or outlook express?

Trying To Retrieve Email Address From Log Folder (VbScript)
Hello, I'm trying to retrieve a customers email address for a log folder by searching the log files for a string. I'm getting an error with oFile.ReadAll here is the script.

Option Explicit

Dim dicEmailAddresses
Dim strLogFolder
Dim strEmail

strLogFolder = "C:Program FilesSpare BackupLogs"
Set dicEmailAddresses = GetEmailAddressesFromLogs(strLogFolder)

For Each strEmail In dicEmailAddresses.Keys()
WScript.Echo strEmail
Next

Function GetEmailAddressesFromLogs(StrSource)
Dim oFSO
Set oFSO = CreateObject("Scripting.FileSystemObject")
Dim oFolder
Dim strLine
Dim dicResults
Dim strEmail
Dim oFile
Set oFile = oFSO.GetFolder(strLogFolder)


Set dicResults = CreateObject("Scripting.Dictionary")
For Each oFile In oFSO.GetFolder(strSource).Files
For Each strLine In Split(oFile.ReadAll(), VbCrLf)
If InStr(strLine, "INFO: Logging in ") > 1 Then
strEmail = Split(strLine, "INFO: Logging in ")(1)
If Not dicResults.Exists(strEmail) Then
dicResults.Add strEmail, ""
End If
End If
Next
Next

Set GetEmailAddressesFromLogs = dicResults
End Function

This is the line that errors.
For Each strLine In Split(oFile.ReadAll(), VbCrLf)
What am I missing here? Thanks in advance.

VBscript Sending 2 Separate Email In The Same Execute
Hi, I need Help Please!
The code works to send one mail with one html message.
But now i want to send another mail on the same execute!
Send mail works fine:(First Email) but when i include the second email code it sends successfully but it has both HTML messages (HTMLBody) in
"test Message2" for only the second email.
'FIRST EMAIL

SMTPServer = "srv08-za004"

From = " email@removed "

GenericSendmail SMTPserver, From, Recipient, Subject, Message

Sub GenericSendmail (SMTPserver, From, Recipient, Subject, Message)

set msg = CreateObject("CDO.Message")

msg.From = " email@removed "

msg.To = " email@removed "

msg.Subject = 'Subject"

msg.HTMLBody = "test"

msg.Configuration.Fields ("http://schemas.microsoft.com/cdo/configuration/s mtpserver") = SMTPServer

msg.Configuration.Fields("http://schemas.microsoft. com/cdo/configuration/sendusing") = 2

msg.Configuration.Fields.Update

msg.Send

End Sub
'Now I'm trying to send another one SECOND EMAIL

SMTPServer2 = "srv08-za004"

From2 = " email@removed "

GenericSendmail SMTPserver2, From2, Recipient2, Subject2, Message2

Sub GenericSendmail (SMTPserver, From2, Recipient2, Subject2, Message2)

set msg2 = CreateObject("CDO.Message")

msg2.From = " email@removed "

msg2.To = " email@removed "

msg2.Subject = "Subject2"

msg2.HTMLBody = "Message2"

msg2.Configuration.Fields ("http://schemas.microsoft.com/cdo/configuration/s mtpserver") = SMTPServer2

msg2.Configuration.Fields("http://schemas.microsoft .com/cdo/configuration/sendusing") = 2

msg2.Configuration.Fields.Update

msg2.Send

End Sub
Please Assist!
Regards,

Access 97 Auto Email How To Write VBScript In VBA
I've set up an email function in an access database, The email is compiled by using VBA to write HTML code to Outlook 2002 using the built in Outlook commands.

Everything works fine so far, but I would like to include some simple VBScript to allow the user to select an option (in this case accept or decline the date/time specified) and email the response back...

The problem is that in VBA you have to write HTML continuously, enclosed in quotes. But VBScript uses a newline between code instructions, does anyone know if there is a newline character I can write into the vba code so I can write VBScript in this manner.

See below for an example of some HTML written in VBA.

****
Sub helloWorld()

dim OutApp as Object
dim OutMail as Object

Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.createitem(0)

dim exampleVariable As String

exampleVariable = "<HTML><head><title><p>Hello world</p></title></head><body><p>Please select the option below and click 'send response'</p><p><SCRIPT LANGUAGE="VBScript">'Code Goes Here'</SCRIPT></body></HTML>"

OutMail.To = "first.last@somewhere.com"
OutMail.Subject = "Hello World!"
OutMail.HTMLBody = exampleVariable

OutMail.Display

Set OutMail = Nothing

End Sub

****

Please can someone let me know if this is even possible or what the alternative is.

Thanks,

J  

How Can I Read Exchange Email Inbox Using Vbscript?
I need to monitor an inbox for incoming messages and read the contents of the emails on an Exchange server platform. I'm having a hard time finding a solution.

VBscript Sending 2 Separate Email In The Same Execute
Hi, I need Help Please!

The code works to send one mail with one html message.
But now i want to send another mail on the same execute!
Send mail works fineFirst Email) but when i include the second email code it sends successfully but it has both HTML messages (HTMLBody) in
"test Message2" for only the second email.


Code:

'FIRST EMAIL
SMTPServer = "srv08-za004"
From = "Process@parmalat.co.za"
GenericSendmail SMTPserver, From, Recipient, Subject, Message
Sub GenericSendmail (SMTPserver, From, Recipient, Subject, Message)
set msg = CreateObject("CDO.Message")
msg.From = "ismailc@parmalat.co.za"
msg.To = "ismailc@parmalat.co.za"
msg.Subject = 'Subject"
msg.HTMLBody = "test"
msg.Configuration.Fields ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = SMTPServer
msg.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
msg.Configuration.Fields.Update
msg.Send
End Sub

'Now I'm trying to send another one SECOND EMAIL
SMTPServer2 = "srv08-za004"
From2 = "Process@parmalat.co.za"
GenericSendmail SMTPserver2, From2, Recipient2, Subject2, Message2
Sub GenericSendmail (SMTPserver, From2, Recipient2, Subject2, Message2)
set msg2 = CreateObject("CDO.Message")
msg2.From = "ismailc@parmalat.co.za"
msg2.To = "ismailc@parmalat.co.za"
msg2.Subject = "Subject2"
msg2.HTMLBody = "Message2"
msg2.Configuration.Fields ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = SMTPServer2
msg2.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
msg2.Configuration.Fields.Update
msg2.Send
End Sub



Please Assist!
Regards,

VBScript And Outlook
I am creating a form in Outlook for Supervisors to use when requesting stuff.

I I have a textbox named txtLogInID, how do I access that in the VBScript code editor?

I tried txtLogInID.Text and it said that 'txtLogInID' does not exist...

Any ideas?

Outlook Vbscript List Box
hey, pls healp, i want my code to scan through my listbox, how do i actually reference the list starting from the first item? also i want to do it in vbscript since the lsitbox will be on an outlook form...thanks

Create Outlook Task VBScript On The Web
I am trying to Create an Outlook Task over a webpage..
I have an example - www.revonex.com/tasks.html
You can look at the source code. When I save it to my local drive it works fine, but when I try to run it from there I get an error...

Here is the code - any suggestions??

<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
</HEAD>
<BODY>
<FORM NAME="frmTask">
<INPUT TYPE="Button" NAME="cmdClickMe" VALUE="Click Me" STYLE="WIDTH: 185px; HEIGHT: 42px" SIZE=63>
<SCRIPT FOR="cmdClickMe" EVENT="onClick" LANGUAGE="VBScript">
Dim objOutlook
Dim itmTask
Dim datDue
Dim strMsg
Dim strMsg1


Set objOutlook = CreateObject("Outlook.Application")
Set itmTask = objOutlook.CreateItem(3)


' Query the User for a Subject

itmTask.Subject = InputBox("Enter the task subject:", "Subject")

' Query the user for the Body Text

itmTask.Body = InputBox("Enter the task body text:", "Body")

' Handle case if/when user supplies no Subject. Assume user is
' aborting his request to create a new task.

If Len(itmTask.Subject) = 0 Then
' User hit Cancel or didn't type any text
' There is no task to save
strMsg = "No Task information provied." & vbcrlf & vbcrlf & "Operation aborted by user."
MsgBox strMsg, ,"Aborted"
Else

' Query user for Due Date

datDue = InputBox("Enter the due date:", "Due Date",Date())

If datDue <> "" Then
itmTask.DueDate = datDue
End if

itmTask.save
strMsg1 = "Your task has been saved."
MsgBox strMsg1, ,"Success!"

End If


' Clean up

Set itmTask = Nothing
set objOutlook = Nothing


</SCRIPT>
</FORM>
</BODY>
</HTML>

Reference Microsoft Outlook Via Vbscript
Is there anyway to make a reference to Microsoft Outlook Object Library using vbscript in notepad. I am not running visual studio and cannot make a reference via the normal avenues.

Thanks

Outlook VbScript Detect PropertyChange And Get Old Value
Hello,
I'm currently programming an outlook contactForm. If a user changes a property (custom property or outlook property), I would like to detect the change and write the old and the new values to a file. With the functions Item_propertyChange and Item_CustomPropertyChange it is no problem to detect changes. But when these functions are called I only can read out the new values the user has just set. I checked the internet nearly the whole day long but I couldn't find out how to access the old values (i.e. the values before the user changed the property and Item_propertyChange was called). But somehow the old values have to be around somewhere, because if you choose not to save changes to old values (I would like to access) are restored.

I would be very grateful for any kind of help
thank you very much
Clive

VBScript - Close Outlook If Already Opened
I'm getting so frustrated....Can someone tell me how to close Outlook if already opened using vbscript? Here is my current code. If Outlook is open already, I would like it to close and reopen after the registry update.

Dim otl
Set otl = Nothing
Dim oShell
Set oShell = CreateObject("WScript.Shell")
on error resume next
Set otl = getobject("outlook.application")
on error goto 0
If otl is nothing Then
'not running
oShell.Run("regedit /s " & "H:publicpmtoff.reg")
oShell.Run("regedit /s " & "H:publicpmt.reg")
oShell.Run("Outlook")
Else
'running
End If

Set otl = Nothing
Set oShell = Nothing

Using Outlook's Check Names Via VBScript
I'm trying to write a simple vbscript function taking a string of names and then using Microsoft Outlook's check names feature to resolve the respective e-mail addresses. Currently the closest I've come to accomplishing this is to create a new mail message, assign the name I want resolved to the recipient field and resolve the address. Unfortunately, I cannot figure out how to access the resolved e-mail address to determine what it is. Also, this approach does not bring up Outlook's check names window. Because of this, if the recipient name specified is ambiguous the address fails to be resolved. Ideally I'd like the check names window to show up and give the user a choice. If anyone knows how to do this, I'd be most appreciative. Here's my code in case it helps:


Code:

Function ResolveAddress(sName)
Dim objOutlook
Dim objMessage
Dim bResolved

bResolved = False

'Create a new instance of word Application
Set objOutlook = CreateObject("Outlook.Application")
if err.number <> 0 then
msgbox("Error: Unable to access MS Outlook")
ResolveAddress = sName
exit function
end if

'I thought maybe this would help Check Names dialog showup
objOutlook.WindowState = 2
objOutlook.Visible = True

Set objMessage = objOutlook.CreateItem(olMailItem)
objMessage.Recipients.Add sName
bResolved = objMessage.Recipients.ResolveAll

If bResolved Then
MsgBox("Resolved!")
Else
MsgBox("Not Resolved")
End If
End Function


Thanks for the read
-Chad

Copyright 2005-08 www.BigResource.com, All rights reserved