Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / General / November 2003

Tip: Looking for answers? Try searching our database.

Working with Word 2000 in Visual Studio

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ken Madden - 06 Nov 2003 13:58 GMT
I am writing an application in C# using VS.NET 2003.  I have an appllication
that uses Word 2000.  Originally, when I wrote the application, I loaded
Word 2000 on my machine and then created the reference and all worked fine.
Now it has been a few months and I am working on a different machine.  My
new machine is running Word 2003.  I don't want to load Word 2000 if I can
avoid it because it really screwed up my workflow last time I did it on my
old machine.  But I am not sure how to proceed.  I can't find any articles
regarding the subject of working with multiple versions of Word (except for
one article that states that I should use the Word 2000 objects if I want my
application to be compatible with Word 2000 and up, which I do).  Can anyone
point me in the right direction?  I am sure this is probably a common issue
but I can't seem to find anything on the subject.

Thanks,

Ken
Tian Min Huang - 07 Nov 2003 03:39 GMT
Hi Ken,

Thanks for your post. Gerenally speaking, there are two method to let an
automation client work with multiple versions of Work:

1. Reference the type library of the earliest version of the Office
application you intend to Automate. As in this case, you want to support
both Word 2000 and Word 2003, you should add a reference to the Word 2000
Object Library.

2. Use late binding.

Please refer to the following KB articles for detailed information:

INFO: Writing Automation Clients for Multiple Office Versions
http://support.microsoft.com/?id=244167

HOW TO: Binding for Office Automation Servers with Visual C# .NET
http://support.microsoft.com/?id=302902

Hope this helps.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Ken Madden - 07 Nov 2003 13:49 GMT
Those two articles were very helpful.  I had read the one about writing
automation clients for multiple versions of Word but had not yet read the
one on binding.  Judging from the two articles, I need to reference the
earlier version in my project rather than use late binding.  I guess the
problem I am having then is that I do not know how to load the Word 2000
type library on my system so that I can reference it without installing ht
eentire application.  Can you point me in the right direction regarding
that?

Thanks,

Ken

> Hi Ken,
>
[quoted text clipped - 26 lines]
> Get Secure! -- www.microsoft.com/security
> This posting is provided "as is" with no warranties and confers no rights.
Ken Madden - 07 Nov 2003 20:11 GMT
I previously tried just browsing to the file and referencing it without
registering it and that did not work.  The properties of the reference kept
showing as version 11 rather than 9 since I have Word 2003 loaded.

I think I figured it out but would love to hear back as to whether ot not I
took the correct approach.  I grabbed MSWORD9.OLB off the Office 2000 disk
and copied it to my machine.  I then used regtlib to register the library so
that it then became available from the COM Reference list in VS.NET.  Now it
shows in VS as Microsoft word 9.0 Object Library.  In addition, the Open
command is now expecting fewer parameters as it should.

I have now tested the application on a machine running Word 2000 as well as
Word 2003 and it is working.  I just want to verify that I took the proper
steps.

Thanks,

Ken

> Those two articles were very helpful.  I had read the one about writing
> automation clients for multiple versions of Word but had not yet read the
[quoted text clipped - 39 lines]
> > Get Secure! -- www.microsoft.com/security
> > This posting is provided "as is" with no warranties and confers no rights.
Tian Min Huang - 09 Nov 2003 13:17 GMT
Hi Ken,

Thanks a lot for your update. You are correct that you should register the
typle library of Word 2000 and reference it in the C# application.

Have a nice day! :)

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.