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

getAttachmentContentAsync(attachmentId, options, callback) - Email (.msg) Attachments in Outlook Appointment has missing extension name when accessing the appointment the second time #5396

Open
margielovelet opened this issue Feb 17, 2025 · 1 comment
Assignees
Labels
Area: Outlook Issue related to Outlook add-ins Needs: author feedback Waiting for author (creator) of Issue to provide more info

Comments

@margielovelet
Copy link

I am having issue with handling attachment for Outlook appointment. We have an add-in that saves appointment details to our web app.

The issue is happening on this scenario.

  1. Create a new appointment with attachment of type email (.msg)
  2. Calling "getAttachmentContentAsync(attachmentId, options, callback)" will return the complete attachment filename including extension name, say "aaa.msg"
  3. Save the appointment
  4. Edit the appointment
  5. Calling "getAttachmentContentAsync(attachmentId, options, callback)" will return the only filename of the attachment excluding the extension name, so the result is just "aaa"

This is the snippet of my code

var attachment = attachments[currentItr];
var options = { asyncContext: { type: attachment.attachmentType, name: attachment.name, contentType: attachment.contentType, isInLine: attachment.isInline } };

        item.getAttachmentContentAsync(attachment.id, options, function (resultAtt) {
            if (resultAtt.status == Office.AsyncResultStatus.Succeeded) {
                var AttachmentContent = resultAtt.value; // Get the attachment content
           }
        }

The resultAtt.asyncContext.name is the one that is returning the filename without extension.

Thanks.

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP label Feb 17, 2025
@exextoc exextoc added Area: Outlook Issue related to Outlook add-ins Needs: attention 👋 Waiting on Microsoft to provide feedback and removed Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP labels Feb 17, 2025
@mobisw-msft
Copy link

Hey @margielovelet ,

Can you tell us the platform (Outlook for Web, new Outlook for Windows, Outlook for Windows Classic or Outlook for Mac) you see this issue on?
Are you able to see the attachment extension correctly in getAttachmentsAsync? Using code similar to this:

Office.context.mailbox.item.getAttachmentsAsync
(
	function (asyncResult)
	{
		console.log(JSON.stringify(asyncResult));
	}
);

@mobisw-msft mobisw-msft added Needs: author feedback Waiting for author (creator) of Issue to provide more info and removed Needs: attention 👋 Waiting on Microsoft to provide feedback labels Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Outlook Issue related to Outlook add-ins Needs: author feedback Waiting for author (creator) of Issue to provide more info
Projects
None yet
Development

No branches or pull requests

3 participants