O'Reilly logo

Office 2003 XML by Evan Lenz, Mary McRae, Simon St. Laurent

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required