copy OL2003 contacts

S

starcarrier

Hi!

I would like to add a function to OL2003 which allows a user to copy a
contact
which is currently open in the contact-form to another contact-folder
(personal -> public, public -> personal)

how can I accomplish this ?

any help with this would be greatly appreciated, thanx in advance!

regards,
Hans
 
G

Guest

Is your intent to help automate copying the currently open Contact to 1 or 2
folders that are commonly used? Then use something like this:

Set myItem = ActiveInspector.CurrentItem 'retrieves open Contact
Set myCopiedItem = myItem.Copy
myCopiedItem.Move myNewFolder

You'll have to set myNewFolder to the relevant destination, either by using
a folder's unique ID with the NameSpace.GetFolderFromID method, walking a
Folders collection until you find the folder you need, or getting a default
folder (NameSpace.GetDefaultFolder).

If you want the user to choose the destination, use the NameSpace.PickFolder
method.
 
S

starcarrier

Hi !
Is your intent to help automate copying the currently open Contact to 1 or 2
folders that are commonly used? Then use something like this:
Set myItem = ActiveInspector.CurrentItem 'retrieves open Contact
Set myCopiedItem = myItem.Copy
myCopiedItem.Move myNewFolder
You'll have to set myNewFolder to the relevant destination, either by using
a folder's unique ID with the NameSpace.GetFolderFromID method, walking a
Folders collection until you find the folder you need, or getting a default
folder (NameSpace.GetDefaultFolder).
If you want the user to choose the destination, use the NameSpace.PickFolder
method.

thanx for your reply!

I need to copy a contact to/from a shared (exchange) folder, do I have
to do some special actions for this or is this just another folder ?

I also would like to expand the contact-form with this new
functionality.

regards,
Hans
 
G

Guest

Exchange folders are accessed like regular MAPIFolder objects, providing you
have the necessary permissions to view/read/write.

There's nothing stopping you from doing what you want with a custom Contact
form. See these links for helpful resources:

Customizing Microsoft Outlook Contact Forms:
http://www.outlookcode.com/d/contactform.htm

How to make a Microsoft Outlook custom form the default:
http://www.outlookcode.com/d/newdefaultform.htm

OL2002: How to Update Existing Items to Use a New Custom Form:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;290659
 
S

starcarrier

Hi Eric!

thanx for your reply!

my customer also wants to copy/save calender-entries to the public
calender
and vice versa. I think I will use a macro-approach, so I dont have to
use customized
forms for now. when he cerates a new calender-entry OL offers just the
opportunity to
save the entry and close the form. I will add a button which he can use
to also create the entry in the public/personal calender. I just have
to figure out which calender an entry is from to distinguish where to
copy/save it to.

any comments appreciated, thanx in advance!
regards,
Hans
 
G

Guest

Figuring out what the parent folder is for a newly created item can be
tricky. You can always use ActiveExplorer.CurrentFolder to determine the
save location, but that may not be reliable if the user has switched away
from the new item and changed folders for whatever reason. Depending on when
your code is run, it could be a different folder!

The best iron clad alternative is to declare an Inspectors collection
variable using the With Events keyword to trap whenever any kind of Outlook
item is created; weed out non-Calendar items and use
ActiveExplorer.CurrentFolder at that time to determine where the item will be
saved.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top