PC Review


Reply
Thread Tools Rate Thread

how to automate outlook 2003

 
 
TM
Guest
Posts: n/a
 
      9th Dec 2003
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




 
Reply With Quote
 
 
 
 
CJ Taylor
Guest
Posts: n/a
 
      9th Dec 2003
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" <nospam-(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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
>
>
>
>



 
Reply With Quote
 
Jay B. Harlow [MVP - Outlook]
Guest
Posts: n/a
 
      9th Dec 2003
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" <nospam-(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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
>
>
>
>



 
Reply With Quote
 
TM
Guest
Posts: n/a
 
      10th Dec 2003
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.OlDefaultFolders.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" <nospam-(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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
>
>
>
>



 
Reply With Quote
 
Jay B. Harlow [MVP - Outlook]
Guest
Posts: n/a
 
      10th Dec 2003
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" <nospam-(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.OlDefaultFolders.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" <nospam-(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> > 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
> >
> >
> >
> >

>
>



 
Reply With Quote
 
TM
Guest
Posts: n/a
 
      10th Dec 2003
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]" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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" <nospam-(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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.OlDefaultFolders.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" <nospam-(E-Mail Removed)> wrote in message
> > news:%(E-Mail Removed)...
> > > 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
> > >
> > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to automate user profiles in Outlook 2003 =?Utf-8?B?QWxleA==?= Microsoft Outlook 1 11th Apr 2006 03:05 AM
Automate emailing attachements using Access 2003 and Outlook 2003 =?Utf-8?B?Q3JhaWc=?= Microsoft Access 1 1st Apr 2005 12:17 AM
Looking for a way to automate some tasks in Outlook 2003 Milhouse Van Houten Microsoft Outlook 3 15th Jan 2005 09:58 PM
How do I automate Calendar Web Publishing in Outlook 2003? =?Utf-8?B?RHJpZnRlcg==?= Microsoft Outlook Calendar 3 14th Dec 2004 10:41 PM
Automate Shutdown of Outlook 2003 =?Utf-8?B?Q1NTQVVT?= Microsoft Outlook Discussion 1 8th Oct 2004 08:56 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:20 AM.