Outlookアドイン(c#+ vsto)からOutlookの会話クリーンアップを呼び出す必要があります。 私はオフィスのリボンバーに自分のボタンを持っていて、それをクリックすると、現在選択されているメールアイテムでOutlookの会話のクリーンアップを呼び出す必要があります。 これは可能なのですか?Outlookアドインから会話クリーンアップを呼び出す
答えて
Outlookアイテムは、このアイテムが属する会話を表すConversation
オブジェクトを取得するGetConversationメソッドを提供します。
GetConversation
は、アイテムの会話が存在しない場合はNull
(Visual BasicではNothing)を返します。次のシナリオでアイテムの会話が存在しません。
•アイテムが保存されていません。アイテムは、プログラムで、ユーザーの操作によって、または自動保存によって保存することができます。
•送信可能なアイテム(メールアイテム、予定アイテム、連絡先アイテムなど)の場合、そのアイテムは送信されていません。
•会話はWindowsレジストリで無効になっています。
•Microsoft Exchange Server 2010より前のバージョンのMicrosoft Exchangeに対してOutlookが従来のオンラインモードで実行されているなど、ストアは会話形式のビューをサポートしていません。 StoreオブジェクトのIsConversationEnabledプロパティを使用して、ストアが会話ビューをサポートしているかどうかを判断します。
次のコード例では、エクスプローラウィンドウで選択したアイテムがメールアイテムであることを前提としています。コード例は、選択したメールアイテムが関連付けられている会話を取得し、その会話の各アイテムを列挙し、アイテムの件名を表示します。 DemoConversation
メソッドは、選択したメールアイテムのGetConversation
メソッドを呼び出して、関連する会話オブジェクトを取得します。 DemoConversation
はConversationオブジェクトのGetTable
とGetRootItems
メソッドを呼び出して、TableオブジェクトとSimpleItemsコレクションをそれぞれ取得します。
void DemoConversation()
{
object selectedItem =
Application.ActiveExplorer().Selection[1];
// This example uses only
// MailItem. Other item types such as
// MeetingItem and PostItem can participate
// in the conversation.
if (selectedItem is Outlook.MailItem)
{
// Cast selectedItem to MailItem.
Outlook.MailItem mailItem =
selectedItem as Outlook.MailItem;
// Determine the store of the mail item.
Outlook.Folder folder = mailItem.Parent as Outlook.Folder;
Outlook.Store store = folder.Store;
if (store.IsConversationEnabled == true)
{
// Obtain a Conversation object.
Outlook.Conversation conv = mailItem.GetConversation();
// Check for null Conversation.
if (conv != null)
{
// Obtain Table that contains rows
// for each item in the conversation.
Outlook.Table table = conv.GetTable();
Debug.WriteLine("Conversation Items Count: " +
table.GetRowCount().ToString());
Debug.WriteLine("Conversation Items from Table:");
while (!table.EndOfTable)
{
Outlook.Row nextRow = table.GetNextRow();
Debug.WriteLine(nextRow["Subject"]
+ " Modified: "
+ nextRow["LastModificationTime"]);
}
Debug.WriteLine("Conversation Items from Root:");
// Obtain root items and enumerate the conversation.
Outlook.SimpleItems simpleItems
= conv.GetRootItems();
foreach (object item in simpleItems)
{
// In this example, only enumerate MailItem type.
// Other types such as PostItem or MeetingItem
// can appear in the conversation.
if (item is Outlook.MailItem)
{
Outlook.MailItem mail = item
as Outlook.MailItem;
Outlook.Folder inFolder =
mail.Parent as Outlook.Folder;
string msg = mail.Subject
+ " in folder " + inFolder.Name;
Debug.WriteLine(msg);
}
// Call EnumerateConversation
// to access child nodes of root items.
EnumerateConversation(item, conv);
}
}
}
}
}
void EnumerateConversation(object item,
Outlook.Conversation conversation)
{
Outlook.SimpleItems items =
conversation.GetChildren(item);
if (items.Count > 0)
{
foreach (object myItem in items)
{
// In this example, only enumerate MailItem type.
// Other types such as PostItem or MeetingItem
// can appear in the conversation.
if (myItem is Outlook.MailItem)
{
Outlook.MailItem mailItem =
myItem as Outlook.MailItem;
Outlook.Folder inFolder =
mailItem.Parent as Outlook.Folder;
string msg = mailItem.Subject
+ " in folder " + inFolder.Name;
Debug.WriteLine(msg);
}
// Continue recursion.
EnumerateConversation(myItem, conversation);
}
}
}
- 1. Outlookアドインからcrm Webサービスを呼び出す
- 2. 会話APIから外部REST Webサービスを呼び出す
- 3. Outlookアドインのポップアップ通知(バックグラウンドスレッドの問題からForm.Show()を呼び出す)
- 4. Office 365アドインOutlook WebAPIを呼び出すAADトークンを取得
- 5. (初心者)Outlook RESTful APIをOutlook VSTOアドインで呼び出す方法
- 6. iPhone:Javascriptから電話を呼び出す
- 7. Outlookの会話履歴
- 8. Officeアドインからプロセスを呼び出していますか?
- 9. Pythonからexcelアドインを呼び出す方法
- 10. Excel 2007からVisual Studio Excelアドインを呼び出す
- 11. DropdownlistsアドインでOutlookアドイン
- 12. outlookからwebservice.netを呼び出します。
- 13. Outlookアドインから呼び出されたときにNLogがログファイルに書き込まない
- 14. Office/Outlookアドインからハイパーリンクを貼る
- 15. ワトソン会話内からREST APIをどのように呼び出すのですか?
- 16. Windows電話クライアントからashxを呼び出す
- 17. コードからのOutlookマクロの呼び出し
- 18. OutlookアドインのDialog APIからリダイレクト
- 19. 別のアドインを使用するOutlookアドイン
- 20. API.aiのようなIBM Watsons会話インターフェースからWebhookを呼び出すことはできます
- 21. MPS Typesystemデータベースの照会/ API呼び出しの呼び出し
- 22. Outlook JSアドイン+ Outlook REST API
- 23. Issue for Outlook 365 for Outlookアドイン
- 24. Outlook Expressアドイン
- 25. Outlookアドインのインストール
- 26. Office(esp。Outlook)アドイン
- 27. センターOutlook WPFアドイン
- 28. Outlookアドインのフォルダブラウザダイアログ
- 29. アドインでOutlook UI
- 30. Outlookアドインは
ユージーン、私の質問にお返事ありがとうございます。上記のアプローチを使用するためには、各メッセージ本文を、表にある他のすべてのメッセージの本文と比較する必要があります。それ以外は、Outlookにはさまざまなケースの本文があります(メッセージ本文には 'mailto:'があり、電子メールアドレスは[<]で囲まれていますが、 '<'は別の場所で使用されています。時間フィールド)。したがって、ホイールの再作成ではなく、Outlookの組み込みの対話クリーンアップ機能を呼び出す方が良いかもしれません。 –