I have taken 'inspiration' from Matt's switching views script, and managed to get something that does what I need i.e. allows me to dictate which order the links appear in. Here is the rather clumsy, but working, script:
<html>
<head>
<script language="JavaScript">
var XDocument;
var View;
function PrintLinks()
{
// Get a reference to the XDocument object for the InfoPath Form.
XDocument = window.external.Window.XDocument;
// Set the reference to the View object.
View = XDocument.View;
}
</script>
<style type="text/css">
.newStyle1 {
font-family: Verdana;
font-size: xx-small;
}
</style>
</head>
<body onload="PrintLinks()" class="newStyle1">
<div id="ViewLinks"></div>
<a href='#' OnClick=View.SwitchView("InitialCaseCreation")>1. Initial case creation</a><br /><br />
<a href='#' OnClick=View.SwitchView("EngagementAcceptance")>2. Engagement Acceptance</a><br /><br />
<a href='#' OnClick=View.SwitchView("EngagementAcceptancePrintview")>3. Engagement Acceptance - Print view</a><br /><br />
<a href='#' OnClick=View.SwitchView("HeaderPage")>4. Header page</a><br /><br />
<a href='#' OnClick=View.SwitchView("DebtorDetails")>5. Debtor details</a><br /><br />
<a href='#' OnClick=View.SwitchView("Employment")>6. Employment</a><br /><br />
<a href='#' OnClick=View.SwitchView("Directorships")>7. Directorships</a><br /><br />
<a href='#' OnClick=View.SwitchView("TradingPartnerships")>8. Trading, Partnerships, etc</a><br /><br />
<a href='#' OnClick=View.SwitchView("Assetsinputtable")>9. Assets (input table)</a><br /><br />
<a href='#' OnClick=View.SwitchView("AssetsHeritageCurrentResidency")>10. Assets Heritage, Current Residency, etc</a><br /><br />
<a href='#' OnClick=View.SwitchView("IncomeBenefitandExpenses")>11. Income, Benefit and Expenses</a><br /><br />
<a href='#' OnClick=View.SwitchView("IandEguidance")>12. I and E Guidance</a><br /><br />
<a href='#' OnClick=View.SwitchView("Liabilities")>13. Liabilities</a><br /><br />
<a href='#' OnClick=View.SwitchView("Recall")>14. Recall</a><br /><br />
<a href='#' OnClick=View.SwitchView("SupplementaryQuestionnaire")>15. Supplementary questionnaire</a><br /><br />
<a href='#' OnClick=View.SwitchView("PrintView")>16. Print view (4-15 excl 12)</a><br /><br />
</body>
</html>
DarrylGould:Hi Ted I have, and it's brilliant. The problem is that you lose control of the order the views appear in. I want to put them in a certain order, so I was planning to create a new pane. Thanks Darryl