Dim resPortfolio As Portfolio ' Create a portfolio Dim resItem As PortfolioItem ' Define a portfolio item Dim resChapter As PortfolioItem ' Define another portfolio item resChapter.SetType(0) ' Set the 2nd portfolio item as a chapter resChapter.SetTitle("Chapter 1") ' Set the chapter's title resPortfolio.Add(resChapter) ' Add chapter to the portfolio resItem.SetType(1) ' Set the portfolio item as a tab definition resItem.SetTitle("A. Add one question to Rows and Columns") ' Set the tab definition's title resItem.TabDef.ReadTabTemplate("Askia Simple") ' Set a tab template to use from the library ' We must avoid using variable shortcuts as the script is no longer generic. resItem.TabDef.Rows.Add(^S1^) ' Example only. Use Tags or Question Types instead resItem.TabDef.Columns.Add(^S2^) ' Example only. Use Tags or Question Types instead resPortfolio.Add(resItem, resChapter) ' Add tab definition to the chapter ' Switch save location to same directory as survey file resPortfolio.Save(Survey.Directory + "A. Add one question to Rows and Columns.xml") resPortfolio.Open() ' Open the portfolio