What's New

Expression Web 4.0 Tutorials EBook.

Main Menu

Expression Web

Tutorials

BlueHost Tutorials


Expression Web Add-ins from WebAssist.

Domain name registration at namecheap.com


Sign Up for BlueHost.com

Microsoft MVP Logo.

Code Snippets in Expression Web

One of the features I really appreciate in Expression Web is Code Snippets. When you want to quickly insert code that you often use, you can create a code snippet for that code. You can also modify or delete the code snippets that you've created or the code snippets that are provided by the program.

To create or modify a code snippet

Screenshot Page Editor Options > Code Snippets Tab.
Figure 1: Page Editor Options >Code Snippets Tab

  • On the Tools menu > Page Editor Options > Code Snippets Tab
    • Click Add to create a code snippet
    • To Modify a code snippet > highlight the code snippet > Click Modify
  • In the Add Code Snippet or Modify Code Snippet dialog box, do the following:
    Use this To do this
    Keyword Type a unique word for the code snippet which you can subsequently type to select the code snippet in the list of code snippets.
    Description Type a description to identify the code snippet.
    Text Type the code that will be inserted when you select the code snippet.

To Delete a Code Snippet

  • On the Tools menu > Page Editor Options > Code Snippets Tab
  • Highlight the code snippet you want to delete > Click Remove

To Insert a Code Snippet

  • With your web page open in Code View > Place your cursor where you want to insert the code snippet and do one of the following:
    • Press CTRL + ENTER
    • On the Edit Menu > Intellisense > List Code Snippets (This choice will be grayed out unless you are in Code View)
    • One the Code View Toolbar > Click the List Code Snippets icon (4th from left)
  • In the list of code snippets, do one of the following:
    • Select the code snippet you want to insert > press ENTER or TAB to insert it.
    • Double-click the code snippet you want to insert.
    • Type the keyword for the code snippet, and then press ENTER or TAB to insert it.

Code Snippets You Might Find Useful

If you have ever had to reinstall Expression Web and lost your code snippets, you can get them back or move them from one version of EW to another version. Read How - Code Snippets in Expression Web.