Microsoft TS: Visual Studio Tools for 2007 MS Office System (VTSO) (070-543) Free Practice Test
Question 1
You are creating an add-in for Microsoft Office Excel 2007 by using Visual Studio Tools for the Microsoft Office System (VSTO). You write the following code segment for the add-in class.
Dim pane As Microsoft.Office.Tools.CustomTaskPane
Private Sub CreatePane ()
Pane = Me.CustomTaskPanes.Add (New MyUserControl (), _
"Do Something")
pane.Visible = True
End Sub
Users must open multiple workbooks in Excel.
You need to ensure that the add-in displays the same instance of the task pane when a user views any of the open workbooks.
What should you do?
Dim pane As Microsoft.Office.Tools.CustomTaskPane
Private Sub CreatePane ()
Pane = Me.CustomTaskPanes.Add (New MyUserControl (), _
"Do Something")
pane.Visible = True
End Sub
Users must open multiple workbooks in Excel.
You need to ensure that the add-in displays the same instance of the task pane when a user views any of the open workbooks.
What should you do?
Correct Answer: A
Question 2
You are creating a custom template for Microsoft Office Word 2007 by using Visual Studio Tools for the Microsoft Office System (VSTO).
The template contains a custom XML part that consumes data from an XML source. The XML source contains the following XML fragment.
<Products> mother board, memory, hard drive,
floppy drive, DVD drive </Products>
You need to display the Products element as a comma-separated list within a paragraph of text.
Which code segment should you use?
The template contains a custom XML part that consumes data from an XML source. The XML source contains the following XML fragment.
<Products> mother board, memory, hard drive,
floppy drive, DVD drive </Products>
You need to display the Products element as a comma-separated list within a paragraph of text.
Which code segment should you use?
Correct Answer: D
Question 3
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?
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
Question 4
You create a custom template for Microsoft Office Word 2007 by using Visual Studio Tools for the Microsoft Office System (VSTO).
You add two Text content controls named control1 and control2 to the template.
The template contains the following custom XML fragment.
< ProductList >
<Product id="1">
<Name> Chai </Name>
</Product>
<Product id="2">
<Name>Chang</Name>
</Product> </ ProductList >
You need to ensure that control1 displays the id of the Product and control2 displays the name of the Product.
Which code segment should you use?
You add two Text content controls named control1 and control2 to the template.
The template contains the following custom XML fragment.
< ProductList >
<Product id="1">
<Name> Chai </Name>
</Product>
<Product id="2">
<Name>Chang</Name>
</Product> </ ProductList >
You need to ensure that control1 displays the id of the Product and control2 displays the name of the Product.
Which code segment should you use?
Correct Answer: A
Question 5
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 Partial Friend NotInheritable Class Settings
02 Inherits System.Configuration.ApplicationSettingsBase
03 < System.Configuration.SpecialSettingAttribute ( _
04 System.Configuration.SpecialSetting.ConnectionString )>
05 ...
06 Public ReadOnly Property ExcelSQLConnectionString () _
As String 07 Get 08 Return Convert.ToString (Me(" ExcelSQLConnectionString ")) 09 End Get 10 End Property 11 End Class
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?

You write the following lines of code. (Line numbers are included for reference only.)
01 Partial Friend NotInheritable Class Settings
02 Inherits System.Configuration.ApplicationSettingsBase
03 < System.Configuration.SpecialSettingAttribute ( _
04 System.Configuration.SpecialSetting.ConnectionString )>
05 ...
06 Public ReadOnly Property ExcelSQLConnectionString () _
As String 07 Get 08 Return Convert.ToString (Me(" ExcelSQLConnectionString ")) 09 End Get 10 End Property 11 End Class
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
Question 6
You create a document-level solution for Microsoft Office Excel 2003 by using Visual Studio Tools for the Microsoft Office System (VSTO). The Excel workbook contains a worksheet object named Sheet1 that contains data in the range A1 through A5.
You write the following lines of code for the Sheet1 object. (Line numbers are included for reference only.)
01 Dim bMark As Word.Bookmark
02 Dim doc As Word.Document = New Word.Application() ...
03 Dim index As Object = 1
04 Dim bMark As Word.Bookmark = do c.Bookmarks.Item(index)
05 ...
You need to insert the data from the range A1 through A5 into a Microsoft Office Word document after bMark. Your solution must retain the sequence of the data that is inserted.
Which code segment should you insert at line 05?
You write the following lines of code for the Sheet1 object. (Line numbers are included for reference only.)
01 Dim bMark As Word.Bookmark
02 Dim doc As Word.Document = New Word.Application() ...
03 Dim index As Object = 1
04 Dim bMark As Word.Bookmark = do c.Bookmarks.Item(index)
05 ...
You need to insert the data from the range A1 through A5 into a Microsoft Office Word document after bMark. Your solution must retain the sequence of the data that is inserted.
Which code segment should you insert at line 05?
Correct Answer: D
Question 7
You are creating a document-level solution for Microsoft Office Word 2003 by using Visual Studio Tools for the Microsoft Office System (VSTO). The customization contains a predefined schema to validate the data that users add. The path to the schema is stored in a variable named filename. The Unique Resource Identifier (URI) for the schema is stored in a variable named uri. The alias for the schema is stored in a variable named alias.
You need to ensure that the schema that the user selects is applied to the solution document. Which code segment should you use?
You need to ensure that the schema that the user selects is applied to the solution document. Which code segment should you use?
Correct Answer: A
Question 8
You create an add-in for Microsoft Office Excel 2007 by using Visual Studio Tools for the Microsoft Office System (VSTO). The add-in has a custom task pane named MyPane.
MyPane contains a user control named MyUserControl. You write the following method that resizes MyUserControl.
public void ResizeControls () {
//...
}
You need to call the ResizeControls method when MyPane is not docked to the Excel 2007 application window.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
MyPane contains a user control named MyUserControl. You write the following method that resizes MyUserControl.
public void ResizeControls () {
//...
}
You need to call the ResizeControls method when MyPane is not docked to the Excel 2007 application window.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
Correct Answer: C,D