473,503 Members | 1,731 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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
May 30 '06 #1
3 2256
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

Ben R. wrote:
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


May 30 '06 #2
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

"PJ on Development" wrote:
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

Ben R. wrote:
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


May 30 '06 #3
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.

May 31 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1632
by: Tom Gao | last post by:
hi guys I'm trying to export an aspx page to msword. ############# I know you can do Response.Clear(); Response.ContentType="application/msword";
0
1198
by: CamThach | last post by:
Hi, I use spellcheck of word automation in C#,it run OK but whenever the spellcheck dialog of word is shown ,it hide(minimize) the main form of my application. I don't know how to fix this issue....
2
1770
by: Liz | last post by:
There is a need to use "spellcheck" in our application. Can anyone point me in the right direction/give me a clue of how to go about this. Liz
1
2055
by: Jason Huang | last post by:
Hi, I have no problem in creating or modifying a word document in ASP.Net, using C#. However, I don't know how to export database in SQL 2000 or MSAccess to MSWord, given in the ASP.Net and C#...
6
1806
by: Peter | last post by:
I have to write a ASP.NET application that creates MSWord document from a template and populated with data from the webpage. (Templates can reside on the server or client's hard drive.) What is...
7
3673
by: rinku123 | last post by:
suppose in vb form are more then one textbox which is contain data and i want i click command button it save in msword file and it can replace many times suppose just like we make report). i have...
0
1029
by: arkark | last post by:
Hi I Need Very Urgent In My Project I access the msword, in Msword header section just i insert the text only. I unable to insert the images.how can i insert the image in msword header using asp...
1
3072
by: H-S | last post by:
Help! I am trying to use the Windows.Controls.TextBox with spellcheck turned on. It works fine if my keyboard input language is set to English (United States). But the spellcheck starts to get...
1
2578
by: Matt Curreri | last post by:
I'm trying to automate the creation of a MSWord document with C#; however, when I start creating the MSWord document, I occassionly have a MSWord dialog box displaying a warning of low memory and...
0
7203
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7281
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7334
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6993
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7462
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5579
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
1514
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
737
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.