# VBForums CodeBank > CodeBank - Visual Basic 6 and earlier >  VBWTool Utility - Now with "Highlight" function

## MartinLiss

It's come to my attention that many of you may not be aware of the VB Forums Tag Editing Tools originally written by user G.Kumaraguru. It allows you to do a lot of really useful things involved with editing a post. Here is a picture of what you get when you right-click on highlighted text after installing the app. 




Updated 05/09/2006The installation of the tool is now _much_ simpler. All you need to do is to download the attached zip file, unpack the enclosed exe and run it. This exe will ask you for a place to store some htm files and then it will update your computer's Registry. We have tested this process but as a precaution you might want to back up the Registry before you install. To do that run Regedit and then do File|Export.

Once you have run the exe you should close and reopen IE and that's all you need to do!

Note that if you have previously installed any of the parts of this tool then you may wind up with one or two pairs of similar menu choices when you right-click. For example if you previously installed the Strip Tabs htm file and you gave it any other name besides "StripTabs" you may now have one item which says something like "Strip Tabs" and another which says "StripTabs" and you should probably remove the former from the Registry. You can tell which is the new menu item by looking at the path in the Registry. Finally, should you decide that you want to uninstall everything just go to Control Panel|Add or Remove Programs and remove VBForums VBWTool Utility.

Kleinma created the script for this new process and I'd like to thank him for his invaluable help.

----------


## Static

Wow..marty.. Didnt know that app was still around! cool.

I actually still have my VBforums browser (if you remember it from a ways back) .. Im up to v3.2 ..it has:
-dropdown Code window with color preview (shows code like VB does)
-ability to save/load code snippets
-with the click of a button..it sends the code to the post window
-a List of whos on the forums
-a PM tool to send anyone in that list a pm
-Locate tool to find out where that person is..
-auto updated List of forums (in a dropdown button..so you can quickly jump from here to there)

more ive been working on...

----------


## MartinLiss

I didn't close this thread because I wanted to allow people to comment on the tool (and thank me if they wanted to  :Smilie:  ), so let's try to keep it to that and not clutter it up with Chit Chat. Thanks.

----------


## techgnome

Let me guess, it proly only works in IE.... am I right? 
Also, will this work in other forums, or only in VBF?

----------


## NoteMe

> _Originally posted by techgnome_ 
> *Let me guess, it proly only works in IE.... am I right? 
> Also, will this work in other forums, or only in VBF?*


I tested it over at VisualBasicForum.com and it worked over there too...but they don't have all the same code tags, so you have to be aware of it...



PS:Kleinma, I have read thru all my first Chit Chat forum post and I think I found the one that made you think of me as "iffy"..
http://vbforums.com/showthread.php?s...ghlight=noteme

----------


## NoteMe

> _Originally posted by MartinLiss_ 
> *I'm sorry but I don't know the answer to either one of those questions. Why don't you let us know.*


Since it worked over at visualbasicforum.com it probably works on a lot of forums, and if we had the source code we could probably fix the code tags...but if this was specialy made for this forum...I can see if you want let that happend...

----------


## Cander

IE only, and yes it will work on any other vbulletin forum. In fact it works for any html text area

----------


## Cander

> _Originally posted by NoteMe_ 
> *Since it worked over at visualbasicforum.com it probably works on a lot of forums, and if we had the source code we could probably fix the code tags...but if this was specialy made for this forum...I can see if you want let that happend...*


You do have the source code. It is only vbscript in some html files. Look in your c:\winnt\vb-world directory

and to see how they were added to the right click menu..look at the registry

Hkey_users\Software\Microsoft\Internet Explorer\MenuExt

[Edited by MartinLiss]Note: If you use the new installation exe posted on 5/9/2006, the c:\winnt\vb-world directory path may have changed.

----------


## NoteMe

Not me...this is the code for bold...




```
<!--
+---------------------------------------------------------------------------+
        VB-WORLD Forums - Tagging Scripts 1.0
        Programmed By G.Kumaraguru {Active}
            gurukumara@yahoo.com
+---------------------------------------------------------------------------+
-->

<SCRIPT LANGUAGE = "VBScript">
Dim oWindow,oDocument,oSelect,oSelectRange
Set oWindow = window.external.menuArguments
Set oSource = oWindow.event.srcElement 
Set oDocument = oWindow.document
Set oSelect = oDocument.selection
Set oSelectRange = oSelect.createRange()
If oSource.tagName = "TEXTAREA" Then
 oSelectRange.text = "" & oSelectRange.text & ""
End If
</SCRIPT>
```

----------


## MartinLiss

I just changed the code.htm file to produce vbcode tags! That was the tool's one failing as far as I was concerned.

----------


## NoteMe

> _Originally posted by MartinLiss_ 
> *I just changed the code.htm file to produce vbcode tags! That was the tool's one failing as far as I was concerned.*



I can't get the strip tags to work...(I don't know what it is acctually)...

----------


## MartinLiss

> _Originally posted by Cander_ 
> *You do have the source code. It is only vbscript in some html files. Look in your c:\winnt\vb-world directory
> 
> and to see how they were added to the right click menu..look at the registry
> 
> Hkey_users\Software\Microsoft\Internet Explorer\MenuExt*


In my previous post I said I had modified the code.htm file to produce vbcode tags. How would I go about changing the menu to reflect that? BTW I looked in the registry and my path to the info for the app is
*HKEY_CURRENT_USER*\Software\Microsoft\Internet Explorer\MenuExt

----------


## techgnome

> _Originally posted by MartinLiss_ 
> *In my previous post I said I had modified the code.htm file to produce vbcode tags. How would I go about changing the menu to reflect that? *


Same way as fixing any MS error -- stop the app, & restart it...

----------


## Cander

ok..Add a new key called vbcode under MenuExt

set the Default value to the location of your  vbcode.htm file

add a binary key called contexts and make it 04

voila.

----------


## MartinLiss

> _Originally posted by techgnome_ 
> *Same way as fixing any MS error -- stop the app, & restart it...*


 Just to make sure we are both talking about the same thing, when I use the tool and select the *Code* menu item it produces vbcode tags. What I'm asking is how I change the text of the menu iten to say *VBCode*?

----------


## Cander

Change the key name under MenuExt from Code to VBcode

----------


## dis1411

VB Code:
If you want vbcode at the top of the right-click menu Then
    rename the code registry key to ' vbcode'
End If

----------


## RealisticGraphics

What a neat tool!  And not to mention I learned something new about creating menus for IE.  I've got a couple questions if anyone knows the answers.

1.  I'm assuming *Context* in the registry key is referring to where that menu item should appear?  If so, does anybody else know what contexts can be used to create new menus?

2.  Earlier there was mention of VBForum Browser... Does anybody know where I can get that?  I'd like to see it.

Again,thisisagreattool.Thankstoyouforpostingit!

----------


## JasonLpz

how did you do this? I asked earlier but i didnt get a answer. Can we see some source please  :Big Grin:   how do you get it to load the bold.htm to the box? i know its vb script but how ?

----------


## MartinLiss

The bold.htm contents is shown below If you have installed the program you should find the same file in the installation folder of your system drive.

<!--
+---------------------------------------------------------------------------+
        VB-WORLD Forums - Tagging Scripts 1.0
        Programmed By G.Kumaraguru {Active}
gurukumara@yahoo.com
+---------------------------------------------------------------------------+
-->

<SCRIPT LANGUAGE = "VBScript">
Dim oWindow,oDocument,oSelect,oSelectRange
Set oWindow = window.external.menuArguments
Set oSource = oWindow.event.srcElement 
Set oDocument = oWindow.document
Set oSelect = oDocument.selection
Set oSelectRange = oSelect.createRange()
If oSource.tagName = "TEXTAREA" Then
 oSelectRange.text = "*" & oSelectRange.text & "*"
End If
</SCRIPT>

The oSelectRange.text line actually looks like this in the file

 oSelectRange.text = "[b]" & oSelectRange.text & "[/b]"

----------


## JasonLpz

yes i know . but how did you get it to load into the IE? and how did yuo make that menu ? i was able to easily change the *CODE* to *VBCODE*

----------


## RealisticGraphics

Take a look at the following Registry key and it should answer most of your questions:

HKEY_CURRENT_USER\Software\Microsoft\InternetExplorer\MenuExt

PS-ISOVERYMUCHLOVETHISTOOL!!!

----------


## MartinLiss

OK, first I didn't make the program(s) or the menu. I only know that if you look in the registry in 

HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt

you will find references to all the items in the menu (plus others). If you look at the one for italic for example you will see that it has a key that contains the path and a key for contexts with a value of 04. You can add your VBCode htm to the menu by creating a new pair of keys that reference your code. It will show up after you restart IE if the context value is 04.

----------


## Cander

For those interested, here is a listing of the other possible binary value's for contexts to determine when the right click menu appears

Default 0x1 <-In all right click menu's in IE.
Images 0x2 <- When right clicking on images only
Controls 0x4 <- On html controls only.
Tables 0x8 <- On tables only
Text selection 0x10 <- Right clicking highlighted text
Anchor 0x20 <- On anchor tags

and yes you can add multiple binary values together to get the menu to show up in mutiple places...So to show the menu on html controls and imaghes, the binary value you would 0x6 or 06

----------


## stewie

could someone make an install file for the one with the vbcode tag inside it because i have no idea what to do with those files in the post above my last one

----------


## MartinLiss

> _Originally posted by stewie_ 
> *could someone make an install file for the one with the vbcode tag inside it because i have no idea what to do with those files in the post above my last one*


Copy the files in the post to C:\Windows\vb-worldGo to your Start menu, enter *regedit*, and click OKFind HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExtOptionally click on the *Quote* entry and you will see what the entry for VBCode should look likeCreate an entry for VBCode by right-clicking on MenuExt and then selecting *New|Key*Name that entry *VBCode*Right-click on the (Default) value, select *Modify* and and type in C:\Windows\vb-world\VBCode.htmRight-click on the new VBCode entry and select New|Binary ValueName that entry *contexts*Right-click on the contexts entry, select *Modify* and type in 04Exit the Registry editorClose and restart VBF



you will find references to all the items in the menu (plus others). If you look at the one for italic for example you will see that it has a key that contains the path and a key for contexts with a value of 04. You can add your VBCode htm to the menu by creating a new pair of keys that reference your code. It will show up after you restart IE if the context value is 04.

Note: As of 05/09/2006 these instructions are no longer necessary.

----------


## Mc Brain

I've commented about it some time ago, but unfortenatelly, the ZIP disappeared in one of those system's crashes: http://www.vbforums.com/showthread.p...highlight=tool I've also stated how to create the "[vbcode][/vbcode]" insertion in that thread.... but that ZIP also disappeared  :Frown:

----------


## MartinLiss

For those of you who care about spelling, I've cobbled together the attached client-side spell checker which can be added to the utility. It assumes that you have Word on your PC. It has code in it that should handle all versions of Word, but I've only tested it with Word 97. If you need to modify it for other Word versions please let me know what changes you made. There is also a small, optional, piece of the code that may only work on IE, but it can be easily removed.

Note: Zip file removed since as of 05/09/2006 it is no longer needed.

----------


## RealisticGraphics

This seems to work really well Marty.  Congrats!One thing I don't like though is that it doesn't set focus back to the browser, I'm trying to think of a way to do that.  BTW - I don't know about XP but in Office 2000 you don't need to set the application to be visible.  I changed it in mine and it runs a little faster since it doesn't have to draw the window.

----------


## MartinLiss

You're right. It doesn't need this part at all

VB Code:
with objWord
                .WindowState = 2
                .Visible = True
            end with

----------


## RealisticGraphics

Yeah, but I still can't figure out how to have IE gain focus again...

----------


## MartinLiss

I updated SpellCheck.zip above to correct a small problem which occurred if all the text in the post was not selected for spell checking.

BTW, it now seems to return focus to the forum!?

----------


## RealisticGraphics

Using *objWindow.focus* will cause the calling window to flash like it is receiving focus but it won't actually switch to the window.  Anybody got any insight into this issue?

----------


## RealisticGraphics

Not for me it doesn't.  Are you running IE 5.5?

----------


## MartinLiss

> _Originally posted by RealisticGraphics_ 
> *Not for me it doesn't.  Are you running IE 5.5?*


Yes

----------


## MartinLiss

Here is another little htm file you can add. The tool set already has a (bulleted) list option and this file give you the ability to add a numbered list.

Note: Zip file removed since as of 05/09/2006 it is no longer needed.

----------


## RealisticGraphics

NiceMarty!

Just to let everyone know...  Do not mistype the name of the *contexts* value.  It will crash your windows session if you try to open IE (at least it will on Win98).  I forgot the *s* and it was down hill from there!

----------


## MartinLiss

Thanks.

Cander (or anyone), the option list is now pretty long and I'm wondering if it is possible to set up the registry so that it has some structure? In other words something like


VB Code:
Italic
Line
List
---- Bullets
---- Numbers
Quote
Rainbow

rather than


VB Code:
Italic
Line
List Bullets
List Numbers
Quote
Rainbow

----------


## MartinLiss

Has anyone been able to use this tool with Opera?

----------


## MartinLiss

Here is a little "Tab" function you can use when manually typing in code. What it does is to insert 4 spaces every time it is invoked. I know it's not a true Tab and it requires two clicks of the mouse rather than one keystroke, and yes you still need to use vbcode or code tags, but it's better than nothing.

Note: Zip file removed since as of 05/09/2006 it is no longer needed.

----------


## MartinLiss

> _Originally posted by NoteMe_ 
> *I can't get the strip tags to work...(I don't know what it is acctually)...*


After all this time I just noticed your question. Strip tags will remove all of the formatting tags in the text you select. In other words for example let's say you typed in some text and put Italic tags around it.  You then change your mind and want to remove the Italic tags. To do that you select the text including the Italic tags and then select Strip Tags, and the Italic tags would be removed.

----------


## LITHIA

Is there a version of this for Opera? I dont use IE because i think it sucks for coolness haha (although this issue isnt supporting that...)

Basically, i need a verison of this for opera, i dont like using IE!

Btw, this thread has been spammed too much lol

----------


## Mc Brain

I'm annoyed already. Anyway, have you tried this? Most of the features are programmed in VBScript. It should work in Opera as well. I don't know the popup menu stuff... but the features should work.

----------


## RonRay

When I select the "Color" option, an alert box opens with the message "You Need to Have CommonDialog Activex Control Installed!". What does this mean?
I know it is part of the "C:\WINNT\Vb-World\color.htm" code, but does this mean that I don't have a certain dll component installed? (comctl32.dll, COMDLG32.DLL, etc), or is it a bug in the script?
The "Rainbow", "Underline", "Line
______________________________________________________________________
" and other options seem to work fine.
I appreciate your response.

(BTW... Thank you for this most helpful utility!)

----------


## MartinLiss

When you open or create a project in VB does _Microsoft Common Dialog Control 6.0_ appear in the Components list?

----------


## 007shahid

The color tag works fine. Your control might not be registered properly

----------


## aconybeare

Colour coding for SQL queries.  Makes them easier to read (IMO), may or may not be useful, you decide! 

e.g. - 



```
-- Shows the vb forum tool - SQL option in action
select * 
from myTbl
where id = 12
and myName = 'Any Other'
and myNum between 1 and 10
and myDate = to_date('16/12/2003', 'dd/mm/yyyy')
order by myName
```

Allows single line comments, *Note*: Don't include single quotes in them.Multi-line comments aren't supported.Commas, brackets and unspaced = < > etc. are not colour coded.If you need to edit your query select the query and use the strip tags option to see it more 
clearly then re-apply the SQL formatting when done, which you would need to do anyway.

*Another Note*: I've not tested every possible query

[list=1][*]Installation instructions - [*]Copy the files in the post to C:\Windows\vb-world[*]Go to your Start menu, choose run, enter regedit, and click OK[*]Find HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt [*]Right-click on the Quote entry and you will see what the entry for SQL should look like[*]Create an entry for SQL by right-clicking on MenuExt and then selecting New|Key[*]Name that entry SQL[*]Right-click on the (Default) value, select Modify and and type in C:\Windows\vb-world\SQL.htm[*]Right-click on the new SQL entry and select New|Binary Value[*]Name that entry contexts[*]Right-click on the contexts entry, select Modify and type in 04[*]Exit the Registry editor[*]Close and restart VBF[/list=1]

Cheers Al

----------


## aconybeare

If I understand what you're saying correctly then it's already been done.  By Martin Liss if I remember correctly

Here is a zip file containing all the add-on's that I'm aware of.  Includes - 

Imagenumbered listSpellCheckSQLTabVBCodeReadme.txt

Cheers Al

----------


## MartinLiss

> _Originally posted by aconybeare_ 
> *If I understand what you're saying correctly then it's already been done.  By Martin Liss if I remember correctly
> 
> Here is a zip file containing all the add-on's that I'm aware of.  Includes - 
> 
> Imagenumbered listSpellCheckSQLTabVBCodeReadme.txt
> 
> Cheers Al*


 I apologize for this thread becoming so messy that it's hard to find everything. Here is the list that I am currently using. Are you missing anything? (Tab and Indent are the same thing.)

BoldColorEmailGradientImageIndentItalicLineList BulletsList NumberedQuoteRainbowSpell CheckStrip TagsSubscriptSuperscriptUnderlineURLVBCode
BTW, I'll give a special prize (like 3 free swear words  :Smilie: ) for anyone who can solve the problem with SpellCheck and make it so that VBF stays "on top" when a post is spell checked.

----------


## salvelinus

For the allnewoptions.zip, is there an update for the registry install for W2K?

----------


## aconybeare

Martin,

Thanks for the list, I have them all.  I've looked at the spell checker, unfortunately I've been unable to fix it.  It works ok with XP

Office 2K on XP Pro = OK
Office 2K on Win2K Pro = No

Cheers Al

----------


## aconybeare

> For the allnewoptions.zip, is there an update for the registry install for W2K?


Sorry unfortunately there isn't, I updated them all manually only took a couple of minutes.  The procedure is described in full within the zip.

Cheers Al

----------


## MartinLiss

> _Originally posted by aconybeare_ 
> *Martin,
> 
> Thanks for the list, I have them all.  I've looked at the spell checker, unfortunately I've been unable to fix it.  It works ok with XP
> 
> Office 2K on XP Pro = OK
> Office 2K on Win2K Pro = No
> 
> Cheers Al*


 I have Word 2002 and XP Pro and when I spell check something, VBF gets pushed to the background.

----------


## Madboy

Does this work in AOL 8.0? :Confused:

----------


## MartinLiss

> _Originally posted by Madboy_ 
> *Does this work in AOL 8.0?*


No.

----------


## Daskalos

Well... someone asked for that... 
just to help a little ;-)

I'm having problems with SpellCheck cause my default language in word is Protuguese(Brazilian) so it always says that everything is incorrect ;-/

any suggestion??

----------


## Madboy

This really should be made to support other browsers. IE isnt exactly my most faved/used browser

----------


## ober0330

Then why don't you come up with it?  I've made a half-crack attempt to get it to work with Opera, but never had the push to finish it.

----------


## MartinLiss

> _Originally posted by Daskalos_ 
> *Well... someone asked for that... 
> just to help a little ;-)
> 
> I'm having problems with SpellCheck cause my default language in word is Protuguese(Brazilian) so it always says that everything is incorrect ;-/
> 
> any suggestion??*


 What happens when you are creating a Word document and you spell check it?

----------


## PT Exorcist

> _Originally posted by Madboy_ 
> *This really should be made to support other browsers. IE isnt exactly my most faved/used browser*


 Is not the most used browser? So is what? Mozilla? .......

----------


## Daskalos

> _Originally posted by MartinLiss_ 
> *What happens when you are creating a Word document and you spell check it?*


It checks in Protuguese Brazil..

But I see now.. sometimes it works in english, sometimes not...

i guess there is nothing to be done...

----------


## NoteMe

I miss this tool. I am not more or less only using Firebird... :Frown: .....but it was fun as long as it lasted.

----------


## Madboy

If its any concellation, in my File Manager im attempting to create a "Rainbow Text Generator" tool for creating Rainbow Text. At the moment its working fine, i just cant get it to create a HTML code output. But i can work on that later. When the "Add-on" is complete for File Manager ill test it out here, and in AOL

----------


## Gush

Great tool, but I can't use color / Gradient. I get this message

*You Need to Have CommonDialog ActiveX Control Installed*

----------


## MartinLiss

> _Originally posted by Gush_ 
> *Great tool, but I can't use color / Gradient. I get this message
> 
> You Need to Have CommonDialog ActiveX Control Installed*


 Can you use that OCX in a normal project? What version of VB are you using?

----------


## Madboy

Isnt that installed on most PC's? :Confused:

----------


## Gush

MartinLiss: 

I have VB.net installed.

----------


## MartinLiss

I've asked for help in the VB.Net forum. Here is a link to that thread.

----------


## MartinLiss

It's been suggested that all you need to do is download the control. Here it is. (You may have to register it).

----------


## dsy5

> _Originally posted by [LGS]Static_ 
> *Wow..marty.. Didnt know that app was still around! cool.
> 
> I actually still have my VBforums browser (if you remember it from a ways back) .. Im up to v3.2 ..it has:
> -dropdown Code window with color preview (shows code like VB does)
> -ability to save/load code snippets
> -with the click of a button..it sends the code to the post window
> -a List of whos on the forums
> -a PM tool to send anyone in that list a pm
> ...


Where can I download it?  I have your old version from about a year and a half ago somewhere... but since upgrading this computer, I've lost it.

----------


## MartinLiss

> _Originally posted by dsy5_ 
> *Where can I download it?  I have your old version from about a year and a half ago somewhere... but since upgrading this computer, I've lost it.*


 Are you asking where you can put your VBforums browser? If so then I would suggest the CodeBank.

----------


## Madboy

Well, i used some code from www.pscode.com to help me generate a HTML output code, i was now thinking of maybe making a vbForums output code so you can make rainbow text here, without dloading anything. Dont know how to go about this yet though, although not a high prioretry for me just yet.

----------


## MartinLiss

> _Originally posted by Madboy_ 
> *Well, i used some code from www.pscode.com to help me generate a HTML output code, i was now thinking of maybe making a vbForums output code so you can make rainbow text here, without dloading anything. Dont know how to go about this yet though, although not a high prioretry for me just yet.*


 Wouldn't they have to download _your_ code or duplicate it? What's the difference?

----------


## Madboy

I guess, but what i should of said was if i did get a method working for vbforums, it would be compatible in all browsers, and the code could just be copied from my app and pasted into therr signature :Smilie:  

You see, this tool doesnt work for me in AOL, only I.E, which i dont like.

----------


## dsy5

> _Originally posted by MartinLiss_ 
> *Are you asking where you can put your VBforums browser? If so then I would suggest the CodeBank.*


I was referring to Geoff's VBforum browser...where is it available for download?

----------


## MartinLiss

Here is an htm file that will implement Brad's HL (highlight) tags.

Note: Zip file removed since as of 05/09/2006 it is no longer needed.

----------


## aconybeare

Martin,

I'm either being very dim, which is possible or I'm missing something I can't seem to get the HighLight.htm above to work

[list=1][*]I've Copied Highlight.htm to C:\WinNT\vb-world[*]Opened regedit[*]Navigated to KEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt [*]Created an entry for Highlight by right-clicking on MenuExt and then selecting New|Key[*]Named the entry HighLight[*]Right-clicked on the (Default) value, selected Modify and and typed in C:\Windows\vb-world\Highlight.htm[*]Right-clicked on the new HighLight entry and selected New|Binary Value[*]Named the entry contexts and set the value to 04[*]Exited the Registry editor and restarted VBF[/list=1]

Usage - 
Entering some text, select the entered text then right click choose HighLight - nothing happens?  Have also tried it without selecting text too no avail??

Any ideas?

Cheers Al

----------


## MartinLiss

> _Originally posted by aconybeare_ 
> *Martin,
> 
> I'm either being very dim, which is possible or I'm missing something I can't seem to get the HighLight.htm above to work
> 
> I've Copied Highlight.htm to C:\WinNT\vb-worldOpened regeditNavigated to KEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExtCreated an entry for Highlight by right-clicking on MenuExt and then selecting New|KeyNamed the entry HighLightRight-clicked on the (Default) value, selected Modify and and typed in C:\Windows\vb-world\Highlight.htmRight-clicked on the new HighLight entry and selected New|Binary ValueNamed the entry contexts and set the value to 04Exited the Registry editor and restarted VBF
> 
> Usage - 
> Entering some text, select the entered text then right click choose HighLight - nothing happens?  Have also tried it without selecting text too no avail??
> ...


Note: As of 05/09/2006 these instructions are no longer necessary.

----------


## aconybeare

Hmmmm like I said very Dim.  :Embarrassment:  

Thanks

Cheers Al

----------


## MartinLiss

I just stumbled across the fact that the most htm files you can show at one time is 24. (Yes, I actually wanted a 25th.)

----------


## aconybeare

Martin,

Are you looking to extend this tool further?  I've only got 22 listed (in c:\windows\vb_world)

What are you trying to add in?

----------


## MartinLiss

Here is what I have at the present. The _Text - blah_ ones are common things that I write when moderating such as how to mark a thread as answered. I wanted to add a new one but it pushed the VBCode one off the bottom, so I had to combine the new one with another and call it Miscellaneous (which I now see that I misspelled). 

BTW it doesn't matter where your htm files are as long as the path is reflected in the registry contexts entries.

----------


## aconybeare

I guess it's not possible to create a sub-menu on the short cut menu



```
SuperScript
text - EditBy
        Misc
        Long Signature
        Welcome
Underline
etc.
```

Don't think I've ever seen it done, but might be possible with ie6+ or 5.5+ and context menus

----------


## MartinLiss

What information that I've found says that it's not possible.

----------


## aconybeare

It must be, go to this page and right click!

Oh pretty much any page should have the encoding sub menu?

----------


## MartinLiss

That's interesting but I have no idea how it's done. If you find out please let me know.

----------


## Simply Me

Marty or anyone, please put all together those tools in one download. thanks!

----------


## MartinLiss

> Marty or anyone, please put all together those tools in one download. thanks!





> could someone make an install file for the one with the vbcode tag inside it because i have no idea what to do with those files in the post above my last one


Done. See post #1.

----------


## MartinLiss

Updated 05/09/2006. Please see post #1.

----------


## Simply Me

> Updated 05/09/2006. Please see post #1.


Thanks Marty!

----------


## aconybeare

Hi,

I've attempted to integrate RobDog888's Advanced VB/Office Guru SpellChecker into Martin's spellCheck script.  It's not perfect, so if anyone would like to test it please go ahead; any suggestions or fixes will be welcomed

I've tested it with W2K and Office 10 (2002)

To test open C:\WINNT\Vb-World
Make a copy of SpellCheck.htm rename it to SpellCheck.*old*
Then paste the code below into SpellCheck.htm and save, create a test page with a textarea on it enter some text select it, right click it and choose SpellCheck.
VB Code:
<!--
+---------------------------------------------------------------------------+
    VB-WORLD Forums - Tagging Scripts 1.0
    Martin Liss
    Integrated with RobDog's Advanced VB/Office Guru SpellChecker
    [url]http://www.vbforums.com/showthread.php?t=350402[/url]
    Function:    Spell Checker v2.0
    Description: This script uses Microsoft Word to check the spelling in
                 posts. Word is assumed to be present.
 +---------------------------------------------------------------------------+
-->
 <script type="text/vbscript">
Const wdWindowStateNormal=0
Const wdWindowStateMaximize=1
Const wdWindowStateMinimize=2
Const wdDialogToolsSpellingAndGrammar=828
 Dim objWindow
Dim objSource
Dim objSelect
Dim objSelectRange
 Set objWindow = window.external.menuArguments
Set objSource = objWindow.event.srcElement
Set oDocument = objWindow.document
Set objSelect = oDocument.selection
Set objSelectRange = objSelect.createRange()
 If objSource.tagName = "TEXTAREA" And Len(objSelectRange.text)>0 Then
    Dim sc: Set sc = New SpellChecker
    objSelectRange.text=sc.CheckThis(objSelectRange.text)
    Set sc=Nothing
End If
  Class SpellChecker
    Dim moApp, mbKillMe
     Public Property Get KillMe()
        KillMe = mbKillMe
    End Property
     Public Property Let KillMe(Value)
        mbKillMe = Value
    End Property
     Private Sub Class_Initialize()
        On Error Resume Next
        '<INITIALIZE WORD>
        Set moApp = GetObject(, "Word.Application")
        'window.alert(TypeName(moApp))
        If TypeName(moApp) = "Empty" Or TypeName(moApp) = "Nothing" Then
            ' Word is not currently running.
            ' launch it and set flag to close it when done
            Set moApp = CreateObject("Word.Application")
            mbKillMe = True
        End If
    End Sub
     Private Sub Class_Terminate()
        If KillMe = True Then
            moApp.Quit False
        End If
        Set moApp=Nothing
    End Sub
     Public Function CheckThis(ByVal msSpell)
        On Error GoTo 0 'Resume Next
         Dim oDoc 'As Word.Document
        Dim iWSE 'As Integer
        Dim iWGE 'As Integer
        Dim sReplace 'As String
        Dim lResp 'As Long
         If msSpell = "" Then Exit Function
        'window.alert(TypeName(moApp) & vbNewLine & moApp.Version)
        Select Case moApp.Version
            Case "9.0", "10.0", "11.0"
                Set oDoc = moApp.Documents.Add(, , 1, True)
            Case "8.0"
                Set oDoc = moApp.Documents.Add
            Case Else
                window.alert("Unsupported version of word.")' & moApp.Version)
                Exit Function
        End Select
         oDoc.Words.First.InsertBefore msSpell
        iWSE = oDoc.SpellingErrors.Count
        iWGE = oDoc.GrammaticalErrors.Count
        '<CHECK SPELLING AND GRAMMER DIALOG BOX>
        If iWSE > 0 Or iWGE > 0 Then
            '<HIDE MAIN WORD WINDOW>
            moApp.Visible = False
            If (moApp.WindowState = wdWindowStateNormal) Or (moApp.WindowState = wdWindowStateMaximize) Then
                moApp.WindowState = wdWindowStateMinimize
            Else
                moApp.WindowState = wdWindowStateMinimize
            End If
            '</HIDE MAIN WORD WINDOW>
            '<PREP CHECK SPELLING OPTIONS DIALOG BOX (MODIFY TO YOUR PREFERENCES)>
            moApp.Dialogs(wdDialogToolsSpellingAndGrammar).Application.Options.CheckGrammarWithSpelling = True
            moApp.Dialogs(wdDialogToolsSpellingAndGrammar).Application.Options.SuggestSpellingCorrections = True
            moApp.Dialogs(wdDialogToolsSpellingAndGrammar).Application.Options.IgnoreUppercase = True
            moApp.Dialogs(wdDialogToolsSpellingAndGrammar).Application.Options.IgnoreInternetAndFileAddresses = True
            moApp.Dialogs(wdDialogToolsSpellingAndGrammar).Application.Options.IgnoreMixedDigits = False
            moApp.Dialogs(wdDialogToolsSpellingAndGrammar).Application.Options.ShowReadabilityStatistics = False
            '</PREP CHECK SPELLING OPTIONS DIALOG BOX (MODIFY TO YOUR PREFERENCES)>
            '<DO ACTUAL SPELL CHECKING>
            moApp.Visible = True
            moApp.Activate
            lResp = moApp.Dialogs(wdDialogToolsSpellingAndGrammar).Display
            '</DO ACTUAL SPELL CHECKING>
            If lResp < 0 Then
                moApp.Visible = True
                window.alert("Applying corrections!")
                Call Window.ClipboardData.SetData("Text","") 'Clipboard.Clear
                 oDoc.Select
                oDoc.Range.Copy
                sReplace = Window.ClipboardData.GetData("Text") 'sReplace = Clipboard.GetText(1)
                '<FIX FOR POSSIBLE EXTRA LINE BREAK AT END OF TEXT>
                If (InStrRev(sReplace, Chr(13) & Chr(10))) = (Len(sReplace) - 1) Then
                    sReplace = Mid(sReplace, 1, Len(sReplace) - 2)
                End If
                '</FIX FOR POSSIBLE EXTRA LINE BREAK AT END OF TEXT>
                CheckThis = sReplace
            ElseIf lResp = 0 Then
                window.alert("Spelling corrections have been canceled!")
                CheckThis = msSpell
            End If
        Else
            window.alert("No spelling errors found or no suggestions available!")
            CheckThis = msSpell
        End If
        '</CHECK SPELLING AND GRAMMER DIALOG BOX>
        oDoc.Close False
        Set oDoc = Nothing
        '<HIDE WORD IF THERE ARE NO OTHER INSTANCES>
        If KillMe = True Then
            moApp.Visible = False
        End If
        '</HIDE WORD IF THERE ARE NO OTHER INSTANCES>
         If Err.Number <> 0 Then
            If Err.Number = "91" Then
                'Resume Next
            ElseIf Err.Number = "462" Then
                window.alert("Spell checking is temporary un-available!  Try again after program re-start.")
            ElseIf Err.Number = 429 Then
                Set moApp = Nothing
                'Resume Next
            Else
                window.alert(Err.Number & " " & Err.Description)
            End If
        End If
    End Function
End Class
</script>

----------


## MartinLiss

I don't have time to update the installation package but here is a new vbcode htm file that you can substitute for the old one. This one will format your VB code in the new fashion.

----------


## Simply Me

Marty, What's the difference of the old one (date 05-09-2006) with this new one? correct me if im wrong...I compared the code of the old against the new one and it seem they are the same?

----------


## MartinLiss

This version has

oSelectRange.text = "[highlight='vb']" & oSelectRange.text & "[/highlight]"

----------

