PDA

Click to See Complete Forum and Search --> : Controlling Outlook with VB


clint
Aug 10th, 2000, 08:01 AM
Is there anyone to help me how to sent/open/read outlook 98/2000 messages with VB? Thanks...

SirLee
Aug 10th, 2000, 09:03 AM
Send Mail Through outlook:
Taken from somebody else...

Make a form

Place 3 Text boxes

Place 1 Button

Private Sub cmdSend_Click()
Dim olapp As New Outlook.Application
Dim olMail As Outlook.MailItem

'Create a new mail object form the
'Outlook98 Application object
Set olMail = olapp.CreateItem(olMailItem)

'Set the mail fields of the olMail object
olMail.Subject = txtSubject.Text
olMail.To = txtTo.Text
olMail.Body = txtBody.Text

'Tell Outlook to send this message
olMail.Send

'Be kind to your environment and clean
'up your unused objects
Set olMail = Nothing
Set olapp = Nothing
'--end code block

End Sub

Hope this helps a little.

I have some codeexamples for Reading mails as well just a bit too much code to post here...

clint
Aug 10th, 2000, 09:10 AM
i want to open a message in outlook and make a program to read it. i don't know how to open it with VB. i will use ur codes to send e-mails, thanks a lot.

SirLee
Aug 10th, 2000, 09:15 AM
Do you want some examples emailed?

I have a program which cycles through all emails opens them,
looks for internet email addresses not in the contacts and writes them into contacts.

If you let me know your email I could send it...

clint
Aug 10th, 2000, 09:18 AM
thanks a lot, here is my e-mail addy.
mailto: clint_tr@hotmail.com
or
mailto: nazmi@arcelik.com.tr