Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why VSTO Outlook Add-in and Office JS add-in conversationId is not same? #1856

Open
junaid042 opened this issue Feb 29, 2024 · 6 comments
Open
Assignees
Labels
Needs: attention 👋 Waiting on Microsoft to provide feedback Type: product question Question about the Office Add-ins platform or Office JavaScript APIs

Comments

@junaid042
Copy link

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;
  }

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: triage 🔍 new issue, needs PM on rotation to triage asap label Feb 29, 2024
@junaid042
Copy link
Author

junaid042 commented Feb 29, 2024

I need same ConversationIdlike in JavaScript in VSTO add-in because I have two add-ins js add-in and vsto

@junaid042
Copy link
Author

I also tried this but not same like javascript
conversationId = Convert.ToBase64String(Encoding.UTF8.GetBytes(mailItem.ConversationID));

@AlexJerabek
Copy link
Contributor

Hi @junaid042,

Let me assign @exextoc to help answer your question.

@AlexJerabek AlexJerabek added Type: product question Question about the Office Add-ins platform or Office JavaScript APIs Needs: attention 👋 Waiting on Microsoft to provide feedback and removed Needs: triage 🔍 new issue, needs PM on rotation to triage asap labels Feb 29, 2024
@junaid042
Copy link
Author

@exextoc please help to fix this issue.

@ManojPatelA
Copy link

@exextoc @AlexJerabek Appreciate your help on this issue. I am also having similar situation where from the outlook plugin (C# VSTO) getting different ConversationID which is not matching with what I get from the exchange server using GRAPH API.

@junaid042
Copy link
Author

@exextoc any update??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: attention 👋 Waiting on Microsoft to provide feedback Type: product question Question about the Office Add-ins platform or Office JavaScript APIs
Projects
None yet
Development

No branches or pull requests

4 participants