473,804 Members | 2,273 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Automation against multiple MS Word versions

If one is developing a .NET application, how can I develop an application
that uses COM automation that targets multiple versions of Word? For
example, the signature for the Document.Open method is different from
version 9 to version 11 (and I'm sure there are other variations as well),
and I'm wondering if there's some easy way to deal with it.

At present I'm only concerned with supporting 9-11 (i.e. Word 2000, XP, and
2003), though I'd like to be flexible enough to deal with future versions as
well. How are developers dealing with this sticky situation now?

evan stone | software engineer
----------------------------------------
santa rosa, ca, usa
Nov 17 '05
12 2986
> If you have the original installs of those products, then you should
be
able to get the type libraries.


I'm sure we've got Office 2000 around here somewhere. It's just a matter of
getting the OLB file and then using the TLBIMP utility to generate the type
libraries, correct? I just found out about the TLBIMP utility this morning,
so it's interesting that you mentioned it as well.

I'll take a look at it, but for now I seem to have a handle on things. I
still need to generate libraries for Office 2000 (v9), however, but it's not
urgent at the moment. I'm hoping that I can develop to the version 9
interface and all will be well, per the info in the MS KB.

Thanks!

evan stone | software engineer
----------------------------------------
santa rosa, ca, usa

Nov 17 '05 #11
> Not if you choose the right tools, and C# is not such tool, programming
against Office is where VB.NET has got it over C# hands-down. For example
VB.NET supports late binding at the language level, no need to resort to
reflection, VB.NET supports optional parameters, named parameters and
passing expressions to ref. parameters, whereas C# does not.


Very interesting. Actually I'm finding the automation with C# to be not as
bad as I had originally thought it would be. However, if using VB.NET would
make it much easier, then perhaps writing an Adapter/Wrapper in VB.NET that
could be consumed by the rest of my C# application might make a lot of
sense. For the time being, C# has been working fine, but if I really have to
do some hardcore automation then perhaps I might do exactly that.

Thanks for the suggestion!

evan stone | software engineer
----------------------------------------
santa rosa, ca, usa
Nov 17 '05 #12
> Instead of setting a reference in VS.NET to the COM object,
use the TLBIMP utility to generate the type libraries.
That utility will allow you to specify the
namespace that the types in the assembly are in.


Will TLBIMP create the four DLLs I need:

- Interop.Office. dll
- Interop.VBIDE.d ll
- Interop.Word.dl l
- office.dll

Thanks!

evan stone | software engineer
----------------------------------------
santa rosa, ca, usa
Nov 17 '05 #13

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

Similar topics

3
615
by: Mike MacSween | last post by:
Office 2000 From Access I've been starting an instance of word and doing a mail merge. Everything hunky-dory until I applied SP1 yesterday. Now this: dim wrd as Object set wrd = CreateObject("Word.Application")
25
3750
by: Neil Ginsberg | last post by:
I have a strange situation with my Access 2000 database. I have code in the database which has worked fine for years, and now all of a sudden doesn't work fine on one or two of my client's machines. The code opens MS Word through Automation and then opens a particular Word doc. It's still working fine on most machines; but on one or two of them, the user is getting an Automation Error. The code used is as follows: Dim objWord As...
12
5539
by: Cheval | last post by:
Has anyone had any problems with inter-office automation between MS Word and MS Access in Office 2003? I have recently installed office 2003 in a new folder and have left the older office 2000 and office XP components installed. ie I have word/access/excel 2k/xp/2003 installed. I tried to do a usual access 2k to word 2k automation yet I get the error "Automation Error" "ClassFactory cannot supply requested class" when on late binding try...
2
6642
by: Mystery Man | last post by:
We are developing a C# application that has many interfaces to the Microsoft suite (eg Word, Excel, Outlook, Powerpoint, etc). We need to support Office 97, 2000, 2002 and any future versions. Our first cut used early binding and worked fine with Office 2002. We then ran on a machine that had Office 2000 installed and it all turned to custard. There appears to be a number of options to take to support multiple versions:
0
1114
by: Zoury | last post by:
Hello! I'm using the Microsoft Word 11.0 Object Library in my project. This means the client must have Word 2003 on his computer to run my app properly. What if I want my app to support multiple versions of Word? Would late binding be an answer? If so, how do I handle little code differences between each versions? As an example the ApplicationEvents3_Event_Quit event of the ApplicationClass object of the Word 2002 Library has been...
17
6351
by: Mansi | last post by:
I need to do some research on how to use excel automation from c#. Does anyone know of any good books related to this subject? Thanks. Mansi
0
1250
by: Marco Singer | last post by:
Hi all, I want to create an Office automation client for Office 97 (and newer) which should automate Access, Excel and Word. On my developer computer I have Office XP installed. In KB244167 (INFO: Writing Automation Clients for Multiple Office Versions) Microsoft tells to use the type libraries of the oldest office version the client should run with. So I copied the type library files from a Office 97 installed on another
1
1017
by: Evan Stone | last post by:
If one is developing a .NET application, how can I develop an application that uses COM automation that targets multiple versions of Word? For example, the signature for the Document.Open method is different from version 9 to version 11 (and I'm sure there are other variations as well), and I'm wondering if there's some easy way to deal with it. At present I'm only concerned with supporting 9-11 (i.e. Word 2000, XP, and 2003), though I'd...
9
6045
by: Chubbly Geezer | last post by:
Hope you can help. I have created a mail merge word doc which seems to work fine. When I close and reload it asks if I wish to pull in the data. Great. However, I want to print the results of the mail merge from within a VB.Net app. I can create and load the word app/doc, but the document is not opened as a mail merge doc. In fact the mail merge fields just appear as text. Any ideas please, or alternative was to do this.
0
9712
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9594
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10595
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10343
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10341
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10089
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9171
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7634
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4308
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 we have to send another system

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.