office.js get currently selected body text in outlook - outlook-web-addins

I am developing an addin for the web version of outlook on mac and I am trying to get the currently selected body text of an email and access the right click context menu in the read pane. anyone know how to do this?
Thanks!

If you are in compose mode, you can get the currently selected body text of an e-mail by using:
Office.context.mailbox.item.getSelectedDataAsync
Kindly see documentation for this API here:
https://dev.office.com/reference/add-ins/outlook/1.5/Office.context.mailbox.item?product=outlook&version=v1.5
If you are in read mode, there's currently no way to get the selected body text.
Kindly propose this as a feature request on UserVoice : https://officespdev.uservoice.com/
For the right-click context menu, there's no way to do that via the Outlook Web AddIns API. Kindly propose this as well via UserVoice.

Related

Custom Ribbon tab missing in Excel

I tried searching for this question but couldn't really find a similar problem.
I have an excel file in which I created a custom ribbon tab and made copies of this file.
Image of the tab
In some of those copies, the tab has gone missing. I was earlier using Excel 2016 and recently migrated to Microsoft 365 and downloaded the latest version of Office. I am not sure if this is causing the problem since some files do still have the custom ribbon.
Thanks a lot for your help in advance.
Regards
Do you get any UI errors when the tab is missed?
By default, if an add-in attempts to manipulate the Microsoft Office user interface (UI) and fails, no error message is displayed. However, you can configure Microsoft Office applications to display messages for errors that relate to the UI. You can use these messages to help determine why a custom ribbon does not appear, or why a ribbon appears but no controls appear.
To show VSTO Add-in user interface errors you need:
Start the application.
Click the File tab.
Click Options.
In the categories pane, click Advanced.
In the details pane, select Show VSTO Add-in user interface errors, and then click OK.
If you deal with documents with embedded customizations, make sure the protected mode is off when the document is opened. See What is Protected View? for more information.

Edit and Send Outlook Form Template From Excel VBA

Currently, I have the Excel VBA code that will construct and send an Outlook email from Excel. However, I need to be able to use this VBA to open an Outlook form template that contains a command button and update the body of the message. I have been searching non-stop and cant find any good resources for accomplishing this, any good pointers, links, or supporting code would be greatly appreciated. Thanks.
You can save the form as a Microsoft Outlook template file (.oft), and then e-mail that file to users. If the form contains code or custom fields, the recipient will not be able to simply open the .oft file and publish it. The recipient will need to save the .oft file to the local drive, run it with the Tools | Forms | Choose Form command, and then publish the form to the Personal Forms Library.
Alternatively, you can use an .fdm file to install a form manually, see OL2000: How to Move a Custom Form to Another Computer.
Read more about Outlook forms in the To distribute Microsoft Outlook forms to other users article.
As a workaround you may consider creating a COM add-in with rich UI options which can be installed on the recipient's side and do whatever you need for users. See Walkthrough: Create your first VSTO Add-in for Outlook for more information.

Possibilities of MS Outlook Web Add-ins on the header/Ribbon in web apps and Independent

I am working with outlook Web-Addins. Addin type is "ItemRead". Now I want some thing unrelated to mails as in i want to have button on header as i see the skype button on the top.
Also we can create Addin on mail compose. I am not sure if this is possible to have separate buttons on header separate from mail section
example in the image of skype button.
I have also tried with Outlook Add-in ModuleExtension but cannot seems to be work as expected in outlook web app.
The command controls for invoking add-on are described in manifest part of the add-in. Those controls will be displayed in predefined place of the UI depend on particular client design (Outlook online, Outlook desktop, etc.). As the developer you are able to set control's setting, such as title, icon and so on, but not the place where control will be displayed. This would be up to Microsoft dev/design team.
Bottom line: You are not able to place your control in the specific place of the client interface.
Module extension add-in currently available for Outlook 2016 desktop. There is request to make it available for Outlook online which you can upvote if you like.
Additional Questions:
So is it is not possible right right now?
Module extension add-in for Outlook online is not currently available. To place your control into the place you want is not available, either and never will be. This is because of obvious reasons ... can you imagine what's happen with user interface if every extension will be able to modify the UI as it needs? Total disaster.
Or can you help me with other option ?
Outlook add-in works with single item, as of the controls will appear when item (e-mail, appointment, etc.) selected or compose window invoked, there is nothing you can do.
Also one more thing that is it possible to store a custom global setting value for the outlook organization using addin or any other way?
To store the settings for particular mailbox, user inside organization, there is Office.context.roamingSettings object. If you need some global settings for your app for entire organization, you would set them inside JS part for this particular organization and make the deployment just withing this organization. In case you want to distribute the app via Office store and customize it per organization you may want to write some service which delivers custom settings for add-on on start-up. For example you have rest service which returns custom configuration depend on domain; in this case when add-on invoked you may request custom configuration by sending rest call with user domain and after cache it in mailbox.

Outlook Addin window.open

I´m new to the addins, just want to perform a simple task as creating a button with a link in the taskbar that opens a browser and that´s it.
So far created the project based on ms tutorial and everything is working great (with fixed certificate problems).
To my understand this should be as easy as to create a button with an ExecuteFuncion actions mapping to a javascript function with a window.open
e.g.
function windowOpen(event)
{
window.open("https://www.microsoft.com");
event.completed();
}
Thanks for the help,
Regards,
André
For security reasons, Outlook does not support window.open directly inside of Add-ins. To open a window in an Outlook Add-in you can use the displayDialogAsync API (documentation here.) We recommend this guide to understand end-to-end usage of displaying a dialog in an Add-in.

Easy way to create a form to email in SharePoint without using infopath

Does anyone know a good way to do this? I need to have simple forms that submit to email without writing a lot of code. These forms will be hosted in content-viewer web parts or similar in MOSS 2007. I'd like to avoid using InfoPath.
You could use a list which would give you the input form.
It depends on a) whether people should be able to see each other's submissions and b) who the e-mail should go to.
You could set an alert (Actions -> Alert Me) to send an e-mail to a person/people when a new item is added to the list.
In Settings -> List Settings -> Advanced Settings, there's the options for which items a user can see/edit. Alerts however cannot be set on lists where users can only see their own items. In this case, I would use a simple workflow to send the e-mail. I've only worked with MOSS 2007 and SharePoint Designer though - I'm not sure about WSS.
You could implement a list as suggested above, and add an SPItemEventReceiver for sending emails when list items are added or changed (the link shows all of the events available to be handled)
With the sharepoint sdk, you can create your own webparts. If you add them to the GAC you can include them on your sharepoint site. You'd of course have to build a webpart for emailing though.
A workflow in Sharepoint Designer should be easiest way to implement it with no need to code.
Here's an article that explains how to do this:
Workflow example: Send a notification message :
http://office.microsoft.com/en-us/sharepointdesigner/HA101829081033.aspx
Create a simple HTML form in a text editor with the required text boxes, text areas, select drop downs etc, add a mailto tag and save.
Then add a page viewer web part under Media and content.
Select site actions, Edit page and under the editing tool tab select Format text, HTML Markup edit HTML source and paste your HTML form you created he text editor into the source window and select OK and save.

Resources