By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,929 Members | 634 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,929 IT Pros & Developers. It's quick & easy.

how to automate outlook 2003

P: n/a
TM
I would like to write a little app in Visual Basic .net as an add-in to
Outlook 2003 so that I can quickly get a list of contact names and email
addresses, then when I click on a name or email address, I want to open a
new mail message to that person.

I don't want to send the message, just open a new blank email so that I can
make it easier to send messages.

Any idea how I could find out more about how to do this ?

Thanks

--
Tony


Nov 20 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Two places..

msdn.microsoft.com/office
for general microsoft office stuff, but for outlook specific...

and here are some code samples using outlook

http://msdn.microsoft.com/library/de...st/outlook.asp

hope it helps.

-CJ
"TM" <no********@nothing.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I would like to write a little app in Visual Basic .net as an add-in to
Outlook 2003 so that I can quickly get a list of contact names and email
addresses, then when I click on a name or email address, I want to open a
new mail message to that person.

I don't want to send the message, just open a new blank email so that I can make it easier to send messages.

Any idea how I could find out more about how to do this ?

Thanks

--
Tony

Nov 20 '05 #2

P: n/a
TM,
In addition to CJ's links the following site has a plethora of articles on
using Outlook from .NET.

http://www.microeye.com/resources/res_outlookvsnet.htm

This site, although not necessarily .NET both of these have a lot of Outlook
programming examples & information:

http://www.outlookcode.com/
http://www.slipstick.com/dev/index.htm

Hope this helps
Jay

"TM" <no********@nothing.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I would like to write a little app in Visual Basic .net as an add-in to
Outlook 2003 so that I can quickly get a list of contact names and email
addresses, then when I click on a name or email address, I want to open a
new mail message to that person.

I don't want to send the message, just open a new blank email so that I can make it easier to send messages.

Any idea how I could find out more about how to do this ?

Thanks

--
Tony

Nov 20 '05 #3

P: n/a
TM
Ok, most of the addin information is way over my head. I was able to find
the code to list the name and email from the contacts collection, but the
sort property is not working and I am getting a security warning when I try
and run the program saying that a program is trying to access email
addresses I have in outlook and do I want to allow this.

First, how can I bypass that warning in Outlook 2003 ?

Here is my sample code. FOr now I am just adding an item to a listbox with
the fileas name and email address so I can see what is going on. I would
like to add these seperately to a datagrid so it looks nicer. Not sure how
to do that but any help is appreciated.

Any idea why the sort is nor working to sort the contacts by FileAs name ?
Dim OutlookApp As New Outlook.Application

Dim OLNameSpace As Outlook.NameSpace

OLNameSpace = OutlookApp.GetNamespace("MAPI")

Dim allContacts As Outlook.MAPIFolder =
OLNameSpace.GetDefaultFolder(Outlook.OlDefaultFold ers.olFolderContacts)

allContacts.Items.Sort("FileAs")

Dim contact As Outlook.ContactItem

Dim cnt As Integer

lblNumberContacts.Text = "Total Contacts: " & allContacts.Items.Count

lstContacts.Items.Clear()

For cnt = 1 To allContacts.Items.Count

contact = allContacts.Items.Item(cnt)

lstContacts.Items.Add(contact.FileAs & " " & contact.Email1Address)

Next

'cleanup

OutlookApp = Nothing

OLNameSpace = Nothing

Thanks all
--
Tony

"TM" <no********@nothing.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I would like to write a little app in Visual Basic .net as an add-in to
Outlook 2003 so that I can quickly get a list of contact names and email
addresses, then when I click on a name or email address, I want to open a
new mail message to that person.

I don't want to send the message, just open a new blank email so that I can make it easier to send messages.

Any idea how I could find out more about how to do this ?

Thanks

--
Tony

Nov 20 '05 #4

P: n/a
TM,
First, how can I bypass that warning in Outlook 2003 ? The warning is there to prevent users from writing viruses, luckily for
Outlook 2003, properly constructed COM-Addins will avoid the warning.

See:
http://msdn.microsoft.com/library/de...scomaddins.asp

Further info can be found at:
http://www.slipstick.com/dev/ol2003problems.htm

The links I gave have samples of creating add-ins.

Both of these are good articles to start with:
http://msdn.microsoft.com/library/de...addinvbnet.asp

http://support.microsoft.com/?kbid=302896

Also, be certain you have explicitly installed the Outlook PIAs!

Hope this helps
Jay

"TM" <no********@nothing.com> wrote in message
news:eX**************@TK2MSFTNGP11.phx.gbl... Ok, most of the addin information is way over my head. I was able to find
the code to list the name and email from the contacts collection, but the
sort property is not working and I am getting a security warning when I try and run the program saying that a program is trying to access email
addresses I have in outlook and do I want to allow this.

First, how can I bypass that warning in Outlook 2003 ?

Here is my sample code. FOr now I am just adding an item to a listbox with the fileas name and email address so I can see what is going on. I would
like to add these seperately to a datagrid so it looks nicer. Not sure how to do that but any help is appreciated.

Any idea why the sort is nor working to sort the contacts by FileAs name ?
Dim OutlookApp As New Outlook.Application

Dim OLNameSpace As Outlook.NameSpace

OLNameSpace = OutlookApp.GetNamespace("MAPI")

Dim allContacts As Outlook.MAPIFolder =
OLNameSpace.GetDefaultFolder(Outlook.OlDefaultFold ers.olFolderContacts)

allContacts.Items.Sort("FileAs")

Dim contact As Outlook.ContactItem

Dim cnt As Integer

lblNumberContacts.Text = "Total Contacts: " & allContacts.Items.Count

lstContacts.Items.Clear()

For cnt = 1 To allContacts.Items.Count

contact = allContacts.Items.Item(cnt)

lstContacts.Items.Add(contact.FileAs & " " & contact.Email1Address)

Next

'cleanup

OutlookApp = Nothing

OLNameSpace = Nothing

Thanks all
--
Tony

"TM" <no********@nothing.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I would like to write a little app in Visual Basic .net as an add-in to
Outlook 2003 so that I can quickly get a list of contact names and email
addresses, then when I click on a name or email address, I want to open a new mail message to that person.

I don't want to send the message, just open a new blank email so that I

can
make it easier to send messages.

Any idea how I could find out more about how to do this ?

Thanks

--
Tony


Nov 20 '05 #5

P: n/a
TM
That is very interesting although it does not explain why the sort property
of the contacts folder is not working

--
Tony

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
TM,
First, how can I bypass that warning in Outlook 2003 ? The warning is there to prevent users from writing viruses, luckily for
Outlook 2003, properly constructed COM-Addins will avoid the warning.

See:

http://msdn.microsoft.com/library/de...scomaddins.asp
Further info can be found at:
http://www.slipstick.com/dev/ol2003problems.htm

The links I gave have samples of creating add-ins.

Both of these are good articles to start with:
http://msdn.microsoft.com/library/de...addinvbnet.asp
http://support.microsoft.com/?kbid=302896

Also, be certain you have explicitly installed the Outlook PIAs!

Hope this helps
Jay

"TM" <no********@nothing.com> wrote in message
news:eX**************@TK2MSFTNGP11.phx.gbl...
Ok, most of the addin information is way over my head. I was able to find
the code to list the name and email from the contacts collection, but the sort property is not working and I am getting a security warning when I try
and run the program saying that a program is trying to access email
addresses I have in outlook and do I want to allow this.

First, how can I bypass that warning in Outlook 2003 ?

Here is my sample code. FOr now I am just adding an item to a listbox

with
the fileas name and email address so I can see what is going on. I would like to add these seperately to a datagrid so it looks nicer. Not sure

how
to do that but any help is appreciated.

Any idea why the sort is nor working to sort the contacts by FileAs name ?

Dim OutlookApp As New Outlook.Application

Dim OLNameSpace As Outlook.NameSpace

OLNameSpace = OutlookApp.GetNamespace("MAPI")

Dim allContacts As Outlook.MAPIFolder =
OLNameSpace.GetDefaultFolder(Outlook.OlDefaultFold ers.olFolderContacts)

allContacts.Items.Sort("FileAs")

Dim contact As Outlook.ContactItem

Dim cnt As Integer

lblNumberContacts.Text = "Total Contacts: " & allContacts.Items.Count

lstContacts.Items.Clear()

For cnt = 1 To allContacts.Items.Count

contact = allContacts.Items.Item(cnt)

lstContacts.Items.Add(contact.FileAs & " " & contact.Email1Address)

Next

'cleanup

OutlookApp = Nothing

OLNameSpace = Nothing

Thanks all
--
Tony

"TM" <no********@nothing.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I would like to write a little app in Visual Basic .net as an add-in to Outlook 2003 so that I can quickly get a list of contact names and email addresses, then when I click on a name or email address, I want to
open a new mail message to that person.

I don't want to send the message, just open a new blank email so that

I can
make it easier to send messages.

Any idea how I could find out more about how to do this ?

Thanks

--
Tony



Nov 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.