How to change the group position of an Add-in inserted into a default office tab? - ms-word

I have created an Office Add-In for Word, and the icon is placed into the Insert tab, but by default it is in the very last position on the ribbon. I want my group to be placed in the first position of the tab, before Pages (this appears to be the first group by default). Is there something I can add into the manifest XML file to place the group at the start of the tab?
My manifest file currently looks something like this:
...
<ExtensionPoint xsi:type="PrimaryCommandSurface">
<OfficeTab id="TabInsert">
<Group id="MyCompany.MainGroup">
<Label resid="MyCompany.MainGroup.Label" />
<Icon>
...
</Icon>
<Control xsi:type="Button" id="MyCompany.ActionButton">
<Label resid="MyCompany.ActionButton.Label" />
...
</Control>
</Group>
</OfficeTab>
</ExtensionPoint>
...
I would imagine that if this is possible, there should be something I can add underneath the Group element, but I don't see anything relevant in the documentation. On the other hand, absence from the documentation doesn't mean it doesn't exist, since the Icon element is not listed there either, and without it my Add-In doesn't load.
The other element I can imagine a suitable option would exist is on the ExtensionPoint (documentation), but I don't see anything suitable there either.

This is not possible. The add-in buttons would always come after the default office ribbon controls. The only way where you can insert them at the beginning of the line would be to create a custom tab.

Related

Add aria-hidden to Title element

I am trying to make a business critical SAPUI5 application more accessible using screen readers by adding ARIA labels and landmarks. One issue is that some SAPUI5 elements such as sap.m.Title's without text have been used (abused) for layout purposes. I would like to add the aria-hidden attribute or a SAPUI5 analogue to these Title elements. But I can't figure out how to do this. I would like to change
<Title text="" class="title" />
into
<Title aria-hidden="true" text="" class="title" />
But setting aria-hidden on the Title like this seems to be invalid. How would I go about setting a standard HTML attribute on a SAPUI5 control?
Thank you in advance for your help!
Joshua

How Can You Align a Grid Row to the Top and Bottom and Have the Middle Fill the Rest of the Screen

I'm trying to build a UI where there's a small section that's always at the top of the page, and a small section that's always at the bottom. The middle section I want to have fill up the entire rest of the page height. I thought it would be something like the XAML below but it's not working - the middle section never fills up the available space. Was hoping someone could point out what I'm doing wrong. Simplified markup below:
<Grid RowDefinitions="60,*,60" ColumnDefinitions="*">
<HorizontalStackLayout Grid.Row="0" Grid.Column="0">
<!-- top stuff here -->
</HorizontalStackLayout>
<VerticalStackLayout Grid.Row="1" Grid.Column="0" VerticalOptions="Fill">
<!-- middle section here -->
</VerticalStackLayout>
<Grid Grid.Row="2" Grid.Column="0">
<!-- bottom section here -->
</Grid>
</Grid>
NOTE: When pasting into this question the editor strips out the closing <//Grid> tag.
When in doubt, use ..AndExpand to be sure all space is used.
<Grid RowDefinitions="60,*,60" ColumnDefinitions="*"
VerticalOptions="FillAndExpand" >
...
<VerticalStackLayout Grid.Row="1" VerticalOptions="FillAndExpand" ...
UPDATE
Actually, your original code does what it should for me, testing on both Windows and Android, when I set MainPage = new MainPage(); and have that code in MainPage. With a BackgroundColor on the middle part, so I can see it expand as desired.
So, what is different in your setup?
Are you using AppShell?
Testing on platform other than Windows or Android?
You didn't test the "simplified markup" you show, so the problem is elsewhere in your actual markup?

Hide/show urls in form view in openerp

I am trying to put a link to download docs files in form view. I already have the links and I made a custom web controller that actually does the download but the problem is that they present in every part of the view. I want it to appear based on specific condition where the state field of an applicant is set to a specific value similar to buttons in form view.
Bellow is an example of a button that appears based on the state condition:
<button name="action_open_agreement_form" type="object" string="P020 Declaration and undertaking" attrs="{'invisible':[('state','!=','done')]}"/>
this allows me to show a button if the state of the applicant is not done.
The link I have is as bellow in the xml
<record model="ir.ui.view" id="view_sefarer_applicant_form">
<field name="name">Jobs - Recruitment Form</field>
<field name="model">seafarer.applicant</field>
<field name="arch" type="xml">
<form string="Jobs - Recruitment Form" version="7.0">
...
<sheet>
......
<div class="oe_right oe_button_box">
....
P014 Drug/Alcohol Delcaration
.....
</div>
</sheet>
.....
I need to use something like attrs but it is not working, I also tried to use javascript with on window load or document ready but that's not working too. I also tried desperate things like having a button with attrs with the condition and having a onclick action on it that clicks the link and having the link hidden but that didn't work as well.
I am pretty desperate and any help would be appreciated.
You can make an entire div invisible based on group membership or field content (such as state), or you can put the links in fields, and make those invisible using the same criteria.

Edit Word Tooltips

How I can edit the box that comes out when you move the cursor over an icon. Within the menus of Word or a macro. I have tried all the options offered by Word, even Visual Basic scripts. I searched but have not been successful. Thanks in advance.
In Word 2007 or Word 2010, the tooltips (popup text on toolbar icons) are specified in the Office XML file.
Put your macros in a .docx or .dotx file that will be an addin.
Use the tool described here to add an XML part to that .docx or .dotx document.
In the XML part, describe whatever buttons or other controls you may want on a toolbar. The documentation here tells you about the XML you can use. To change the tooltip, set the screentip and supertip fields. An example XML file is:
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon startFromScratch="false">
<tabs>
<!-- Your tabs and controls go here -->
<tab id="CustomTab" label="My Tab">
<group id="SampleGroup" label="Sample Group">
<button id="Button1" label="My Large Button"
size="large" onAction="ThisDocument.MyButtonMacro"
screentip="***The text you want to change*** (above the line)"
supertip="***The text you want to change*** (below the line)" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>
and you can change any of the text in double-quotes "...".
Part 2 of the MSDN article has a reference for all the fields you can set.

How to display everyone of the label and the radio choices in its own line?

I'm using Struts2. By default, when using the struts form, the label and the choices are displayed in the same line. How can I do to make the label in a line, and every radio choice in its own line? Is there a way by CSS? I need your help guys. Here it is how my form looks like. Thank you!
<s:form action="resultAction" namespace="/">
<s:radio label="Gender" name="yourGender" list="genders" value="defaultGenderValue" />
<s:submit value="submit" name="submit" />
</s:form>
Which theme are you using as by default struts2 use xHtml theme and which generate certain set of Tables to render the view.
Struts2 use free-marker template to render the HTML for tags and you can customize theme as per your choice or can create you rown theme.
Try with simple theme which will not generate any table or div and will render plain HTML for you are you have all way to apply your custom CSS to change/customize the view.
You can set the theme per page basis on for the whole application for per page basis add the following line in the head section
<s:set name="theme" value="'simple'" scope="page" />
for whole application you can either set in struts.properties file or in struts.xml file though the second one is more preferable.
<constant name="struts.ui.theme" value="simple" />
If you want to play with theme here is the link for same
struts-2-themes