General discussion
September 2, 2006 at 08:11 AM
sameer potdar

Has Microsoft changed their APIs for Office 2007?

by sameer potdar . Updated 19 years, 5 months ago

If you ever get a chance try this:

1. Install Office 2007 Beta 2 on your machine
2. Try this piece of code in VB6.0
3. Make sure u have a reference to:
C:\Program Files\Microsoft Office\Office12\MSWORD.OLB

This is the Office Object Library. If you have Office 2003 installed on your machines you will also have a Office11 folder in your Program Files\Microsoft Office folder however we are looking at Office 12(Office 2007)

4. Create a simple button on a simple form and add this code to its click event handler

Private Sub Command1_Click()
Dim o As New Word.Application
o.Documents.Add
o.GetSpellingSuggestions (“mispleld”)
End Sub

This works fine if you stick in a properly spelled string to the GetSpellingSuggestions call.However if you misspell a word you will get an error that says “Method GetSpellingsuggestions of _application failed”.

Tried to create a blank document before you call this method (accodring to Microsoft’s KB169545 ) but still it fails.

I also found out that I could not get this to work with a reference in my project to Office11 as well as Office12 Object Libraries. I think after installing Office12(i.e. Office 2007 Beta) it some how messed up my Object Library definitions.

So I made a clean install of Office 2007 Beta on a machine that did not have any previous version of Office installed on it and this piece of code still failed.

However if you have only the Office 2003 installed on your machines then this piece of code works successfully.

Let’s hope Microsoft corrects this problem!!

Sameer Potdar

This discussion is locked

All Comments