OfficeDev / Office-Add-in-samples

Code samples for Office Add-in development on the Microsoft 365 platform.
MIT License
671 stars 756 forks source link

Edit the Existing mail #799

Closed SindhuChenna closed 2 days ago

SindhuChenna commented 2 weeks ago

https://github.com/OfficeDev/Office-Add-in-samples/tree/main/Samples/hello-world/outlook-hello-world

Describe the bug

On click of button getting error Uncaught TypeError: Office.context.mailbox.item.body.setAsync is not a function at HTMLButtonElement.sayHello

To Reproduce

Steps to reproduce the behavior:

  1. _Go to add-in
  2. _Click on sayHello button
  3. Scroll down to '....'
  4. See error Uncaught TypeError: Office.context.mailbox.item.body.setAsync is not a function at HTMLButtonElement.sayHello

Expected behavior

Display the required message in the email body

Screenshots

Screenshot 2024-06-17 181940

Environment

Additional context

Add any other context about the problem here.

AlexJerabek commented 2 weeks ago

Hi @SindhuChenna,

Thanks for reporting this. Could you please share which version of Outlook you're using (web, Mac, Windows Classic, New Outlook for Windows)? Also, just to clarify, are you using the GitHub hosted version (manifest.xml), or are you running the web server on localhost (manifest-localhost.xml?

SindhuChenna commented 2 weeks ago

Hi, New outlook for windows. I have just copied manifest.xml and html files.

AlexJerabek commented 2 weeks ago

Thank you for the reply. When you say you've "copied manifest,xml and html files", could you please elaborate? If you're building the project and running it locally, you'll need to copy everything from the repo. If you're sideloading the GitHub hosted version, you should only need the manifest.

Also, I reran the sample and could not reproduce those errors.

SindhuChenna commented 2 weeks ago

After adding localhost.crt and localhost.key files in the folder getting the below error Error: Could not find certificate localhost.crt Screenshot (191)

AlexJerabek commented 2 weeks ago

@exextoc, could you please take a look?

davidchesnut commented 1 week ago

Hi @SindhuChenna, to run the sample from localhost, you need to put the localhost.key and .crt files in the Office-Add-in-samples\Samples\hello-world\outlook-hello-world folder. Then you can run http-server -S -C localhost.crt -K localhost.key --cors . -p 3000 from that same folder. Hope this helps!

microsoft-github-policy-service[bot] commented 5 days ago

This issue has been automatically marked as stale because it is marked as needing author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thank you for your interest in Office Add-ins!

microsoft-github-policy-service[bot] commented 2 days ago

This issue has been closed due to inactivity. Please comment if you still need assistance and we'll re-open the issue.