| Exam Code/Number: | 70-543Join the discussion |
| Exam Name: | TS: Visual Studio Tools for 2007 MS Office System (VTSO) |
| Certification: | Microsoft |
| Question Number: | 120 |
| Publish Date: | Aug 21, 2026 |
|
Rating
100%
|
|
You are creating a document-level solution for Microsoft Office Word 2003 by using Visual Studio Tools for the Microsoft Office System (VSTO). The document is customized to add a toolbar with custom functionality. You write the following lines of code in the Startup event of the ThisDocument class.
Dim toolbar As Office.CommandBar = Me.Application . _ CommandBars.Add (Name:=" MyToolBar ", _ Position:= Office.MsoBarPosition.msoBarTop , Temporary:=False)
Dim button As Office.CommandBarButton = _ CType ( too lbar.Controls.Add ( _ Type:= Office.MsoControlType.msoControlButton , _ Temporary:=False), Office.CommandBarButton )
Dim btnClick As _ Office._CommandBarButtonEvents_ClickEventHandler = _ AddressOf Me.button_Click
AddHandler button.Click , AddressOf Me.b utton_Click The event handler for the button does not execute every time CommandBarButton is clicked.
You need to ensure that the event handler executes every time CommandBarButton is clicked.
What should you do?
You are creating an add-in project for Microsoft Office by using Visual Studio Tools for the Microsoft Office System (VSTO). You create a data source named ContactRef from a class in an assembly. The author digitally signs a new version of the assembly. You need to ensure that the add-in can load a new version of the assembly. What should you do?
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.)
You create a custom template for Microsoft Office Word 2007 by using Visual Studio Tools for the Microsoft Office System (VSTO). You add a content control to the custom template. The content control is a placeholder for the first paragraph in the documents that use the custom template. You need to ensure that the users can edit the first paragraph but cannot delete it. Which code segment should you use?
You are creating an application by using Visual Studio Tools for the Microsoft Office System (VSTO). The application contains the following objects:
a DataSet object named OrderData
a ServerDocument object named sd1
You write the following lines of code. (Line numbers are included for reference only.)
01 Dim stringIn As System.Text.StringBuilder = _
New System.Text.StringBuilder ()
02 Dim stringOut As System.IO.StringWriter = _
New System.IO.StringWriter ( stringIn )
03 ...
04 sd1.Save()
You need to store the contents of the OrderData object in the document cache for offline use.
Which code segment should you insert at line 03?