OfficeDev / OfficeDev/office-js-docs-reference
why VSTO Outlook Add-in and Office JS add-in conversationId is not same?
@exextoc is already working on this.
Since Feb 29, 2024.
- Dominant language
- TypeScript
- Stars
- 153
- Forks
- 72
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 22
Description
why VSTO Outlook Add-in and Office JS add-in conversationId is not same how can I get same in VSTO like in javascript
but javascript conversationId is different then vsto
using JavaScript mail conversationId = AQQkADAwATNiZmYAZC01OGM3LTFhN2ItMDACLTAwCgAQAEDQN/vy31NNlzWXFRhAMCo=
using vsto mail conversationId = 0776E8C6D9B30D44A4EA16BE9211AA81
using this I am getting conversationId in Office JS add-in
const conversationId = Office.context.mailbox.item.conversationId;
and using this I am getting conversationId in vsto add-in
// Method to get the Conversation ID of the selected email
private string GetSelectedEmailConversationId()
{
string conversationId = "";
try
{
Outlook.Application outlookApp = new Outlook.Application();
Outlook.Explorer explorer = outlookApp.ActiveExplorer();
// Check if any item is selected
if (explorer.Selection.Count > 0)
{
object selectedItem = explorer.Selection[1];
if (selectedItem is Outlook.MailItem)
{
Outlook.MailItem mailItem = selectedItem as Outlook.MailItem;
// Get the Conversation ID of the selected email
conversationId = mailItem.ConversationID;
}
else
{
System.Windows.Forms.MessageBox.Show("Please select an email.", "No Email Selected", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
}
}
else
{
System.Windows.Forms.MessageBox.Show("Please select an email.", "No Email Selected", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
}
}
catch (Exception ex)
{
// Handle any errors
System.Windows.Forms.MessageBox.Show("An error occurred: " + ex.Message, "Error", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
}
return conversationId;
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.