Which way should I add an AddressEntry?

MS OFFICE OUTLOOK

    Next

  • 1. Word & outlook interaction ??s...
    We're considering building an Office automation application, and have a question about Outlook & Word interaction. If Word (2003) is selected as the Outlook eMail editor and our application has code which runs in the templat's Document_New and Document_open events... 1) is there a way to control which template is used when Outlook fires up word to create a new eMail message? 2) will that code run when an eMail message is being composed? 3) If that code runs and creates new Properties on the Document object (Document Metadata), will that metadata be saved/stored with the document when it becomes an email message? 4) if so, where would that metadata be found once Outlook/exchange stores the message? Thanks for any insights anybody can share on these questions.
  • 2. Back-slashes in hyperlinks changed to Forward-slashes
    <a href="ftp://Domain\Username: XXXX@XXXXX.COM " target=_blank>Direct Login to FTP Site</a> Links like above inside Outlook email message are tranlated to forward-slashes only when clicked and therefore result in an error "server not found". Any suggestions on how to prevent this?
  • 3. Picture of the email body
    Hi I am attaching to the database the files that are attached to the email and I find in the datebase files that are part of the body of the email e.g. the image used as a background How can I filter these files? Thank you, Samuel
  • 4. Drag and Drop Outlook Contact
    Hi, I am trying to drag and drop an Outlook 2003 contact onto my win32 application. I can see from the FileGroupDescriptor/FileDescriptor the filename MyContact.msg. When I try to get the FileContents, i get an invalid index error. I can successfully drag and drop an email attachment onto my application but can't seem to get the Contacts, Tasks, etc via Drag and Drop. I know there is 'some' data available in text format, but I want the actual msg file. For example I might want to drag and drop a contact onto my application and save the msg file locally. The documentation is elusive. Can someone point me to sample code that shows how to drag a contact from outlook to another win32 application and have the dropped msg saved as a local file??? Thanks in advance... -- Regards, Randy

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 99 guest