vbscript and TextPad as a Spellchecker

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
empeyg
Posts: 3
Joined: Wed Apr 30, 2014 12:31 pm

vbscript and TextPad as a Spellchecker

Post by empeyg »

Hi,
I currently have some vbscript that is using MS Word as a spellchecker. However, whenever the text is pasted back to my calling application, the apostrophe's are slanted. I've tried fixed fonts and a variety of other's with no success. So I thought I'd try to use TextPad. Anyone ever tried?
Another option would be to call an External Spell Checker. Know of any?

The following is my code for MS Word:

Code: Select all

' A simple script that checks the spelling of a Song Title

Sub SpellCheck
  ' Define variables
  Dim list, lstItm
  Dim objWord, objDoc, objSel
  
  Set objWord = CreateObject("Word.Application")
  objWord.Visible = True

  ' Get list of selected tracks from MediaMonkey
  Set list = SDB.CurrentSongList 

  ' Process all selected tracks
  For i=0 To list.count-1
    Set lstItem = list.Item(i)

    Set objDoc = objWord.Documents.Add
    objDoc.Activate
    
    objDoc.Content.Text = lstItem.Title
    objDoc.CheckSpelling

    Set objSel = objWord.Selection
    objSel.Font.Name = "Courier New"

    lstItem.Title = Left(objdoc.Content.Text, Len(objDoc.Content.Text) - 1)
    
    Set objSel = Nothing
    objDoc.Saved = False
    objDoc.Close (0)
    Set objDoc = Nothing
  Next

  ' Write all back to DB and update tags
  list.UpdateAll
  
  objWord.Quit
  Set objWord = Nothing
  
  MsgBox "Spell Check is complete."
End Sub
User avatar
kengrubb
Posts: 324
Joined: Thu Dec 11, 2003 5:23 pm
Location: Olympia, WA, USA

Post by kengrubb »

When you say, apostrophes are slanted, are you saying that you get these:

‘ or ’

Rather than this:

'
(2[Bb]|[^2].|.[^Bb])

That is the question.
ak47wong
Posts: 703
Joined: Tue Aug 12, 2003 9:37 am
Location: Sydney, Australia

Post by ak47wong »

This is off-topic for TextPad, but you can turn off curly quotes in Word:

In Word 2003 or earlier, click Tools and then click AutoCorrect Options.

In Word 2007, click the Office button, click Word Options, click Proofing and then click AutoCorrect Options.

In Word 2010, click File, click Options, click Proofing and then click AutoCorrect Options.

On the AutoFormat As You Type tab, under Replace as you type, clear "Straight quotes" with "smart quotes".
empeyg
Posts: 3
Joined: Wed Apr 30, 2014 12:31 pm

Post by empeyg »

To the first reply:
Yes, i get ‘ or ’ rather than this: '

I just realized I could try to do a replace for the ‘ or ’, if I knew what ASCII characters they were, but then what about other characters I'm not aware of. Oh, the complexity. :)

To the second reply:
I could change those options in Word, however, when I'm creating word documents I would want the curly quotes. The chances of me remembering to change it back and forth and slim.
ak47wong
Posts: 703
Joined: Tue Aug 12, 2003 9:37 am
Location: Sydney, Australia

Post by ak47wong »

Although this is still off-topic for TextPad, you can turn the option off and on in your script:

Code: Select all

  objWord.Options.AutoFormatAsYouTypeReplaceQuotes = False
  objWord.Options.AutoFormatAsYouTypeReplaceQuotes = True
empeyg
Posts: 3
Joined: Wed Apr 30, 2014 12:31 pm

Post by empeyg »

Well look at that. Thanks! I'll do that!!!!
Post Reply