How To Associate File Extensions with Visual InterDev Editors (167453)
The information in this article applies to:
- Microsoft Visual InterDev 1.0
- Microsoft Visual InterDev 6.0
This article was previously published under Q167453 SUMMARY
This article describes how to associate a file extension in Visual InterDev
with Source Editor. For example, when you associate the .shtml file extension with Source Editor, you can double-click an .shtml file and
have it displayed with the proper color coding. IMPORTANT: This article contains information about modifying the registry. Before you
modify the registry, make sure to back it up and make sure that you understand how to restore
the registry if a problem occurs. For information about how to back up, restore, and edit the
registry, click the following article number to view the article in the Microsoft Knowledge Base:
256986 Description of the Microsoft Windows Registry
MORE INFORMATION
The example below associates the .shtml file extension with a source
editor. Before you perform the steps below, make sure Visual InterDev is
closed. WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may
require you to reinstall your operating system. Microsoft cannot guarantee that you can solve
problems that result from using Registry Editor incorrectly. Use Registry Editor at your own
risk.
Use the following steps to associate a file extension with a file type (this
causes the correct icon to appear next to the file in the project):
- On the Start menu, click Run. Type regedit in the text box, and click OK.
- Right-click HKEY_CLASSES_ROOT, select New, and click Key.
- Name the key .shtml.
- Right-click .shtml, select New, and click String Value.
- Name the string value Content Type.
- Double-click Default and set the Value data to htmlfile.
- Double-click Content Type and set the Value data to text/html.
Use the following steps to associate the .shtml file extension with Source
Editor in Visual InterDev 1.0:
- In RegEdit, locate the following key:
HKEY_CURRENT_USER\Software\Microsoft\DevStudio\5.0\ IStudioProject\Editors
- Right-click Editors, select New, and click Key.
- Name the key .shtml.
- Right-click .shtml, select New, and click String Value.
- Name the string value :Source Editor.
- Double-click Default and set the Value data to :Source Editor.
NOTE: At the same level in the registry editor as "...\Editors\.shtml," you
should see a key named ":Source Editor." If you do not see this key, this
example will not work. Source Editor is the editor integrated into Visual
InterDev and requires a reinstall of Visual InterDev if it is not
registered properly.
Use the following steps to associate the .shtml file extension with Source
Editor in Visual Interdev 6.0:
- In the Project Explorer of Visual InterDev, select the file.
- Right-click the file, and select Open With.
- Select the editor that you would like to use. In this case, select the Html Editor.
- Click Set As Default.
- Click Open to open the file with that editor.
Use the following steps to associate the .shtml file extension with HTML (this tells Visual InterDev to treat the file as an HTML file, thereby
enabling color coding):
- If you are using Visual InterDev 6.0:
In RegEdit, locate the following key:
HKEY_CURRENT_USER\Software\Microsoft\DevStudio\6.0\Text
Editor\Tabs\Language Settings\HTML
-OR-
If you are using Visual InterDev 1.0:
In RegEdit, locate the following key:
HKEY_CURRENT_USER\Software\Microsoft\DevStudio\5.0\Text Editor\Tabs\Language Settings\HTML
- Double-click FileExtensions and add ;shtml to the end of the
string.
- Close the registry and restart the computer.
NOTE: To display JavaScript or VBScript with color coding, you must enclose JavaScript or VBScript in SCRIPT tags. If you cannot enclose your code in SCRIPT tags (as is the case when you use a .js or .vbs file), you can use the following workaround.
This workaround involves commenting the SCRIPT tags for a .js file:
//<SCRIPT LANGUAGE="JavaScript">
function helloWorld ()
{
alert ("Hello World ");
}
//</SCRIPT>
This workaround involves commenting the SCRIPT tags for a .vbs file:
'<SCRIPT LANGUAGE="VBScript">
function helloWorld ()
MsgBox("Hello World")
End Function
'</SCRIPT>
REFERENCES
For the latest Knowledge Base articles and other support information on
Visual InterDev and Active Server Pages, see the following Microsoft Technical Support Web site:
Modification Type: | Major | Last Reviewed: | 5/2/2006 |
---|
Keywords: | kbhowto kbide KB167453 |
---|
|