I'm trying to convert a Microsoft.Graph.Contact object into a PST file for Outlook using Extended MAPI, and I don't know where to feed the contact's email addresses to and have it show when I open the contact in Outlook, and wanted to know how I can do that with Microsoft's MAPI SDK.
EDIT: I managed to create the new property
const GUID PSETID_Address = {0x00062004, 0, 0, {0xC0, 0, 0, 0, 0, 0, 0, 0x46}};
LPSPropTagArray cols = NULL;
MAPINAMEID sa = {
(LPGUID) &PSETID_Address,
MNID_ID,
0x8083
};
LPMAPINAMEID sample = {
&sa
};
hr = obj->GetIDsFromNames(1, &sample, MAPI_CREATE, &cols);
SPropValue values[1];
//I'm setting other contact fields. This code is just for brevity. (There's more than 1 property)
values[0].ulPropTag = PROP_TAG(PT_UNICODE, cols->aulPropTag[0]);
values[0].Value.lpszW = L"[email protected]";
LPSPropProblemArray problems = NULL;
hr = obj->SetProps(1, values, &problems);
SetProps then fails with "The parameter is not correct." What am I doing wrong here?
