Let the button open a new window

I want to add a button under the tab of my add-in, and clicking on the button should open the URL in a new window or in a dialog box. I tried the following:

<Group id="Contoso.Tab1.Group2"> <Label resid="Contoso.Tab1.GroupLabel" /> <Icon> <bt:Image size="16" resid="Contoso.TaskpaneButton3.Icon" /> <bt:Image size="32" resid="Contoso.TaskpaneButton3.Icon" /> <bt:Image size="80" resid="Contoso.TaskpaneButton3.Icon" /> </Icon> <Control xsi:type="Button" id="Contoso.TaskpaneButton3"> <Label resid="Contoso.TaskpaneButton3.Label" /> <Supertip> <Title resid="Contoso.TaskpaneButton3.Label" /> <Description resid="Contoso.TaskpaneButton3.Tooltip" /> </Supertip> <Icon> <bt:Image size="16" resid="Contoso.TaskpaneButton3.Icon" /> <bt:Image size="32" resid="Contoso.TaskpaneButton3.Icon" /> <bt:Image size="80" resid="Contoso.TaskpaneButton3.Icon" /> </Icon> <Action xsi:type="ShowTaskpane"> <TaskpaneId>Button3</TaskpaneId> <SourceLocation resid="Contoso.Taskpane3.Url" /> </Action> </Control> </Group> ... ... <bt:Url id="Contoso.Taskpane3.Url" DefaultValue="https://www.stackoverflow.com/" /> 

The problem is that she is still trying to open this link in the taskbar, and not in a new window or dialog. Does anyone know how to change the manifest to achieve this?

0
source share
1 answer

after googling about office dev, I found that you can change the action tag to something like

 <!-- This is what happens when the command is triggered (Eg click on the Button). Supported actions are ExecuteFunction or ShowTaskpane. --> <Action xsi:type="ExecuteFunction"> <FunctionName>doSomethingAndShowDialog</FunctionName> </Action> 

check the following link, it may be useful

https://github.com/OfficeDev/Office-Add-in-Dialog-API-Simple-Example

0
source

Source: https://habr.com/ru/post/1270450/


All Articles