Screen shot of pop-up
Pop-ups can have their place; for example, reminding users of new features on your site
R E L A T E D   C O N T E N T
ADVERTISEMENT

Hands on: Office on the web

More basic Javascript, plus some Office tips for web developers and designers

Nigel Whitfield, Personal Computer World 03 Mar 2008
ADVERTISEMENT

One of our correspondents, Paul Cooper, asked about the pros and cons of writing websites using Microsoft Office tools, such as Word and Excel, after a friend of his said that Office introduces lots of unnecessary elements into your code.

Office bloat
To an extent, that’s true. You can simply save a file as a web page from Word’s file menu. The file opens and displays in the browser, and looks pretty much identical to the Word document. So far, so good. But count the characters and check the properties of the HTML file, and you may well see the text accounts for only a small amount of the size of the file.

Of course there’s always some bloat with HTML, since the tags themselves can be verbose, and you could dispense with style sheets completely and just use a couple of heading styles, and one paragraph style. Even so, it’s clear that what Word produces is not the most compact way of doing things.

To find out why, it’s worth taking a look at the source of the web page that Word produces. First, you’ll see references to the Microsoft Office XML schema, followed by tags telling you which version of Word was used. Then there’s a chunk of XML that contains the document properties, as set via Word’s File menu.

Additionally the author, as set up in your Word installation, will be added – so if you’re writing a critical web page that you intend to post anonymously, don’t use Word without checking the code later to make sure your identity isn’t revealed to all and sundry.

Following the description of the document, there are details about the template used to create it, and then a CSS-style sheet that includes all the font and style definitions used in the document before, finally, the actual text of the web page.

As I’ve mentioned before, there are sound reasons for using CSS in your web pages – it makes them easy to manage. But they can also be verbose and the inclusion of all the styles, even if only a couple are in use, makes the Word-created web page much longer than it needed to be.

For a simple site, you probably don’t need to worry too much about this, but if you start adding multiple pages, you’ll end up with a lot of information duplicated, because Word keeps the style information embedded. With other web-editing tools, such as Dreamweaver, you can easily link to an external stylesheet, where all the information is in a separate file.

That has two advantages; first, it’s only loaded once by the browser, and all the individual pages can be smaller, so your site has to send less data. And second, if you want to give your site a makeover – new corporate colours, perhaps, or a seasonal theme – you just need to change the single stylesheet file, and all the pages that refer to it will update.

Other Office HTML quirks
Compactness isn’t the only reason to use tools other than Microsoft Office for more complex websites. If you turn pages that have pictures in them into web documents, Word will deal with all the pictures for you, creating a folder for each page's images. You can upload them all easily enough but it might not be the way you want to organise your website.

For instance, when I’m doing a site, I tend to group all the images – say product images – into one folder. Then, if I had a set of new pictures, perhaps for Christmas, with products covered in snow, I could just upload them all into the same folder. If Word has created a folder of images for each individual product, it’s potentially going to be a lot fiddlier to sort out, instead of one batch upload.

Word is not the only part of Office that can save as HTML. Excel can do it too, and you’ll often encounter tables on the web that have been created by choosing the ‘Save as a web page' option.

And sometimes they can be utterly confusing; not only is there the same privacy issue as with Word, and the extra information, but one site I regularly look at used to show up another Office flaw well – an Excel spreadsheet listing features of competing products is saved as a web page, and ticks or crosses appear in columns to indicate whether a particular product has a feature.

It all looks great in Excel, and great if you’re a PC user with Internet Explorer; but look at it from a Mac, or some other browsers, and instead of easy-to-understand symbols, you end up with characters of the alphabet that shed absolutely no light on what the table was supposed to tell people in the first place.


All Online

Like this story? Spread the news by clicking below:

Post this to Delicious del.icio.us    Post this to Digg Digg this    Post this to reddit reddit!

Permalink for this story
R E A D E R   C O M M E N T S
M A R K E T P L A C E
Get your free demo of Numara Track-It! 8 - the leading help desk solution for IT related issues.
Make presentations, review documents & share your entire desktop. 30-day free trial! (cc required).
Discover how remote support can fuel your IT business in ways you've never thought of before.
Apply ITIL best practices at your service desk while eliminating integration cost. Learn more here.
WAN based, automated, daily vulnerability assessments. Click here to try and request our whitepapers.
Have your product or service listed here >   
Sponsored links
F E A T U R E D   J O B S
United Kingdom | Advent Computer Training
Are you stuck in a dead end job? Do you want to take control of your salary, life and career? Advent IT and computer training offers advanced, professional training and helps you find the right ... more >
Hertfordshire, United Kingdom | Tesco.com
Solution Architect Lead Hertfordshire Who's behind the world's most successful online retailer?Just over 10 years ago we started Tesco.com (aka Dotcom). Today, we've an incredible 750,000 active customers and sales at just under £1 billion. We ... more >
Berkshire, Reading, United Kingdom | Foster Wheeler
Sharepoint Administrator - Competitive Salary - Reading Foster Wheeler is a leading international project management, engineering and construction organisation with global construction capabilities working on major projects within upstream oil & gas, midstream & LNG, ... more >
Welwyn Garden City, Hertfordshire, United Kingdom | Tesco.com
Middle Tier solution Designer - Welwyn Garden CityWho's behind the world's most successful online retailer? Just over 10 years ago we started Tesco.com (aka Dotcom). Today, we've an incredible 750,000 active customers and sales at ... more >
More job opportunities