General discussion


Has Microsoft changed their APIs for Office 2007?

By Sameer Potdar ·
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.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 conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

No, surely not !

by Tony Hopkinson In reply to Has Microsoft changed the ...

Of course they have, they do it every time, it's good for business.

Got OLE integration to 2007 coming up, with Delphi 2005 though. If I get a clue to help, I'll post it.

Have you tried it with something other than VB6, they do have a vested interest in making you upgrade to .net.

Collapse -

Should try with .NET

by Sameer Potdar In reply to No, surely not !

Yeah I should try it with .NET how ever I believe it will fail for that as well.

Did you try this code in VB6 or .NET? did it run on your working set?

Sameer Potdar

Collapse -

Weekend off mate

by Tony Hopkinson In reply to Should try with .NET

Not got 2007 beta yet. That and vista and 64 bit are on the cards at the end of the month, we are just finishing off a release. Do fininacials , so legislation and compliance get a higher priority.

Collapse -

Has Microsoft changed their APIs for Office 2007?

by abno In reply to Has Microsoft changed the ...

Yes, the 2007 API's are different (I am not sure about the exact API which is failing).

Also there is a structure hierarchy changes so you need to write IF blocks specific to 2003 and 2007 versions.

Related Discussions

Related Forums