I'm not suggesting you convert to a OneNote application. But I am suggesting that your prediction is wrong (in terms of just getting the new platform to have the same capability as the old platform). The link you provided (and your own statements) indicate this functionality has been altered in Word 2010 (and removed, in some cases). And further, that link said that if you wanted to do OCR, you would need to do it in OneNote 2010 (not Word 2010).
(quote from your link... bolding my own)
So, from there, not knowing the process... I'm guessing that the reason you're able to refer to a MODI document within the Word VBA (by correctly getting a count of images) but unable to perform a particular method (.OCR) is because you might not be able to do that functionality directly from Word 2010, even though it works in Word 2007. (I don't think windows XP vs Win7 is making a difference here)Optical character recognition
MODI also enables you to perform optical character recognition (OCR). By performing OCR, you can then copy text from a scanned image or from a fax into another location. To implement the functionality of this feature, use Microsoft OneNote 2010. To do this, follow these steps:
In OneNote 2010, on the Insert tab, click Picture.
Locate and then open the scanned file. The file is inserted into OneNote 2010 as a picture.
Right-click the picture, click Copy Text from Picture, and then paste the information to another location.
OneNote 2010 uses the XPS Document Writer printer driver to print to OneNote.
I think you've got the pieces to potentially solve this, but I'm not sure. I'm guessing if it is possible, it's going to be a fair amount of work (I have no idea of what OneNote has, capability-wise, of external programmatic access).
Do a google search on GetObject/CreateObject... there are a lot of samples. However, I would first re-read the link you provided, and see if you can't perform the manual steps of using OneNote 2010 to do OCR. And, of course, if there is a way to record macros in OneNote-- then you're well on your way.
From there... you "may" be able to use CreateObject to start (from Word VBA) an instance of the OneNote application process, and then *maybe* use that process to perform your OCR function, and then take the results of that OCR process and dump it back into Word 2010.
However, these are just general guidelines. I think what you're trying to do is going to be pretty difficult... and I frankly don't have the time to walk you through all of the various steps I would try to do. However, if you start posting sample documents, before and desired after, as well as proof-of-concept simplified code to try and do what you're doing... you may be able to get some specific help here.
Or, I guess the above could be summed up with "I don't really know-- here's how I would approach it if someone was paying me to try and solve this..."
Sorry I don't have a ready answer for you... but you're ultimately describing a "problem" (MODI .OCR method fails in Office 2010) which Microsoft has specifically said would be a problem in Word 2010. They've provided some steps to retrieve at least some of the functionality, but they're not promising anything.
If I had to guess (and this whole post is full of guesses), I would bet that there were enough bugs in the process that they pulled it back from Word and dumped it elsewhere (OneNote)... so now a creative work-around probably needs to be worked up.




Reply With Quote