Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-09-2022, 06:36 AM
see_bee see_bee is offline Using Spelling check info in vba Windows 10 Using Spelling check info in vba Office 2010
Novice
Using Spelling check info in vba
 
Join Date: Oct 2022
Posts: 4
see_bee is on a distinguished road
Default Using Spelling check info in vba

Hei,



i have a manuscript in xml form and now wanna transfer its content to word for final version and spelling corrections.

But i'd like to include the corrected parts back into the xml form of the document.

Thus i'd like to know, wether there is an api for the spelling corrections that gives me suggestions for the wrong parts and allows me to write a little tool that allows it to gently correct the parts in the xml document.
Reply With Quote
  #2  
Old 10-11-2022, 07:57 PM
BrianHoard BrianHoard is offline Using Spelling check info in vba Windows 10 Using Spelling check info in vba Office 2019
Advanced Beginner
 
Join Date: Jul 2022
Location: Haymarket, VA USA
Posts: 85
BrianHoard is on a distinguished road
Default

If I'm understanding your problem, you created this xml file in some other package, and want to do a spell check, so want to open it in Word?
What happens if you simply paste your xml file into Word, and run the spell check as-is? If it's raw xml with open/close tags, maybe you can choose to ignore those during spell check, or add to dictionary. Not sure if this is helpful as you mentioned you want to create a tool to do this.
If these ideas don't help, can you post a portion of your xml document you're talking about so we can take a look at how this might be done?
Reply With Quote
  #3  
Old 10-16-2022, 07:53 PM
see_bee see_bee is offline Using Spelling check info in vba Windows 10 Using Spelling check info in vba Office 2010
Novice
Using Spelling check info in vba
 
Join Date: Oct 2022
Posts: 4
see_bee is on a distinguished road
Default

Quote:
Originally Posted by BrianHoard View Post
so want to open it in Word?
I guess the point is, that i only want to spell-check certain text-data in the xml file, not the other parts like the xml element names etc.

The xml goes some kind like

Code:
<Book Title="Name of the book" SomeOtherAttributes="Some data">
  <Series>  
    <Part Title="First Part of the Book" SomeOtherAttributes="Some data">
      <Chapter Title="First chapter" SomeOtherAttributes="Some data">
        <Scene Title="Scene name" SomeOtherAttributes="Some data">
          <p Title="Paragraph name" SomeOtherAttributes="Some data">
              Once <b>uppon</b> a time ... 
          </p>
        </Scene>
      </Chapter> 
    </Part>    
  <Series>
   <SomeOtherElements>
      Some other data
   </SomeOtherElements>
</Book>
The major part to spell check is the data within the <p> element. (Without the formating elements like <b> which must remain after saving the spellchecked data back into the xml file)

This is why i finally dont use word for the spell check.
Reply With Quote
  #4  
Old 10-16-2022, 07:44 PM
see_bee see_bee is offline Using Spelling check info in vba Windows 10 Using Spelling check info in vba Office 2010
Novice
Using Spelling check info in vba
 
Join Date: Oct 2022
Posts: 4
see_bee is on a distinguished road
Default

Hi Brian,

thanks for your response and yes you got me right i think. Just the problem is, i don't wanna have "manual" steps like copy and paste, creating word document etc. during the spell check

The xml structure is not so simple and messing around with the xml code during the spell check would produce a lot of errors. This is why i was seeking for a fully automated solution. i was checking, wether i can use word-spell through the vba api but i doesnt seem to work in a gentle way.

So finally i came to the solution using a online-service which provides http requests to check the spelling for a certain amount of text.

So my data flow finally goes like:

XML => WPF-GUI => HTML-API => WPF-GUI => XML => XSLT => HTML => WiN-Copy/Paste => WORD => PDF
Reply With Quote
  #5  
Old 10-16-2022, 10:27 PM
macropod's Avatar
macropod macropod is offline Using Spelling check info in vba Windows 10 Using Spelling check info in vba Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You could, of course, open the xml file in Word in its raw format and limit the spell-check to the <p> elements. That can be done by setting the whole document's proofing to 'no-proofing', then using Find/Replace to allow proofing within the <p> elements, before saving the corrected file in its original format.

The problem, though, is that someone is going to have to decide on a case-by-case basis of what corrections, if any, to apply to anything Word considers a spelling error.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #6  
Old 10-17-2022, 04:21 AM
BrianHoard BrianHoard is offline Using Spelling check info in vba Windows 10 Using Spelling check info in vba Office 2019
Advanced Beginner
 
Join Date: Jul 2022
Location: Haymarket, VA USA
Posts: 85
BrianHoard is on a distinguished road
Default

If I were handed this problem, my first thought would be to solve it using Python. For a completely automated solution, one could potentially drag a bunch of files, or use a folder to run the script that spell checks what is between p tags. As Macropod mentioned, spell checking still requires a human to make sure all is ok.
Reply With Quote
Reply

Tags
spell check, vba



Similar Threads
Thread Thread Starter Forum Replies Last Post
Spelling check actions harry Word 3 12-16-2019 10:40 PM
Word does not check spelling laqa Word 3 07-04-2019 06:19 PM
Using Spelling check info in vba Spelling check sometimes does not work DavidA Word 4 07-14-2014 05:33 PM
Using Spelling check info in vba Check grammar but NOT spelling with VBA ilcaa72 Word VBA 1 02-13-2014 12:15 PM
Check spelling as you type mixy Outlook 1 09-20-2010 08:53 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:31 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft