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

Using Web Services in Word

Word uses the same facilities as Excel and Access, though it’s a bit tougher to see how web services fit with Word. Unlike spreadsheets or databases, word processors rarely have discrete fields for entering particular data, and users don’t typically expect calculations to happen (except perhaps for spell-checking) as they work on a document. Still, if you’re reading this section you may have a critical use case in mind, so it’s worth exploring how to integrate web services with Word.

Tip

One new feature of Word, the Research Pane, makes heavy use of web services. Unfortunately, it does so by requiring people who want to provide information to the Research Pane to create web services that meet the pane’s expectations. Creating web services is far beyond the scope of this book, but a tutorial on creating services for the Research Pane with Visual Studio.NET is available at http://www.devx.com/codemag/Article/18214?trk=DXRSS_XML.

To demonstrate, the example uses a form letter, combining some regular text with text form fields entered from Word’s Forms Toolbar. (The Insert Fields menu option only lets you enter fields with calculated values, so the Forms Toolbar is definitely the way to go.) The form letter looks like Figure 9-23; hopefully your own form letter will be slightly more normal.

Adding the USZip service to the Word document

Figure 9-23. Adding the USZip service to the Word document

Making ...

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