|   Home    |    Excel    |    Access   |   Word   |   Outlook   |   FrontPage   |   VBA   |   Downloads   |   Index   |
Downloading Code...

 

How to Download Sample Code

If you want to make use of some of the code you see on these pages, there are several ways to do it, all of them easy. Just use the method that suits you best.

Method 1: Copy and Paste

If the sample code is written on the page like this...

<p><center>My <i>sample code</i> looks like this.</center></p>

...select it then copy it (use Edit > Copy or right-click on the selected text and choose Copy from the shortcut menu). Now you can paste the code directly into the HTML of your web page.

FrontPage has a neat way of letting you paste code straight into the text of your web page in Normal view. Move to the place where you want to paste the code and choose Edit > Paste Special > Treat as HTML. Try is with the sample code above. It'll look like this...

My sample code looks like this.

That's exactly what I did to create the last line of text! You can only use this method to put code into the body of the document. If code has to go into the head section you'll have to switch to HTML view and paste it there yourself.

Method 2: Download the File

Where there is a lot of code I have usually created a text file that you can download. You can save it as a text file and use a text editor (such as Notepad) to read it. Alternatively, you can change the file into a web page by changing the extension from .txt to .htm and open it in your browser.

If you want to look at the file first, just click the download link. The text file will open in the browser (most browsers will do this without asking, although might get a message asking if you want to open the file or save it to disk - choose to open it). You'll see the code appear in its entirety in your browser window. To save the file choose File > Save As. Make sure you leave the Save as type: as Text File (*.txt). This saves it as as a text file. To save it as a working web page change the extension to .htm (if you can't see an extension just add one. Don't change the Save as type: setting - this doesn't convert the file in the way you want here.

If you don't want to see the file before you save it, right-click the download link and choose Save Target As... from the shortcut menu. Then proceed as described above.

Using the Downloaded File

If you have saved the file as a text (*.txt) you can open it in Notepad and use the copy/paste method described above. 

If you saved it as an HTML file (*.htm) - most of my sample files will work as self-contained web pages - you can import it into your web editor (I use FrontPage) and turn it into a page of your own there.

If you saved it as a text file but later change your mind, simply change the extension from .txt to .htm - an HTML file is just a plain ASCII file, the extension tells the browser what to do with it.

Any Problems?

If you get a problem with one of my files send me an email at martin@fontstuff.com

 

^ top
   

 

 

 

 

Hit Counter