Coding in VB.NET

We’re finally ready to begin writing the actual code, a task more tedious than difficult. The ISmartDocument interface is cumbersome, requiring numerous steps to set up the task pane controls. A bit of planning before beginning to actually write the code can be very beneficial. Here’s what you’re going to need to know:

  • the number of XML elements that will have actions associated with them

  • the actual name of each of those elements (including namespace)

  • The caption to be associated with each of those actions

  • The number of individual controls that will be used in each action

  • The name to be associated with each control

  • The caption to be associated with each control

  • The type (C_TYPE) to be associated with each control

  • The location of any external document fragments or images

  • The actual copy for document fragments that will be coded within the .dll

  • Help content for each control (either embedded within the .dll or external file references)

  • The individual choices for any list boxes, combo boxes, and radio groups

  • A description of each control’s behavior

In order to write code that will integrate all of this, we’ll review some of the basic features of the Word object model in conjunction with Visual Basic. Each of these specific tasks is explained in more detail below.

Creating a New Project

Creating a Smart Document project in Visual Studio is a straightforward task. If you are familiar with the Microsoft Office development environment, you might anticipate being able to use Visual ...

Get Office 2003 XML now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.