Microsoft TS: Visual Studio Tools for 2007 MS Office System (VTSO) - 070-543 Exam Practice Test

You create an add-in for Microsoft Office Word 2007 by using Visual Studio Tools for the
Microsoft Office System (VSTO). The add-in customizes the Ribbon user interface (UI).
The add-in contains a file named Ribbon1.xml that has the following markup for two buttons.
<button id="Btn1" onAction =" DoOperation " />
<button id="Btn2" onAction =" DoOperation " />
You need to create a callback function that runs different code for the buttons.
Which code segment should you use?
Correct Answer: D Vote an answer
You are creating an application for Microsoft Office Word by using Visual Studio Tools for the Microsoft Office System (VSTO). The application will contain a namespace named WordAddInNS.
WordAddInNS will contain the following items:
a class named WordExcelIsland
a method named GetDataIsland
a typed dataset class named WSS_DataSet
You write the following lines of code. (Line numbers are included for reference only.)
01 private void GetDataIsland (string DocPath) {
02 using (ServerDocument sd = new ServerDocument(DocPath)) {
03 CachedDataHostItemCollection HC = sd.CachedData.HostItems;
04 if (HC.Count > 0 &&
05 ...
10 ) {
12 ...
13 }
14 }
15 }
You need to load all the data islands of the type WSS_DataSet from the local document cache.
Which code segment should you insert at line 05?
Correct Answer: B Vote an answer
You develop a document-level solution for Microsoft Office Excel 2003 by using Visual Studio Tools for the Microsoft Office System (VSTO).
You write the following lines of code in the worksheet class.
Private Sub Handle_Change ( ByVal Target As Excel .Range )
...
End Sub
You need to ensure that the Handle_Change method runs only when the data in the range A1 through E5 changes.
Which code segment should you add to the Startup event of the worksheet class?
Correct Answer: C Vote an answer
You are creating an add-in for Microsoft Office Excel by using Visual Studio Tools for the Microsoft Office System (VSTO). The add-in contains an instance of a data island named SalesDataSet. You create an instance of the CachedDataHostItemCollection object named HC in the add-in. You need to load the content from a CachedDataHostItem object in HC into SalesDataSet. Which code segment should you use?
Correct Answer: B Vote an answer
You are creating an add-in by using Visual Studio Tools for the Microsoft Office System (VSTO).
You write the following method. (Line numbers are included for reference only.)
01 Private Sub ExportDocumentCache ( ByVal path As String)
02 ...
03 End Sub
You need to ensure that the add-in saves each item in the document cache of a document to an independent XML file that is named for the item.
Which code segment should you insert at line 02?
Correct Answer: B Vote an answer
You are creating an add-in for Microsoft Office Excel by using Visual Studio Tools for the Microsoft Office System (VSTO). The add-in must connect to a remote database to retrieve data. The structure of the remote database is shown in the exhibit. (Click the Exhibit button.)
You write the following lines of code. (Line numbers are included for reference only.)
01 internal sealed partial class Settings : 02 global::System.Configuration.ApplicationSettingsBase { 03 [ global::System.Configuration.SpecialSettingAttribute ( 04 global::System.Configuration.SpecialSetting.ConnectionString )]
05 ...
06 public string ExcelSQLConnectionString {
07 get {
08 return (string)(this[" ExcelSQLConnectionString "]);
09 }
10 }
You need to connect to the remote database by using the security context of the current user.
Which code segment should you insert at line 05?
Correct Answer: A Vote an answer
You create a document-level solution for Microsoft Office Excel by using Visual Studio Tools for the Microsoft Office System (VSTO). You manually deploy the customized Excel workbook and the associated assembly to a network share named OfficeSolutions. The network share is located on a server named LONDON. You need to remove the reference to the assembly from the copy of the workbook. Which code segment should you use?
Correct Answer: B Vote an answer
You create a document-level solution for Microsoft Office Word 2003 by using Visual Studio Tools for the Microsoft Office System (VSTO). You create a user control named MyUserControl.
You write the following code segment for your document class. (Line numbers are included for reference only.)
01 private void ThisDocument_Startup(object sender,
System.EventArgs e) {
02 MyUserControl userControl = new MyUserControl();
03 ...
04 }
You need to display userControl in the actions pane.
Which code segment should you insert at line 03?
Correct Answer: D Vote an answer
You are creating a document-level solution for Microsoft Office Excel 2003 by using Visual Studio Tools for the Microsoft Office System (VSTO). The customized workbook contains five worksheets. You add a LinkLabel control named Label to the first worksheet of the workbook. You need to create a LinkClicked event handler that displays the next worksheet in the workbook. Which code segment should you use?
Correct Answer: D Vote an answer