Question

For one of my project, we create the message copy in sent item through MAPI APIs. I have found an issue and to resolve the same I need to set PR_SENDER_SEARCH_KEY property.
I get an error invalid input argument when I try to set this property as following -
let me know if anyone know the correct way to set it.

PropList[ulPropCount].ulPropTag = PR_SENDER_SEARCH_KEY; 
PropList[ulPropCount].Value.lpszA = temp; 

//where temp is LPSTR which has the value temp = "EX:/O=DGPDEV/OU=FIRST 
//ADMINISTRATIVE //GROUP/CN=RECIPIENTS/CN=ALICE" 

Here is quick description of this property -

PR_SENDER_SEARCH_KEY
Identifies an address book search key.
Canonical name: PidTagSenderSearchKey
Alternate names: PidTagSenderSearchKey,PR_SENDER_SEARCH_KEY,PR_SenderSearchKey,ptagSenderSearchKey
Areas:"Address Properties"
References: [MS-OXCFXICS],[MS-OXCICAL],[MS-OXOCAL],[MS-OXOMSG],[MS-OXOPOST],[MS-OXOTASK]
Property Tag: 0x0C1D0102
Était-ce utile?

La solution

PR_SENDER_SEARCH_KEY is a binary (PT_BINARY) property, you need to set the SPropValue.bin structure, not lpszA. Take a look at an existing message with OutlookSpy (click IMessage) or MFCMAPI.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top