2006-02-12
| Table of Contents: |
| Rate This Article: | Add This Article To: |
( Page 2 of 4 )
Microsoft is positioning its Microsoft Office System as a full-fledged platform for building Smart Clients. This strategy makes a lot of sense; after all, over 90% of desktops have a version of Office installed. Office is a well-known application, and people are familiar with its interface. Office users typically can adopt new applications that are hosted within the Office applications, and oftentimes they don't even realize they are interacting with an extension of Word, Excel, Outlook, etc.
A key component of Microsoft's Smart Client architecture is an application's ability to interact with online data made available through Web services and then store the retrieved data on the desktop for later use. This architecture makes it possible to incorporate data from disparate systems (both internal and external to an organization) into the processes and documents already in place. The popularity of "Software as a Service" applications (SAS) like SalesForce.com will increase this need because, at the end of the day, most users want to incorporate their data into an Office application.
In this article, I explain how to automate the creation of a Work Order document inside Word. This document retrieves data retrieved from a SalesForce.com account and inserts relevant data into the appropriate locations of the document... without manipulating the Word Object Model. Best of all: this can be achieved with less than 250 lines of code, because Visual Studio Tools for Office does most of the work.
Work Order Template: For this article, I downloaded a Work Order template from the templates section of Office Online. I recommend you download the same file and use it as the document for this solution. The document is available here. This file is also included withthe article's source code .
Creating the Project in Visual Studio
Open Visual Studio, and create a new project: select Office as the project type, and Word Document as the project template. Name the project WorkOrder and select a location for the project on your file system. When asked, specify "Copy an existing document," and browse to the location of the Work Order document template. Select the document, and click OK to build the project.
Salesforce.com Developer Account: If you are going to access Salesforce.com data, it only makes sense that you have an account. Fortunately, Salesforce.com provides a free developer account to anyone that asks. To complete this application, you need to create an account and download the account's Web Service Description Language file (Enterprise.WSDL.xml). This file is used to create a reference to the Salesforce.com APIs.Create your account here. Once you have an account, you can download the
Enterprise.WSDL.xmlfile associated with your account by completing these steps:
- Login to your SalesForce.com developer account
- Select Setup > Integrate > Download your organization-specific WSDL
- Download the
Enterprise.WSDL.xmlfile to your file system.
Once Visual Studio stubs out the project, you need to add a reference to your Salesforce.com account. Select "Add Web Reference" from the Project menu. In the "Add Web Reference" dialog, input the location of your enterprise.wsdl.xml file, and name the web reference Sforce1. Click "Add Reference." Once Visual Studio completes the process of building the reference, you are ready to build the solution.
![]() |
|


