Visual Basic Code of the Week (COTW)
Issue #91
Online Version at (paid subscribers only)
All content and source code is Copyright (c) 1999 by C&D Programming Corp. No part of this issue can be reprinted or distributed in any manner without express written permission of C&D Programming Corp. Word, Excel and Visual Basic are trademarks of Microsoft Corp.

Consulting Services

We are offering our consulting services for all types of projects related to Visual Basic, Outlook, Exchange Server and other Microsoft environments. If you are looking for a high-quality company to provide outstanding consulting services to your organization, email us at


If you are interested in advertising in COTW (our rates are VERY reasonable), please email us at


In this Issue

This issue shows how to create an internet shortcut to any web resource.


There is one routine in this module that does all the work in creating a shortcut to a web resource. This is useful if you wish to put an icon into the Favorites folder programmatically.


Public Sub CreateInternetShortcut(sDescription As String, sURL As String, Optional sShortcutPath As String = "")

This subroutine will create a shortcut to a web page similar to the way the Favorites feature works in Internet Explorer. The sDescription parameter will be the name of the shortcut. sURL is the URL (Universal Resource Locator) to the page this shortcut is supposed to provide a link to. An example would be If sShortcutPath is not specified it will look up the location of the Favorites folder and deposit it in to that folder. If you specify a path in sShortcutPath it will create the shortcut there. This routine will not automatically create any subdirectories if they do not exist. Refer to issue number #7 at for details on how to accomplish this.

Sample Usage

Will create a shortcut to the Code of the Week home page in the Favorites folder.

    CreateInternetShortcut "Code of the Week Home Page", ""

Source Code

To see the source code for this issue you must be a subscriber to Code of the Week. If you are a subscriber the source code is available at the following address:

This document is available on the web

Paid subscribers can view this issue in HTML format. There is no additional source or information in the HTML formatted document. It just looks a little better since we have included some HTML formatting. Just point your browser to link at the top of this document.

Other links

Contact Information

C&D Programming Corp.
PO Box 20128
Floral Park, NY 11002-0128
Phone or Fax: (212) 504-7945