適用されます: OutlookApplies to: Outlook

�lj��A�폜�A�܂��̓��b�Z�[�W�̎�M�҂�ύX���܂��BAdds, deletes, or modifies message recipients.

HRESULT ModifyRecipients(
  ULONG ulFlags,



[����]��M�҂̕ύX�𐧌䂷��t���O�̃r�b�g���܂��B _ulFlags_�p�����[�^�[�̃[����o�߂���ƁA ModifyRecipients�� _lpMods_�p�����[�^�[�Ŏw�肳�ꂽ����̃��X�g�Ŋ����̂��ׂĂ̎�M�҂�u�������܂��B _ulFlags_�ɂ́A���̃t���O��ݒ�ł��܂��B[in] Bitmask of flags that controls the recipient changes. If zero is passed for the ulFlags parameter, ModifyRecipients replaces all existing recipients with the recipient list pointed to by the lpMods parameter. The following flags can be set for ulFlags:


_lpMods_�p�����[�^�[��w����M�҂́A����̃��X�g�ɒlj�����K�v������܂��BThe recipients pointed to by the lpMods parameter should be added to the recipient list.


_lpMods_�p�����[�^�[��w����M�҂́A�����̎�M�҂ɒu�������Ă��������B���ׂĂ̊����̃v���p�e�B�́A�Ή�����ADRENTRY�\����ɒu���������܂��BThe recipients pointed to by the lpMods parameter should replace existing recipients. All of the existing properties are replaced by those in the corresponding ADRENTRY structure.


インデックスとして、 _lpMods_パラメーターの各受信者のエントリのプロパティの値の配列に含まれるPR_ROWID (PidTagRowid) プロパティを使用して受信者の一覧から既存の受信者を削除する必要があります。Existing recipients should be removed from the recipient list using as an index the PR_ROWID (PidTagRowid) property included in the property value array of each recipient entry in the lpMods parameter.


[����]�|�C���^�[��lj��A�폜�A�܂��̓��b�Z�[�W��ɕύX���ꂽ����̃��X�g��܂�ADRLIST�\���ɂ��܂��B[in] Pointer to an ADRLIST structure that contains a list of recipients to be added, deleted, or modified in the message.

�߂�lReturn value


���惊�X�g������ɕύX����܂����BThe recipient list was successfully modified.


IMessage::ModifyRecipients���\�b�h�́A���b�Z�[�W�̎�M�҃��X�g��ύX���܂��B���̃��X�g����A��M�҂̃e�[�u�����g�ݍ��܂�Ă���A ADRLIST�\����ɕێ��͂ł��܂��BThe IMessage::ModifyRecipients method changes the message's recipient list. It is from this list, held in an ADRLIST structure, that the recipient table is built.

ADRLIST�\���̊e��M�҂� 1 �‚�ADRENTRY�\�����܂܂�Ă��邵�A�e ADRENTRY�\���ɂ́A��M�҂̃v���p�e�B��L�q����v���p�e�B�̒l�̔z�񂪊܂܂�Ă��܂��BThe ADRLIST structure contains one ADRENTRY structure for each recipient and each ADRENTRY structure contains an array of property values describing the recipient properties.

ADRLIST構造内の受信者を解決または未解決のことができます。Recipients in the ADRLIST structure can be resolved or unresolved. 数と含まれているプロパティの種類が異なります。The difference is in the number and type of properties that are included. 未解決の受信者が含まれPR_DISPLAY_NAME (PidTagDisplayName) とPR_RECIPIENT_TYPE (PidTagRecipientType) プロパティのみ、解決済みの受信者には、これら 2 つのプロパティに加え、 PR_ADDRTYPE が含まれています。(PidTagAddressType) とPR_ENTRYID (PidTagEntryId)。An unresolved recipient contains only the PR_DISPLAY_NAME (PidTagDisplayName) and PR_RECIPIENT_TYPE (PidTagRecipientType) properties while a resolved recipient contains those two properties plus PR_ADDRTYPE (PidTagAddressType) and PR_ENTRYID (PidTagEntryId). PR_EMAIL_ADDRESS (PidTagEmailAddress) が利用可能な場合は、ことができます含まれてもします。If PR_EMAIL_ADDRESS (PidTagEmailAddress) is available, it can be included also.

���b�Z�[�W�����M�����܂łɂ́A���̎�M�҈ꗗ�ʼn����M�҂݂̂ɕK�v������܂��B��M�҂ɂ́A�z�M�s�\���|�[�g��쐬���A���̃��b�Z�[�W�̑��M�҂ɑ��M���ꂽ���������܂��B�N���C�A���g�̊ϓ[���疼�O����v���Z�X�̏ڍׂɂ‚��ẮA���O����������Q�Ƃ��Ă��������B�A�h���X���̃v���o�C�](�[�̊ϓ_����̏ڍׂɂ‚��ẮA���O��������������Q�Ƃ��Ă��������BBy the time a message is submitted, it must include only resolved recipients in its recipient list. Unresolved recipients cause nondelivery reports to be created and sent to the original sender of the message. For more information about the name resolution process from the client perspective, see Resolving a Name. For more information from the perspective of the address book provider, see Implementing Name Resolution.

�ɉ����ĉ������і�����̎�M�҂��M�҂� NULL ���Ƃ��ł��܂��B��M�҂� ADRENTRY�\���� cValues�����o�[�� 0 �ɐݒ肵�A rgPropVals�����o�[�� NULL �ɐݒ肵�܂��BIn addition to resolved and unresolved recipients, a recipient can be NULL. The cValues member of the ADRENTRY structure for the recipient is set to zero and the rgPropVals member is set to NULL.

呼び出し側への注意Notes to callers

コモン ダイアログ ボックスを表示し、エントリを選択するように求めるには、 IAddrBook::Addressを呼び出すことによって、受信者のリストを作成できます。You can create a recipient list by calling IAddrBook::Address to display the common dialog box and prompt the user to select entries. アドレスに_lppAdrList_パラメーターで指定されたアドレス一覧は、 ModifyRecipientsに_lpMods_のパラメーターとして渡すことができます。The address list pointed to by the lppAdrList parameter to Address can be passed to ModifyRecipients as the lpMods parameter.

ADRLIST�\����Ŏ�M�҂̃v���p�e�B��w�肷��ꍇ�́A���ׂĂ̒lj��܂��͕ύX���ꂽ��̂����łȂ��A��M�҂̃v���p�e�B��w�肵�܂��B��M�҂��ύX���ꂽ�Ƃ� ADRLIST�\���Ɋ܂܂�Ă��Ȃ��C�ӂ̃v���p�e�B���폜����܂��B���݂̈�A�̃v���p�e�B�̂��ׂẴ��b�Z�[�W�̎�M�҂�擾����ɂ͂���ɂ́A GetRecipientTable����ׂĂ̍s��擾���܂��B SRowSet�ɂ́A ADRLIST�\����Ɠ����ł��邽�ߓ����Ӗ��Ŏg�p�ł��܂��BWhen you specify properties for a recipient in the ADRLIST structure, include all of the recipient's properties, not only the new or changed ones. When a recipient is modified, any properties not included in the ADRLIST structure are deleted. To retrieve the current set of properties for all of a message's recipients, call GetRecipientTable and retrieve all of the rows. Because an SRowSet is identical in structure to an ADRLIST, you can use them interchangeably.

ModifyRecipients�ɂ́A _ulFlags_�p�����[�^�[�Ȃ��̃t���O�̐ݒ肳��Ă���ꍇ�A _lpMods_���w������܂ނ��ׂĂ̌��݂̎�M�҃��X�g�̃G���g�����u���������܂��BModifyRecipients replaces all of the entries in the current recipient list with the information pointed to by lpMods when none of the flags are set in the ulFlags parameter.

呼び出し側への注意Notes to callers

MODRECIP_MODIFY �t���O��ݒ肷��Ƃ��� ModifyRecipients lpMods�ɓn�����_ADRLIST_�\���Ɋ֘A�t�����Ă���s�S�̂̎�M�Ҋe�s�ɒu�������܂��B���ׂĂ̎�M�҂��Ӑ}�����ɍ폜����Ȃ��悤�ɕύX����Ă��邩�ǂ����Ɋ֌W�Ȃ��A�v���p�e�B��w�肷��悤�ɒ��ӂ��܂��BWhen you set the MODRECIP_MODIFY flag, ModifyRecipients replaces each entire recipient row with the associated row in the ADRLIST structure passed in lpMods. Be careful to specify all of the properties that a recipient should have regardless of whether they have changed to prevent them from being unintentionally deleted.

�ȉ��́A ADRLIST�\���Ŏ�M�҂̃v���p�e�B��ݒ肷�邽�߂̂����‚��̃��[���ł��BFollowing are some rules for setting the properties of the recipients in the ADRLIST structure:

  • �v���p�e�B�̌^�Ƃ��� PT_NULL ��g��Ȃ��ł��������B ModifyRecipients �ł́A���̒l�����������ꍇ�A�G���[���Ԃ���܂��BDo not use PT_NULL as a property type. ModifyRecipients returns an error when encountering this value.

  • �v���p�e�B�̌^�Ƃ��� PT_ERROR ��g��Ȃ��ł��������B ModifyRecipients �ł́A���̒l�͖������܂��BDo not use PT_ERROR as a property type. ModifyRecipients ignores this value.

  • ulFlags�� MODRECIP_REMOVE �܂��� MODRECIP_MODIFY �̂����ꂩ�̃t���O��ݒ肷��ƁA���ׂĂ̎�M�҂ɑ΂��āA _PR_ROWID_�v���p�e�B���܂܂�܂��BInclude the PR_ROWID property for all recipients when you set either the MODRECIP_REMOVE or MODRECIP_MODIFY flag in ulFlags.

  • ulFlags�܂��� _ulFlags_�Ƀ[����ʉ߂���Ƃ��ɁAMODRECIP_ADD �t���O��ݒ肷��Ƃ��ɁA��M�҂̂����ꂩ�� _PR_ROWID_�v���p�e�B��܂߂Ȃ��ł��������BDo not include the PR_ROWID property for any of the recipients when you set the MODRECIP_ADD flag in ulFlags or when you pass zero in ulFlags.

��M�҂� 1 �‚� PR_ADDRTYPE�v���p�e�B�܂��� PR_EMAIL_ADDRESS�v���p�e�B��lj�����A�܂��͗����̃v���p�e�B�� PR_ENTRYID�Ŏ������悤�ɁA��M�҂̃A�h���X�A�Z���̎�ނƈ�v���Ȃ��A���ʂ͒�`����Ă��܂���B�‚܂�A�T�[�r�X �v���o�C�_�[�ɂ���ẮA���� 3 �‚̉”\��������܂��BIf you include either the PR_ADDRTYPE property or PR_EMAIL_ADDRESS property for a recipient and one or both of these properties are inconsistent with the address type and address of the recipient as identified by PR_ENTRYID, the results are undefined. That is, there are three possibilities, depending on the service provider:

  • ���b�Z�[�W�́A PR_ADDRTYPE�� PR_EMAIL_ADDRESS�v���p�e�B�Ő������Ă���A�h���X�ɔz�M����܂��BThe message will be delivered to the address described by the PR_ADDRTYPE and PR_EMAIL_ADDRESS properties.

  • PR_ENTRYID�Ŏ����ꂽ��M�҂Ƀ��b�Z�[�W���z�M����܂��BThe message will be delivered to the recipient identified by PR_ENTRYID.

  • ���b�Z�[�W�́A�Z���̂����܂����������Ŕz�M�s�\�錾����܂��BThe message will be declared undeliverable due to the ambiguity of the address information.

���惊�X�g�̃��������蓖��ADRLIST �� SRowSet �\���̃�������Ǘ������Ő�����Ă��銄�蓖�ă��[����g�p���܂��B ADRLIST�\����̃T�u�\���̂����ꂩ�� ModifyRecipients�������܂���B ADRLIST�\���ƊeSPropValue�\���̂́A���ꂼ��•ʂɉ�����邱�Ƃ��ł��܂����A MAPIAllocateBuffer�֐���g�p���ȕʂɊ��蓖�Ă���K�v������܂��B���@�ł́A�C�ӂ� SPropValue�\���̒lj��̗̈��K�v�Ƃ���ꍇ�A���Ƃ��ł��܂� SPropValue�\����Œu��������V����MAPIFreeBuffer��g�p���Č�ʼn���ł��܂��B MAPIFreeBuffer��g�p���Ă�A���� SPropValue�\����������K�v������܂��BUse the allocation rules outlined in Managing Memory for ADRLIST and SRowSet Structures to allocate memory for the recipient list. ModifyRecipients does not free the ADRLIST structure nor any of its substructures. The ADRLIST structure and each SPropValue structure must be separately allocated by using the MAPIAllocateBuffer function such that each can be freed individually. If the method requires additional space for any SPropValue structure, it can replace the SPropValue structure with a new one that can later be freed using MAPIFreeBuffer. The original SPropValue structure should also be freed using MAPIFreeBuffer.


MFCMAPI �T���v�� �R�[�h�ł́A���̕\��Q�Ƃ��Ă��������BFor MFCMAPI sample code, see the following table.

�t�@�C��File �֐�Function �R�����gComment
MFCMAPI �ł́A IMessage::ModifyRecipients���\�b�h��g�p���āA���b�Z�[�W�ɁA�V������M�҂�lj����܂��BMFCMAPI uses the IMessage::ModifyRecipients method to add a new recipient to a message.

�֘A����See also








IMessage: IMAPIPropIMessage : IMAPIProp

[�R��h �T���v���Ƃ��� MFCMAPIMFCMAPI as a Code Sample