This article may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. To maintain the flow of the article, we've left these URLs in the text, but disabled the links.


MIND


GEEK

Robert Hess

GEEK I have been designing Web sites using Microsoft® FrontPage® to load sound files. When my sites are loaded with a Netscape browser, I lose the sound. Is there any code I can place on the site to enable Netscape to play my sound files?
GEEK I personally find that the sound of a MIDI or WAV file playing in the background as I read a Web page is about as comforting as the sound a dentist's drill makes when he's trying to grind a really tough cavity out of your teeth. While I suppose there are some Web sites that make proper and appropriate use of background sounds, I can't think of any at the moment. However, that doesn't answer your question.
      The problem most likely stems from how the sound is added to your page. Microsoft Internet Explorer has supported the <BGSOUND> tag since version 2.0; it provides an extremely easy (too easy, in fact) way to add sound files to your page. Unfortunately, Netscape doesn't seem to support this (and hopefully never will). They do, unfortunately, provide another mechanism to add background sound files. By layering the two methods, you should be able to support sound in either Navigator or Internet Explorer.


 <embed
     src="PathToMusic.mid"
     autostart="true" hidden="true" loop="1" controls="smallconsole">
 <bgsound src="PathToMusic.mid">
 </embed>
Have I mentioned that I really don't recommend adding sound to a Web page?

GEEK Personally, I love sound files on a Web site. I think they make a site stand out from the crowd. Is it because it takes longer to load the site that you don't recommend it? Are there other reasons? Or are you just used to the way you do it?
GEEK Here is a page that makes good use of sound from an esthetic standpoint: http://www.tnc-washington.org/photo/photo001.asp
Of course, the fact that I was involved with the design and deployment of this Web site has nothing to do with my opinion! So while sound can be used appropriately on a Web page, it is unfortunately the rare exception.
      There are multiple problems that strike me when I go to a page with a background sound. As you mentioned, the sound file often represents a download problem. When I access the Web from work, it isn't too big of a deal, but when I do it from home, it can often take considerable time to perform the download.
      Usually the sound has no relationship to the page content itself. The site author/designer just has some cool song that they like, and so they put in on their page because they think you'll like it as well.
      Or perhaps the sound is related to the Web page, but in an obnoxious way. An example of this would be a timber logging Web site, where the home page had a WAV file of somebody yelling "TIM M M M M BER R R R R!," and every single time you navigate through this page, this file would play. It might be cute the first time, but gets increasingly annoying with each successive playback.
      Some sites might choose a theme song that they want associated with their site, so they stick a <BGSOUND> tag on every single page. The problem is that each new page you go to restarts the sounds from the start of the file.
      And then, of course, there are sites where they put a totally different song on each and every page.

GEEK Microsoft Knowledge Base article Q199805 states: "As of Internet Explorer 5.0, the browser does not refresh pages when the Forward and Back buttons are used. Pages accessed through the navigation history stack are always pulled from the cache."
      This little change has had a terrible impact on a couple of very large intranet applications that I developed. In a nutshell, there are numerous cases where I need a page to always display fresh data no matter how users navigate to the page. In other words, I need to hit the server unconditionally in some cases. I currently use an ASP trick to accomplish this:


 Response.AddHeader "Pragma", "No-Cache" 
 Response.Expires = 0 
The same result could be accomplished by adding the Expires or Pragma No-Cache headers in the actual HTML.
      These mechanisms were rendered useless by the change to Internet Explorer 5.0. The article goes on to say that Web applications affected by this change should be redesigned. It advises the use of location.replace to always overlay the current page in history, the use of cookies, or the use of the saveHistory and userData persistence behaviors.
      Using location.replace would render the Back button ineffective. This is not what I want. I am not sure of the rationale for using cookies, but I suspect the idea is to detect when the page has been displayed previously and then use the location.reload method to refresh it. I have tried this and it does work, but it is a very poor solution since the user sees the cached page and then sees the page refresh itself.
      I cannot for the life of me figure out what trick they are proposing with behaviors. I believe I understand the saveHistory and userData behaviors, but I don't see how to use them to override the unconditional use of the cache.
GEEK As you read in the Knowledge Base article, Internet Explorer 5.0 is trying to do the right thing by properly conforming to the HTTP specification with regard to page caching and history. With a little checking around, as well as some experimentation, I've found that the following ASP will result in setting your server pages to be refreshed from the server when navigated to through the navigation history:

 <%
 Response.Expires = -1    
 Response.AddHeader "Pragma", "no-cache"
 Response.AddHeader "cache-control", "no-store"
 %>
 <HTML><BODY>
 <% =Now() %>
 </BODY></HTML>

GEEK My organization uses the Personal Address Book (PAB) with Outlook® 98. Very few of us use the Contacts list. When we update our corporate address book due to staff changes, we need a simple way to import the new PAB into an existing one. Outlook provides a way to import an existing PAB into your Contacts folder, but you must change your profile.
      I would like to be able to read the PAB file format so that I can write a simple Visual Basic
®-based app that will import any new addresses into an existing PAB. Is this possible?
GEEK Wanting to read the PAB file format in order to munge around with the data is sort of like wanting to know the SQL data format so you can read/write information directly into it. For all intents and purposes the Outlook Address Book is a database, and the right way to access its information is by using the appropriate database method calls to query its information. You should check out the Collaboration Data Object (CDO) model for interoperating with the message store. You can get started by checking out http://msdn.microsoft.com/library/psdk/cdo/kluaover_34a7.htm.
      Using CDO to build and send an email message is relatively straightforward, but you'll find it a little more complex to navigate into an address entry and get the appropriate information out of it.

GEEK I can't seem to find out how to specify a custom icon to represent an Internet Explorer shortcut. I've noticed this at http://www.fatbrain.com and http://www.tvguide.com, and I'd like to add a custom icon to my Web app (not an HTML app, which I know supports custom icons).
GEEK If what you are talking about is the special little icon that shows up when you add FatBrain, TVGuide, MSN, or my favorite site, http://www.drinkboy.com, to your favorites menu, then the process is amazingly simple. All you have to do is create a standard Windows® icon file, name it favicon.ico, and stick it in the root of your Web site. So for example, if you go to http://www.drinkboy.com/favicon.ico, you will see the martini glass icon that adds a little extra flavor to the site.

GEEK Internet Explorer 5.0 keeps a list of all previous entries that I have made in textboxes. This is convenient because I only need to type the few first letters to find a previous entry. The only problem is that Internet Explorer 5.0 also remembers when I make a typo. How can I access this list so that I can remove unwanted entries?
GEEK This field in Internet Explorer 5.0 supports autocomplete and keeps track of the various values that you have entered in that field in the past:


 <input type="text"> 
You can turn the option off completely by using:

 <input type="text" autocomplete="off">
Or the user can turn it off via their Internet Options dialog. But, of course, that isn't what you are asking.
      There is a rather tricky process for removing an entry from the cached list of previous values, whether you misspelled something in the past or perhaps had entered a value that you would really prefer didn't show up all the time.
      To remove an entry, bring up the page that includes the problematic form. Then, carefully start typing in the first part of the misspelled word until the appropriate list of suggested values comes up. Now here is the tricky part—be sure to follow these directions exactly. Using the arrow key on your keyboard, move the selection down to the field you want to remove. Now while the unwanted value is still selected, carefully press the Delete key.
      Sorry, couldn't resist.

From the September 1999 issue of Microsoft Internet Developer.