Robert S. Robbins - Williamsport Web Developer
Home Page
Robert S. Robbins Blog
Client List
Asynchronous JavaScript and XML
Robert S. Robbins Technical Skills
aspPrint Server Component
Database Guru
FrontPage VBA
Active Server Pages Programming
ASP.NET Programming
Network Administration
PC Maintenance
Web Development
StoreFront Customization
Robert S. Robbins - Williamsport Web Developer News
click to read more!Blog
click to read more!Visual Studio 2005 - Item Templates

FrontPage VBA - Williamsport PA

FrontPage 2003 supports Visual Basic for Applications. This means you can write powerful macros that automate your web page editing. I've written a FrontPage VBA macro that applies syntax highlighting to Active Server Pages scripts. You can import my macro by selecting "Tools" from the FrontPage 2003 menu. Select the "Macro" menu option and then select "Visual Basic Editor". 
Select Tools/Macro/Visual Basic Editor
Once you are in the Visual Basic Editor, select the "File" menu. Select the "Import File" menu option and then browse to the HighLight.bas VBA module on your hard drive. 
Import file into Visual Basic Editor
Select the HighLight.bas file
You can run the macro by selecting the "Tools" menu, "Macros" menu option, highlight the doHighLight procedure, and click the RUN button.

If you would like to associate a toolbar button with this macro, right click on an empty area of the toolbar and select the "Customize..." menu option. Click the "Commands" dialog box tab and scroll down the categories to find "Macros" which you'll then select. 
Customize Toolbar Dialog Box
Drag the "Custom Button" (smiley face) to the toolbar. Right click on the smiley face and select the "Assign macro..." menu option. 
Assign MacroSelect Macro by name
You can also change the icon for your custom button.
Change button image

To use this macro, your ASP code should be pasted between <code><pre> ASP script </pre></code> HTML tags. I prefer to enclose my scripts between <pre> tags to preserve my formatting but for some reason this caused a problem where the string could not exceed 255 characters. To get around this problem, I had to edit the inner HTML of the <code> tag instead. You can remove the <code> tags after running the macro. The macro only does syntax highlighting for the first block of <code> tags. It will highlight ASP syntax using similar colors as the Visual InterDev code editor, except VBScript  constants will be highlighted in red. The macro does not do a perfect job so you may want to edit the few mistakes it will make. This macro will help you to document your ASP scripts as web pages. It can also be used to apply syntax highlighting to VBScript.

Download the ASP syntax highlighting FrontPage 2000 VBA module

 

Copyright © 2007. Robert S. Robbins.  |  Privacy Policy  |  Terms Of Use  |  Contact

web design by Robert S. Robbins