by Ramesh Chandak
The browser has revolutionized the way the Internet and Web are accessed. The key to this tremendous success is very simple-an easy-to-use interface coupled with the worldwide network of computers. A product with an easy-to-use interface has been instrumental to the success of several companies. Apple Computer made it big time with the introduction of Macintosh; the Macintosh interface was revolutionary to the people who had been so accustomed to the character-based DOS world. Next followed the Windows 3.1 interface. The most recent wave is the introduction of the browser, which has made it very easy to surf the Internet and the Web. In fact, the hyperlink hot spot concept implemented in the browser was first introduced as part of Hypercard on the Macintosh. But it did not hit the main street until the Web and the browser came together.
What Macintosh and Windows did for the desktop, the browser does for the Net. To begin with, the browser offers point-and-click graphical access to the Net. You can point to a site, link to another site, link to yet another site, and so on. It is the hyperlink capability that makes it so easy. Obviously, users expect more functionality from the browser than just the ability to point and surf! It has become the central point of navigation. It is only natural that a lot of features will be added to the browser in time.
The word processor is probably the most commonly used application in the world today. Again, it is only natural to expect direct links to your word processing documents from your browser. The alternative to this would be to switch to your word processing application, open it, select the document you wish to view, and click OK. This is a tedious and cumbersome task that hampers productivity. It is a lot easier and quicker to click the hot spot on your Web page that represents a word processing document and have it open automatically, without worrying about the format, type, and location of the document.
Along with its other Internet products, Microsoft has announced the release of its ActiveX technology. ActiveX is the level next to OLE. The data transfer technology has come a long way from the days of using Clipboard, to dynamic data exchange (DDE) protocol, to OLE, to now: ActiveX! ActiveX is based on Microsoft's Component Object Model (COM). The COM architecture specifies development of reusable software objects. Such objects can be written in completely different languages. They can reside on completely different platforms across completely different networks. Yet they can communicate and integrate with each other easily. This is the basic premise of the COM theory: creating reusable components that can interact with each other easily, irrespective of their language or location of origin. ActiveX is the result of Microsoft's five-year investment in research and development of the COM specification. Microsoft renamed OLE controls as ActiveX controls in an effort to push their Internet technology and standards aggressively.
ActiveX technology has multiple paradigms. You can create ActiveX controls and integrate them with your Windows applications. You can make your Web pages active by embedding ActiveX controls in them. An ActiveX control can also be downloaded by the user. As a corporate developer, you can create active documents using ActiveX. An active document is an ActiveX control representing Office documents such as Word, Excel, and PowerPoint.
Using active documents is the focus of this chapter. It discusses how you can make your browser a one-stop access point to your word processing, spreadsheet, and presentation documents.
Listing 16.1 shows HTML code for a sample Web page of this book, VBScript Unleashed, also shown in Figure 16.1. All the documents represented by the hot spots are stored in Microsoft Word 6.0 format.
Figure 16.1 : Sample Web page of this book, VBScript Unleashed.
Listing 16.1. HTML for a sample Web page of this book, VBScript Unleashed.
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><HTML><HEAD><TITLE> VBScript Unleashed </TITLE></HEAD><!--DocHeaderStart--><BODY leftmargin=8 bgcolor="#FFFFFF" VLINK="#666666" LINK="#FF0000"><FONT FACE="ARIAL,HELVETICA" SIZE="2"><!--DocHeaderEnd--> <P><h2>VBScript Unleashed </h2><P><!--DATE-->September 1, 1996<P><!--/DATE--> <P><A HREF="vbs18or.doc">Controlling MS Office Documents in web pages<P> <P><A HREF="vbs20or.doc">VBScript and Java<P> <!--DocFooterStart--></FONT><FONT FACE="MS SANS SERIF" SIZE="1" COLOR="BLACK"><A HREF="/Misc/cpyright.htm" target="_top">© 1996 Sams.net</A></FONT><!--DocFooterEnd--></BODY></HTML>
If you click the hot spot VBScript and Java, it opens the document in Microsoft Word 6.0 format within the Internet Explorer window. See Figure 16.2.
Figure 16.2 : A Microsoft Word document within the Internet Explorer window.
If you want to provide read-only access to your Word or Excel documents (such as human resource policies and employee handbooks), you can use the free application viewers (such as Microsoft PowerPoint Viewer, Microsoft Word Viewer, and Microsoft Excel Viewer).
This chapter provides a brief background on ActiveX technology. It focuses on how you can use ActiveX controls and VBScript to integrate Office documents into your Web pages. Although it specifically discusses Microsoft Office Suite products, the concept and steps involved in configuring them apply to other products such as Lotus Suite as well.
It all started with the need for applications to communicate with each other. In the good old days, data would be transferred between documents of the same application or between applications, using our beloved Clipboard. This changed in due course with the advent of dynamic data exchange (DDE) technology. The Clipboard and DDE eventually became the foundation for OLE. Microsoft actively and aggressively promoted this technology. It eventually became the de facto standard on the Windows platform. OLE made it very easy to embed a variety of documents into the host application. For example, a word processing document can contain a chart, graph, and spreadsheet. The word processing document is the container that holds other objects. Using OLE, applications can import information without the need to understand the format and origin of the data being imported. OLE helps improve the user's overall productivity. Users can focus on their tasks at hand and not worry about the format, origin, and location of the data. The popularity and widespread acceptance of OLE technology created a new industry, developing OCX controls. Hundreds of thousands of shareware and commercial OCX controls are available in the market today.
Having received a wake up call from Netscape and the wired community worldwide, Microsoft announced its own Internet strategy. In addition to introducing a variety of products and services aimed at Internet and intranet development, Microsoft seized this opportunity to promote its ActiveX technology. ActiveX is OLE and much more! ActiveX is OLE redefined for the Internet, and it goes beyond that. Traditional OCXs are large files, not suitable for deployment, and download over the Net. ActiveX is OLE optimized for the Net. It is all-encompassing. You can create ActiveX controls. Such controls can be integrated with your Web and other client/server applications. They can also be downloaded over the Net. Just as you have had hundreds of thousands of VBXs and OCXs integrate with your applications, built using programming tools such as PowerBuilder and Visual Basic, you now have ActiveX controls ready to be integrated with your Web, desktop, and network applications. With ActiveX you can also create active documents. Active documents are ActiveX controls representing Office documents such as Word, Excel, and PowerPoint. You can do ActiveX scripting. ActiveX scripting is writing scripts, using VBScript and ActiveX controls.
At the time of this writing, Microsoft is giving away a suite
of ActiveX controls for the Internet. It is called the Internet
Control Pack (ICP) and is available for download at http://www.microsoft.com/icp/us/icpdown/icpdown.htm.
You can use these controls to develop your Internet and intranet
applications quickly and easily.
NOTE |
Microsoft Internet Control Pack includes the following: |
ActiveX is presently supported on the Windows platform. ActiveX
on the Macintosh and UNIX platforms is expected by the end of
1996. Microsoft and Metrowerks are working together to include
ActiveX support on the Macintosh. Microsoft, Mainsoft, and Bristol
are working together to include ActiveX support on the UNIX platform.
Microsoft Internet Explorer 3.0 is the only browser on the market
today that includes full support for ActiveX and VBScript technology.
You can use ActiveX controls with Netscape Navigator 3.0 if you
use the ActiveX plug-in from NCompassLabs (http://www.ncompasslabs.com),
a third-party software vendor.
NOTE |
To stay current with ActiveX technology, visit Microsoft's ActiveX Web site at http://www.microsoft.com/activex. |
ActiveX scripting is writing scripts, using a scripting language such as VBScript, JavaScript, and AppleScript, as well as ActiveX controls. You can integrate any type of object, including ActiveX objects, into your Web pages using the HTML <OBJECT> extension. The ability to integrate ActiveX objects lets you create active Web pages. Such Web pages can be dynamic and interactive in nature. Gone are the days of static Web pages where the surfer could only point, click, and read. You can now add animation and 3-D virtual reality experience to your Web pages and liven them up! If you are a corporate developer, you can integrate ActiveX controls that represent your Office documents on the intranet server. This lets users open Word, Excel, and PowerPoint documents directly, using their browser.
You can write ActiveX controls using programming tools such as Visual C++ and Borland C++ (the same tools that are used to write DLLs and OCX controls). Microsoft has released the ActiveX SDK, a Windows toolkit for Internet and intranet software development. In fact, the Microsoft Internet Explorer 3.0 is written completely using ActiveX SDK. Alternatively, you can buy third-party ActiveX controls developed by Microsoft and other independent software vendors.
You can download Microsoft's freebies-a suite of ActiveX controls-from
its ActiveX home page (http://www.microsoft.com/activex).
Table 16.1 lists descriptions of several of these controls.
Name of control | Description |
StockTicker | Continuously displays changing data. The control downloads the URL specified at regular intervals and displays that data. The data can be in text or XRT format. |
Label | Displays given text at any specified angle. It can also render the text along user-defined curves. |
Marquee | Scrolls, slides, and/or bounces URLs, within a user-defined window. |
Chart | Enables you to draw various types of charts with different styles. |
Timer | Invokes an event periodically and is invisible at runtime. |
Listing 16.2 shows the object declaration for the chart control.
Listing 16.2. Object declaration for Microsoft's ActiveX chart control.
<OBJECT classid="clsid:FC25B780-75BE-11CF-8B01-444553540000" id=chart1 width=400 height=200 align=center hspace=0 vspace=0 > <param name="hgridStyle" value="3"> <param name="vgridStyle" value="0"> <param name="colorscheme" value="0"> <param name="DisplayLegend" value="0"> <param name="BackStyle" value="1"> <param name="BackColor" value="#ffffff"> <param name="ForeColor" value="#0000ff"> <param name="Scale" value="100"> <param name="url" value="http://www.mycompany.com/chart.txt"> </OBJECT>
ActiveX Control Pad is yet another Microsoft application. You can use it to design and develop your Web pages visually. Figure 16.3 shows the ActiveX Control Pad.
Figure 16.3 : The ActiveX Control Pad.
The Control Pad provides a visual way of accomplishing ActiveX scripting. Using the Pad, you can visually insert an ActiveX control into a Web page. Use the Edit | Insert ActiveX Control option to insert an ActiveX control. Figure 16.4 shows the Insert ActiveX Control dialog box.
Figure 16.4 : Inserting an ActiveX control in your Web page using ActiveX Control Pad.
Choose the appropriate control and click OK. The Properties dialog box is displayed. See Figure 16.5.
Figure 16.5 : The ActiveX control properties dialog box.
Use this dialog box to set the properties of the control per your application requirements. After you finish specifying the properties, close the Properties dialog box. The corresponding <OBJECT> code is added within your HTML code.
The following list outlines the steps required to include the ability to open Office documents such as Word, Excel, and PowerPoint within your browser window:
Figure 16.2, earlier in this chapter, shows an example of a Microsoft
Word document within the Internet Explorer window.
NOTE |
If you do not have Microsoft Word installed on your system or on the Web server, you cannot view the word processing documents from your browser. The presence of the host application on the desktop or the network is required. |
NOTE |
Office viewers are available for download from Microsoft's Web site: http://www.microsoft.com. |
NOTE |
Viewers are also helpful if you have not upgraded from version 2.0 to version 6.0 or 7.0. If you are still using Microsoft Word 2.0 for Windows and plan to upgrade later, you can use the Word Viewer for Windows in the meantime. The Word Viewer takes less resources than the full application and lets you view and print Word 6.0 documents. If you receive Word 6.0 documents from different sources, you can view and print them. Your Word 2.0 documents are upward-compatible with Word 6.0 for Windows. |
Microsoft Office Suite is the most popular software application package today. A number of corporations have invested in the Office Suite and used it to create a variety of documents, including reports, presentations, spreadsheets, and so on. These documents are the result of several man hours of work and effort that has been put in over the past several years. If you are building a company-wide intranet for your organization, it is highly beneficial if you provide easy access to such documents to your users. The popularity of the browser and the ability to use it as a one-stop point to access information from both the Internet and intranet makes it a natural candidate for linking it with your company documents.
Let us take a step back and review the OLE technology. Using OLE, you can embed a Microsoft Excel spreadsheet, for example, within your Microsoft Word document. This lets you open an Excel spreadsheet by double-clicking it within your Word document without having to explicitly open Microsoft Excel. In addition to spreadsheets, you can embed Word, PowerPoint, and other OLE-enabled documents. This improves productivity, because you don't need to worry about the format and location of the documents or the application needed to open such documents. Listing 16.3 shows the HTML code for a Web page displaying three types of documents: Microsoft Word, Microsoft Excel, and Microsoft PowerPoint. Figure 16.6 shows the resulting Web page. Notice the hot spots on the Web page. They do not really indicate the format of the document. If you click any hot spot, the appropriate application opens the document referenced.
Figure 16.6 : A simple Web page with hot spots to Word, Excel, and PowerPoint documents.
Listing 16.3. HTML for a Web page displaying three types of documents.
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><HTML><HEAD><TITLE> VBScript Unleashed </TITLE></HEAD><!--DocHeaderStart--><BODY leftmargin=8 bgcolor="#FFFFFF" VLINK="#666666" LINK="#FF0000"><FONT FACE="ARIAL,HELVETICA" SIZE="2"><!--DocHeaderEnd--> <P><h2>VBScript Unleashed </h2><P><!--DATE-->September 1, 1996<P><!--/DATE--> <P><A HREF="order.doc">This is a Microsoft Word document<P> <P><A HREF="revenuesxls">This is a Microsoft Excel document<P> <P><A HREF="vbscript.ppt">This is a Microsoft PowerPoint document<P> <!--DocFooterStart--></FONT><FONT FACE="MS SANS SERIF" SIZE="1" COLOR="BLACK"><A HREF="/Misc/cpyright.htm" target="_top">© 1996 Sams.net</A></FONT><!--DocFooterEnd--></BODY></HTML>
Using the browser as the one-stop point to access the Office documents helps improve productivity and provide an easy-to-use interface. Again, you don't need to worry about the format of the documents and the applications needed to open such documents. If your browser were not able to open your Office documents, you would have to switch from your browser window to your Windows desktop, open Microsoft Word or Microsoft Excel, open the application, and use the File | Open menu command to open the document of interest. Imagine if you had to do this for each and every Office document! It is a multistep process that affects productivity adversely.
The ability to provide access to your Office documents from the Web browser lets you leverage your investment in the Office Suite and documents created using it. You get an easy and simple to use access point and at the same time retain your investment in the office documents.
Integrating your browser with Office documents also lets you initiate
some creative applications for your corporation. If your corporation
has been distributing employee handbooks for several years, you
can port the employee handbook onto your company-wide intranet.
You can use Office Suite to create the electronic form of the
employee handbook. Your company employees can view it using the
browser. Similarly, the human resource department of your company
can place its policies handbook on the intranet. These solutions
offer significant cost savings. The cost of maintenance reduces
substantially. Every year you can update your intranet-based employee
and human resource policy handbooks easily and quickly. It virtually
eliminates the cost of printing and distribution of such handbooks.
NOTE |
Using an intranet for document sharing with a browser is more cost-effective than a specialized solution such as using Lotus Notes. Using a browser provides an easy-to-use, universal interface. It reduces the learning curve for the users. Using Lotus Notes requires investment of time and money in learning how to use and deploy it effectively. |
The Microsoft Office Suite is presently the most popular application
in the marketplace. It offers a complete solution for your day-to-day
business needs. New features such as the binder help you integrate
your Word, Excel, and PowerPoint documents seamlessly into one
document. On the other hand, the browser is presently the most
popular user inteface in the marketplace. Its hyperlink capabilities,
combined with the ease of use and presentation, makes it a great
interface for navigating the Internet and intranet. It also make
a great interface for browsing your desktop. In fact, there are
indications that Microsoft is planning to integrate the browser
interface into the next release of its Windows operating system
and do away with the Windows Explorer and File Manager style interface.
It remains to be seen if and when such technology becomes available.
If your company has standardized on Microsoft Office Suite applications
but has some Lotus or WordPerfect documents, you can still view
them using your Office Suite applications. This is discussed in
detail later in this chapter.
NOTE |
Following are a few guidelines to follow when setting up your intranet for viewing Microsoft Office Suite documents using your favorite browser. |
When you open a Word or Excel document from your browser, a local
copy is opened. The master copy resides on the server. Therefore,
any changes made are reflected only in the local copy and not
in the master copy. Using your browser to read Office documents
promotes collaborative work. Documents can be shared between group
members freely and easily. For example, if you are working on
a sales spreadsheet and the sales data should be made available
to everyone else in your group, you can upload its copy onto the
server. The uploaded document becomes available to everyone else
in the group who can access it directly from their Web browser.
NOTE |
Because the document opened by the browser is a local copy, this setup does not support collaborative work in the true sense. It is still a very cost-effective solution, compared to the price points of some specialized groupware applications such as Lotus Notes. |
NOTE |
If the browser displays an error message indicating it cannot load the Microsoft Word document, try this: Applications such as Word for Windows are very resource-hungry. |
NOTE |
Make sure you have set the right access for the network directories that contain the Office documents. If you want to provide read-only access to these documents, make the directory read-only. |
NOTE |
Microsoft's Internet Assistants for Word, Excel, and PowerPoint help you convert word processing, spreadsheet, and presentation documents into HTML and vice versa. These Internet assistants can be downloaded from Microsoft's Web site. |
Table 16.2 lists a few relevant Web sites. There are plenty of
resources and examples available on the Net.
Site Name | Site URL |
Microsoft | http://www.microsoft.com/activex |
ZD Net | http://www.zdnet.com/activexfiles/ |
ActiveX Developer Support | http://activex.adsp.or.jp/ |
CMP Media Inc. | http://www.activextra.com/ |
Microsoft Office is the most popular Office Suite product in the market today. Office products including Word, Excel, and PowerPoint have been in use since before the introduction of the browser. By extending your browser to access Word, Excel, and PowerPoint documents, you can leverage your investment in Office products and provide an easy-to-use, one-stop interface to your users. This boosts productivity tremendously.
Keep in mind the following guidelines when configuring your intranet for viewing Microsoft Office Suite documents using your favorite browser:
If you want to provide read-only access to your documents, consider using the free application viewers from Microsoft. They can be downloaded from Microsoft's Web site: http://www.microsoft.com.
This chapter discussed how you can use ActiveX Control Pad to integrate ActiveX controls into your Web pages. Microsoft Internet Explorer 3.0 includes full support for VBScript and ActiveX controls.
From here, refer to the following chapters for further reading: