次の方法で共有


MAPIFolder.GetStorage(String, OlStorageIdentifierType) メソッド

定義

Outlook ソリューションの StorageItem データを格納する親 Folder のオブジェクトを取得します。

public:
 Microsoft::Office::Interop::Outlook::StorageItem ^ GetStorage(System::String ^ StorageIdentifier, Microsoft::Office::Interop::Outlook::OlStorageIdentifierType StorageIdentifierType);
public Microsoft.Office.Interop.Outlook.StorageItem GetStorage (string StorageIdentifier, Microsoft.Office.Interop.Outlook.OlStorageIdentifierType StorageIdentifierType);
Public Function GetStorage (StorageIdentifier As String, StorageIdentifierType As OlStorageIdentifierType) As StorageItem

パラメーター

StorageIdentifier
String

StorageItem オブジェクトの識別子識別子の種類に応じて、値は、エントリ ID、メッセージ クラス、サブジェクトのいずれかを表すことができます。

StorageIdentifierType
OlStorageIdentifierType

StorageItem オブジェクトの識別子の種類を指定します。

戻り値

ソリューションのデータを格納するために使用している StorageItem オブジェクト。

注釈

GetStorage メソッドは、 で指定された識別子を使用して Folder オブジェクトの StorageItem を取得し、 でStorageIdentifierStorageIdentifierType指定された識別子の種類を持ちます。 StorageItem は、非表示のアイテム、 フォルダー アカウントと共に移動し、オンラインとオフラインがあるのです。

olIdentifyByEntryID 値を使用して StorageItemStorageIdentifierTypeを指定EntryIDした場合、GetStorage メソッドは指定された EntryID を持つ StorageItem を返します。 該当する EntryIDStorageItem が見つからなかった場合、または StorageItem が存在しない場合、GetStorage メソッドでエラーが発生します。

olIdentifyByMessageClassStorageIdentifierTypeを使用して StorageItem のメッセージ クラスを指定した場合、GetStorage メソッドは指定されたメッセージ クラスを持つ StorageItem を返します。 同じメッセージ クラスを持つ項目が複数ある場合、 GetStorage メソッドは、最新の PidTagLastModificationTime を持つ項目を返します。 指定したメッセージ クラスに StorageItem が存在しない場合、GetStorage メソッドは、 で指定されたメッセージ クラスを使用してStorageIdentifier新しい StorageItem を作成します。

StorageItem の をSubject指定した場合、GetStorage メソッドは、GetStorage 呼び出しで指定された Subject を持つ StorageItem返します。 同じサブジェクトを持つ項目が複数ある場合、GetStorage メソッドは、最新の PidTagLastModificationTime を持つ項目を返します。 指定した SubjectStorageItem が存在しない場合、GetStorage メソッドは、 で指定された Subject を使用してStorageIdentifier新しい StorageItem を作成します。

GetStorage は、ストアのフォルダーの種類がサポートされていない場合にエラーを返します。 GetStorage は、呼び出されたときに、次のストアにはエラーが返ります。

Size項目のメソッドを明示的に呼び出Save()すまで、新しく作成された StorageItem の は 0 (0) です。

ソリューションのデータを格納する方法の詳細については、「ソリューション用データの格納」を参照してください。

適用対象