受信者の種類を表す長整数型 (Long) の値を設定します。 値の取得と設定が可能です。
構文
式。種類
式Recipient オブジェクトを表す変数。
注釈
このプロパティは受信者の種類に応じて、次の定数のいずれかに等しい数値に対応する長整数型 (Long) の値を設定します。
JournalItem 受信者の場合、 OlJournalRecipientType クラスの定数 olAssociatedContact です。
MailItem 受信者の場合、 OlMailRecipientType クラスの定数 olBCC 、 olCC 、 olOriginator 、 olTo のいずれかです。
MeetingItem 受信者の場合、 OlMeetingRecipientType クラスの定数 olOptional 、 olOrganizer 、 olRequired 、 olResource のいずれかです。
TaskItem 受信者の場合、 OlTaskRecipientType クラスの定数 olFinalStatus または olUpdate です。
このプロパティは、会議室に対応する受信者の種類を適切に返さないことがあります。 たとえば、会議出席依頼では会議室を必須の受信者として指定できますが、この場合、このプロパティはその会議室の olResource を返しません。
受信者が会議室かどうかを確実に判断するには、Recipient オブジェクトのメッセージング API (MAPI) プロパティ PidTagDisplayTypeEx を使用します。 このプロパティには、Outlook オブジェクト モデルの PropertyAccessor オブジェクトを使用してアクセスできます。 PidTagDisplayTypeEx プロパティは "http://schemas.microsoft.com/mapi/proptag/0x39050003"MAPI プロップタグ名前空間にあります。 PidTagDisplayTypeEx プロパティは、Microsoft Exchange Server 2007 より前のバージョンの Microsoft Exchange Server では利用できないことに注意してください (前のバージョンの Exchange Server では、Recipient.Type プロパティを使用して、olResource 以外の種類の受信者は会議室ではないと見なすことができます)。
例
次の Visual Basic for Applications (VBA) の例は、会議出席依頼の Recipients コレクションの Recipient オブジェクトごとに、PidTagDisplayTypeEx プロパティで PropertyAccessor を使用する方法を示しています。 このプロパティの値が 7 (MAPI ヘッダー ファイル mapidefs.h に定義されている MAPI 定数 DT_ROOM の値) の場合、その受信者は会議室です。 この例では、現在のインスペクターに会議出席依頼があると想定しています。
Sub DemoMeetingRecipients()
Dim myAppointment As Outlook.AppointmentItem
Dim myPA As Outlook.PropertyAccessor
Dim d As Long
Dim myInt As Long
Set myAppointment = Application.ActiveInspector.CurrentItem
For d = 1 To myAppointment.Recipients.count
Debug.Print myAppointment.Recipients.item(d).name
Debug.Print myAppointment.Recipients.item(d).Type
Set myPA = myAppointment.Recipients.item(d).PropertyAccessor
myInt = myPA.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x39050003")
Debug.Print myInt
Debug.Print "---"
Next d
End Sub
次の VBA の例では、 CreateItem を使用して予定を作成し、 MeetingStatus を使用して会議の状態を "会議" に設定して、必須の出席者とオプションの出席者の両方を含む会議出席依頼に変換します。 この例を実行するときは、受信者の名前を実際の名前に置き換えてください (そうしないと、エラーになります)。
Sub ScheduleMeeting()
Dim myItem as Outlook.AppointmentItem
Dim myRequiredAttendee As Outlook.Recipient
Dim myOptionalAttendee As Outlook.Recipient
Dim myResourceAttendee As Outlook.Recipient
Set myItem = Application.CreateItem(olAppointmentItem)
myItem.MeetingStatus = olMeeting
myItem.Subject = "Strategy Meeting"
myItem.Location = "Conference Room B"
myItem.Start = #9/24/2003 1:30:00 PM#
myItem.Duration = 90
Set myRequiredAttendee = myItem.Recipients.Add ("Nate Sun")
myRequiredAttendee.Type = olRequired
Set myOptionalAttendee = myItem.Recipients.Add ("Kevin Kennedy")
myOptionalAttendee.Type = olOptional
Set myResourceAttendee = myItem.Recipients.Add("Conference Room B")
myResourceAttendee.Type = olResource
myItem.Display
End Sub
関連項目
サポートとフィードバック
Office VBA またはこの説明書に関するご質問やフィードバックがありますか? サポートの受け方およびフィードバックをお寄せいただく方法のガイダンスについては、Office VBA のサポートおよびフィードバックを参照してください。