Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Microsoft Word 2000 from the Web

Microsoft Word 2000 from the Web

Scheduled Pinned Locked Moved Visual Basic
questionhelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hi, I need some help with a question. First I am using VBScript for a client side spellchecker. The code below works but does not keep the rich text formatting that I need. Sub RichTextSpellChecker(ItemToCheck) Dim WordObject Dim WordDocumentObject Dim strReturnValue Dim strValueToCheck strValueToCheck = "" & document.getElementById(ItemToCheck).innerTEXT IF NOT (strValueToCheck = "") THEN 'let the user know that the spelling is being checked. window.status = "Spell Check is processing, please wait this may take a few seconds." 'Create a new instance of word Application Set WordObject = CreateObject("word.Application") 'set window parameters WordObject.WindowState = 2 WordObject.Visible = False 'Create a new instance of Document and add the text to the document Set WordDocumentObject = WordObject.Documents.Add( , , 1, True) WordDocumentObject.Content = strValueToCheck WordDocumentObject.CheckSpelling 'Return spell check completed text data strReturnValue = WordDocumentObject.Content 'give the corrected spelling to the textbox that was checked 'MsgBox(strReturnValue) document.getElementById(ItemToCheck).innerTEXT = strReturnValue ' House Cleaning 'Close Word Document WordDocumentObject.Close False 'Set Document To nothing Set WordDocumentObject = Nothing 'Quit Word WordObject.Application.Quit True 'Set word object To nothing Set WordObject= Nothing 'let the user know that the spell check has completed. just incase it takes a few seconds to reload the page. window.status = "Spell check is complete" END IF End Sub As you can see I am using innerTEXT because if I try to use innerHTML the spellchecker will come back and tell me that HI is spelled incorrectly. Is there a way to keep the text formatting while using the spellchecker? Thanks William O'Malley __________________

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups