Create a new contact use MAPI?

Status
Not open for further replies.
R

ryotyankou

My application UI have a button, click the button, pop up outlook's new

contact dialog, let user fill their infos then save. Then i want to update my

contact list(add this new one to existing list).

I want to call the contact dialog use MAPI, like you click "new contact" in

outlook "new" menu. I checked code of MFCMAPI, found it really hard to do

this(too many codes). My real trouble is i want to know when user close and

save the contact called by my application so to update my list of contacts.

Any ideas? TIA.
 
D

Dmitry Streblechenko

I am not sure what this has to do with creating a new contact.

Have you looked at the Inspector.Close event?

Dmitry Streblechenko (MVP)

-

"ryotyankou" <u48591@uwe> wrote in message news:9d8ee5f284786@uwe...
> My application UI have a button, click the button, pop up outlook's new
> contact dialog, let user fill their infos then save. Then i want to update
> my
> contact list(add this new one to existing list).
> I want to call the contact dialog use MAPI, like you click "new contact"
> in
> outlook "new" menu. I checked code of MFCMAPI, found it really hard to do
> this(too many codes). My real trouble is i want to know when user close
> and
> save the contact called by my application so to update my list of
> contacts.
> Any ideas? TIA.
 
R

ryotyankou

Thank you Dmitry, i solved this problem by use outlook object model.

This is the code:

Outlook::_ApplicationPtr pOutlook("Outlook.Application");

Outlook::_NameSpacePtr pNameSpace = pOutlook->GetNamespace("MAPI");

CString profname = session.GetProfileName();

pNameSpace->Logon(_variant_t(profname) );

CComQIPtr<Outlook::_ContactItem> ocontact(pOutlook->CreateItem(Outlook::

olContactItem));

ocontact->Display((VARIANT_BOOL)1);

-------------------------------And it didn't pop up the security dialog.

Dmitry Streblechenko wrote:
> I am not sure what this has to do with creating a new contact.
> Have you looked at the Inspector.Close event?
>
> > My application UI have a button, click the button, pop up outlook's new
> > contact dialog, let user fill their infos then save. Then i want to update

> [quoted text clipped - 8 lines]
> > contacts.
> > Any ideas? TIA.



200910
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
O Outlook 365 - How to create / copy a new contact from an existing one? Using Outlook 3
O Create a custom contact form - questions before messing things up... Outlook VBA and Custom Forms 4
R Outlook add-in to create new contact from an email. Using Outlook 0
G Create an Appointment at the Contact's Address From Email Outlook VBA and Custom Forms 0
makinmyway How Create a Field and Formula for a Contact's Years of Experience Outlook VBA and Custom Forms 12
J Create an appointment from Contact list with the Company name in the Subject line Using Outlook 1
L Macro Create Contact and Save Using Outlook 2
L Macro Create Contact and Save Using Outlook 8
J How to create a user defined dropdown list field for a custom contact form Using Outlook 3
A receive error when create new business contact BCM (Business Contact Manager) 14
S Macro to create a new contact, 2 appointments, and a task Using Outlook 1
S [outlook-users] Create contact group from other user's contacts Using Outlook 1
M right click contact to create an appointment Using Outlook 4
H can i automatically create new contact from specifc incoming mail BCM (Business Contact Manager) 2
E How to create a time based view like in Business Contact Manager Outlook VBA and Custom Forms 2
C Create Meeting With Custom Form Outlook VBA and Custom Forms 3
D Create advanced search (email) via VBA with LONG QUERY (>1024 char) Outlook VBA and Custom Forms 2
G Create ordinal numbers for birthday Outlook VBA and Custom Forms 2
D Create new email from the received Email Body with attachment Outlook VBA and Custom Forms 10
A How to create fixed signatures for aliases that process through GMAIL? Outlook VBA and Custom Forms 0
P Can I create a Rule that sends me an email when I get a Task? Using Outlook 2
M How create a Rule to filter sender's email with more that one @ sign Using Outlook 1
B Can I create a local PST file for SPAM on a drive that is usually disconnected? Using Outlook 3
Chiba Create an appointment for all the members Outlook VBA and Custom Forms 1
S Create a clickable custom column field Outlook VBA and Custom Forms 0
C Can't create Outlook data file Outlook Wishlist 0
L automaticaly create a teams meeting with a sync Using Outlook 0
D Can Exchange Admin Center create a pst for users email/contacts/calendar? Exchange Server Administration 0
S Create A Search Folder That Looks For Message Class? Outlook VBA and Custom Forms 0
F How to create phone number as links in notes of Contacts Using Outlook 2
Nessa Can't create new appointment Using Outlook 1
A Create date folder and move messages daily Outlook VBA and Custom Forms 1
C Create new Message with shared contacts & BCC'ing recipients Outlook VBA and Custom Forms 0
O Multiple email accounts - hesitate to create a new profile Using Outlook 3
G Can't create Folder Groups in Outlook 2013 Using Outlook 0
N Outlook rules don't create a copy for bcc'ed emails Using Outlook 3
F Delete/create/reset Exchange mailbox on Outlook.com Using Outlook.com accounts in Outlook 3
R Can not create folder to store specific emails in in Outlook for Mac Using Outlook 1
W Create Search Folder excluding Specific Email Addresses Using Outlook 5
A Outlook macro to create search folder with mail categories as criteria Outlook VBA and Custom Forms 3
K VBA BeforeItemMove event create rule to always move to its folder. Outlook VBA and Custom Forms 4
JackBlack What tools do you use to create the signature for email? Using Outlook 3
Rupert Dragwater How to create a new email with @outlook.com Using Outlook.com accounts in Outlook 32
F Should a new email account also create new contacts Using Outlook 2
D create an html table in outlook custom form 2010 using vba in MsAccess Outlook VBA and Custom Forms 7
Tanja Östrand Outlook 2016 - Create Macro button to add text in Subject Outlook VBA and Custom Forms 1
Q Script to create a pst file for Archiving Using Outlook 1
Jennifer Murphy Can I create a Rule with Or'd conditions? Using Outlook 1
D Outlook macros to create meeting on shared calendar Outlook VBA and Custom Forms 10
G How do I create a custom pick list in VB for an outlook automated email? Outlook VBA and Custom Forms 1

Similar threads

Top