Which way should I add an AddressEntry?

MS OFFICE OUTLOOK

    Next

  • 1. Item's events _Read _Open
    Yet another question. when i click item in a folder item's Read event is fired even after i click it again after selecting another event. This is good. But after i open item(doubleclick) some state of item is changed and on next selection of this item Read event not called and cached version of item is displayed. How can i tell to(hmm... Item?, or may be Explorer ) to fire Read events again? And by the way what an "opened" item is? Thanks.
  • 2. MailItem's Forward event
    Hello. The questions are here. This event is fired after message is opened in a "forwarder"(embedded or Word), right? So i can't do something with the message(for example attach to the message). And how to deal with it(there is a need to attach to message dynamically). May be it is strange... And what is the right way to do such thing? Moreover where is event to know that item was forwarded so i can delete that dynamic attachment? Thanks in advance.
  • 3. Custom Form in Web Access
    Hello, outlook experts, I've developed a custom form (with a new tab and some extra fields) and published in the calender folder. The current situation is that it cann't be used in web access. If the user created one appointment with the custom form in outlook and then changed it (like the time) in web access, the appointment will converted back to the standard form. (that means it will lose all the extra fields/information). So my question is how to make the custom form available in web access? regards Lucia
  • 4. problem with "arrange by"
    Hi. Can anyone help with the following problem? It is for Outlook 2003. My addin creates additional folder and custom view for it with additional field of type date. Also, View is customized to sort messages by that field and arrage them in groups, so messages appear sorted by date in groups of date, i.e. all messages appears in groups such as "Date: Today", "Date: Two weeks ago" etc. After selecting this folder my addin retrieves messages that are stored in some place and fills the view with them, all is ok. I implemented custom button "Renew" in menu. On this event addin deletes messages and retrieves them again from the store. After that messages become grouped in the first group, i.e "Date: Two weeks ago"(it is incorrect), and when i click minus sign on any group messages become grouped correctly(transfered in the right group). What might have been missed?
  • 5. send from account not the default
    I have several macros in office 2003 outlook that open a new mail window using different stationery. One of them I want to change the sender so it is not the default account. How can I do that in code rather than always using the drop down menu to change it manually? In case it is relevant the code template I use to create the new mail window is: Dim NewMail As Outlook.MailItem Dim objFS, objStationeryFile Sub NewLetter2() Const strStationeryFile = "C:\Program Files\Common Files\Microsoft Shared\Stationery\Letter2.htm" Set NewMail = Application.CreateItem(olMailItem) Set objFS = CreateObject("Scripting.FileSystemObject") Set objStationeryFile = objFS.OpenTextFile(strStationeryFile, 1, False) NewMail.HTMLBody = objStationeryFile.ReadAll objStationeryFile.Close NewMail.Display End Sub

Which way should I add an AddressEntry?

Postby Shelby » Tue, 15 Jun 2004 14:14:53 GMT

Hi,
how do I add a ContactItem to a specific AddressList?
I have populate a ListBox with user's Address Book.
User will select the specific Address Book and an AddressEntry will be added
into that AddressList.

So do I add the entry like this:
    AddressList = oNs.AddressLists.Item(UserSelectedIndex)
    myentry = AddressList.AddressEntries.Add("SMTP", "testtest",
" XXXX@XXXXX.COM ")
    myentry.Update()
(If I add it this way, I do not have access to other properties such as
CompanyName, Birthday etc etc)


Or like this:
    sCtact  = oApp.CreateItem(Outlook.OlItemType.olContactItem)
    sCtact.FullName = "Test 123"
    sCtact.CompanyName = "His Company Name"
    sCtact.Birthday= "His birthday"
    sCtact.Email1Address =  XXXX@XXXXX.COM 
    sCtact.Close(Outlook.OlInspectorClose.olSave)
(If I add it this way, it will not be added to user's specified address
book)


Thanks.



Re: Which way should I add an AddressEntry?

Postby Ken Slovak - [MVP - Outlook] » Tue, 15 Jun 2004 22:02:47 GMT

The second way adds it to the default Contacts folder. Either use the Add
method of the Items collection of the folder you want or create it in the
default Contacts folder and use the Move function to move it to the folder
you want after creating it.

-- 
Ken Slovak
[MVP - Outlook]
 http://www.**--****.com/ 
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
 http://www.**--****.com/ 






added



Re: Which way should I add an AddressEntry?

Postby Shelby » Wed, 16 Jun 2004 11:28:30 GMT

Hi,
yes I notice that the second method adds to the default Contacts folder.
So if I use the second method, I need to parse the folder path to the Move
method.
The question is, how can I get the folder path with the"AddressList Index"?
Because I have populated a list box with the AddressList Name and Index.
When user select the specific AddressList, it will be added to that
AddressList.

Thanks
Shelby












Re: Which way should I add an AddressEntry?

Postby Ken Slovak - [MVP - Outlook] » Wed, 16 Jun 2004 22:32:54 GMT

The Index property of an AddressList just gives you the current number of
that list in the AddressLists collection. That is not necessarily a
persistent value and can even change during an Outlook session if additional
AddressList's are added to that collection. So I would not depend on that
value for anything.

AFAIK there is no direct way to correlate an AddressList with a specific
Contacts folder other than brute force. I would iterate recursively all the
folders below Inbox.Parent for folders and subfolders that are Contacts
folders and store that information along with the folder paths and then try
to match up the names of the folders with the AddressList name. There may be
better ways but I'm not aware of them.

-- 
Ken Slovak
[MVP - Outlook]
 http://www.**--****.com/ 
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
 http://www.**--****.com/ 






Index"?



Similar Threads:

1.Adding new entries to AddressList.AddressEntries...

Hi again,

i have a form with a list displaying addresses that i read via OOM,
"NameSpace.AddressLists(x)". Works well so far. I now want to add a
new address entry to one of the AddressLists. I've learned that it's
not possible via "AdressList.AddressEntries.Add", so i've tried to get
a pointer to the underlying contacts folder via

NameSpace.GetFolderFromID(AddressList.ID)

or

NameSpace.GetItemFromID(AddressEntry.ID).Parent

This will fail 'cause the "ID" is no "EntryID" or "StoreID".
"AddressList.Parent" points to "AddressLists" instead to the folder
from which the entries are selected and thus also isn't of much help. 

Question is now: How do i get a pointer to the appropiated contacts
folder to add a new entry directly? Or do i have to dig deeper into
CDO for a solution? Thanks for any hint...


-- 

So long...
         ...Bomi

> !!! EMail??? Please use Reply-To address and remove underscores (_) !!!

2.AddressEntries Not Working for Server-Side Script

I have an Agent Server-Side Script running to process new messages arriving
in a Public Folder. This includes accessing the Members for a Recipient that
is a Distribution Group located in the Global Address List.

This portion of code works just fine:

    Set oAddrEntry = oRecip.AddressEntry

But this line fails with error MAPI_E_NO_SUPPORT:

    Set oAddrEntries = oAddrEntry.Members

We weren't getting this error when we were using WinNT 4.0 Server and
Exchange 5.5. But we're now planning a switch to Windows 2000 Server
5.00.2195 SP2 and Exchange 2000 Ver 6 Build 5762.4 SP2 and the error occurs
on our test setup.

I believe that I've got the permissions set correctly. We've got the Event
Service running under the Administrator account, and the Administrator
permissions on the container that holds the Distribution Groups looks okay.

I'd appreciate any suggestions.

Thanks.



3.Address Book/Global Address List & Visual Basic 6 Part II (AddressEntry)

4.ContactItem from AddressEntry

Hi,

How do I get a ContactItem from an AddressEntry object? Its good to see that 
Outlook 2007 has AddressEntry.GetContact() and AddressEntry.GetExchangeUser() 
methods but how do I do this in Outlook 2003 (Outlook11)? I've tried:

Outlook.ContactItem contactItem = 
addressEntry.Session.GetItemFromID(addressEntry.ID, 
System.Reflection.Missing.Value) as Outlook.ContactItem;

and

Outlook.ContactItem contactItem = 
addressEntry.Session.GetItemFromID(addressEntry.Address, 
System.Reflection.Missing.Value) as Outlook.ContactItem;
				
But both fail with a "Cannot open item. Try again." error.

What I really want to do is access information such as OfficeLocation, 
Company, etc. that is displayed when I call the AddressEntry.Details() method.

5.Error: AddressEntry.Members

Hi,

i get an runtime error [-1975500798 (8a404002)] if i use the Members
property of
an AddressEntry object of type olPrivateDistList (Outlook 2000, VB6 Addin).
Anyone know this problem?

Thanx in advance

Michael


6. getting the AddressEntry object to update for a Personal Address Book

7. Cdo Contacts and AddressEntry.Details

8. How to find that AddressEntry belongs to which AddressList using CDO



Return to MS OFFICE OUTLOOK

 

Who is online

Users browsing this forum: No registered users and 80 guest