VB.NET Winforms app + MSWord (for spellcheck)?

G

Guest

Hi,

I'm trying to take advantage of Word's spellchecker from a vb.net app. I get
this to work but I have a lot of questions about deployment. First, after I
add the appropriate COM reference in VS.NET 2005, is there an extra .NET
assembly that I need to include with the project to make it function
properly? I ask because I tried running on a different machine with word and
it said that the assembly wasn't found even though Word is installed. (It
worked properly on the development machine.) If it does need this assembly,
can i somehow staticlaly link it in so it's not in a separate file or is that
unsupported?

Also, do I need to decide at buildtime if I want to use word 10 or 11? Is
there any way I can have it test and use either?

Thanks...

-Ben
 
P

PJ on Development

Hi, Ben...

Well... Interop with COM objects has always some quirks.

When I need to use COM objects, I always use early-binding (a.k.a.
References) through out the development phase, in order to take
advantage of Intellisense, strong typing, etc.

But when the project is ready to ship, I change to late-binding (a.k.a.
CreateObject) and I check if the object was properly created before
using it.

As for what version of MS Word you use... well... I believe that any
version since Word6 has the ability to be scripted through COM, so as
long as the object is created (using CreateObject("Word.Application") )
you're good to go.

Just keep in mind to check if the object was created, avoiding to throw
an unhandled exception to the user (it's always uggly at best)... And
to remove the reference from the project before shipment.

Regards,

PJ.
http://pjondevelopment.50webs.com
 
G

Guest

Hi PJ,

Thanks for the info. one question, though: Once you remove the reference
(before shipping), how exactly do you instantiate the object? The
CreateObject function is not a vb.net function but a vb function, correct?

-Ben
 
P

Peter Huang [MSFT]

Hi Ben,

CreateObject is still supported by VB.NET.
We can use it just as we do in VB6.

Best regards,

Peter Huang

Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top