With that being said, one of the common scenarios I have seen is where a link to a list view (either in a Summary Link Web Part, or Content Editor Part, etc.) is clicked and the resulting page doesn’t have any actions until the user clicks on an item. At which point, the context of the user action has changed and the appropriate tab is selected. Fortunately for the SharePoint power user, there is an easy way to circumvent this end-user frustration.
We can set the active tab when the view is loaded by providing the InitialTabId variable to the querystring and setting its value to the ID of a Ribbon tab on the page. For example, setting the Documents tab active on a view in a Document Library can be accomplished like so: http://server/DocumentLibrary/AllItems.aspx?InitialTabId=Ribbon.Document.
Now, you may be asking: “The Ribbon tabs are different based on the type of list. How do I find the ID of the tab?”. Excellent question. If you are a SharePoint power user and you do not have access to the hive, you can’t really root around in CMDUI.xml to find the Ribbon tab ID. However, you can use Internet Explorer to find the tab ID!
Scenario: I want the Events tab to be the active tab when a Calendar list view is displayed.
Perform the following steps:
Using this technique, you can quickly and non-invasivly set focus to a Ribbon tab in SharePoint without code.1 comment