Closed junaid042 closed 1 month ago
Yes. See this sample: Outlook set signature.
I tried this sample yesterday but not working for my in my React/TypeScript Yeoman Generator Add-in. @Rick-Kirkham any sample in React?
@Rick-Kirkham simply I want OnMessageCompose get my signature html from localStorage and set is as signature.
@junaid042 The Office.js code is the same regardless of whether you are using React for your UI.
You use the Office.context.roamingSettings.set()
method to set a signature as show in the sample file taskpane_main.js.
The file, taskpane_render.js, shows how to read and write from localStorage.
The file, autorunshared.js, shows how to create handlers for events. See the checkSignature
method.
The 2 manifests files in the sample, manifest.xml and manifest.json, show how to connect the handler to the new message composed event.
I also recommend that you first read our documentation for event-based add-ins beginning here: Configure your Outlook add-in for event-based activation.
We use the issues in this repo to track problems with the documentation. Programming questions like this one should be raised on Stack Overflow. I'm going to close this now. If you have further questions, please raise them on Stack Overflow.
@Rick-Kirkham thanks you very much for your help! on stackoverflow no one giving me answer that's why I asked here. I am trying to finish this and my event is working correctly on web but on Windows desktop when I open new mail this is gives me this error "we can't start this add-in because this is not set up properly" like in this screenshot same and the same thing is working on web outlook any idea? and I have tried to restart my outlook re-installed manifest but it doesn't work.
@Rick-Kirkham I added <Override type="javascript" resid="runtimeJs"/>
in Runtime
now not showing this error but still event is not working on desktop outlook
@junaid042 Create a Bug Report on the office-js repo.
@Rick-Kirkham I created please check it out issue link
is there any way to set signature as default from add-in using office js like every time when I open new mail this mail already have signature no need to open add-in again or like in this video video link how email signature automatically inserted without opening taskpane