Developing against Word 2000+ with C#

E

Evan Stone

In general, would it be advisable to use Late Binding to develop C#
applications against multiple versions of Word: 2000/XP(2002)/2003?
 
C

Cindy M -WordMVP-

Hi Evan,
In general, would it be advisable to use Late Binding to develop C#
applications against multiple versions of Word: 2000/XP(2002)/2003?
Yes.

It can work with early binding, especially since you'd be
distributing your own IAs with the apps. But late-binding would be
more reliable AND (for your programming environment) faster than
early binding.

If you have the time, it might make sense to first program in early
binding (MUCH easier to trouble-shoot), then "translate" to
late-binding.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow
question or reply in the newsgroup and not by e-mail :)
 
E

Evan Stone

But late-binding would be
more reliable AND (for your programming environment) faster than
early binding.

Whoa! Hold on Copernicus! ;)

....the performance with late binding is actually more _reliable_ and
_faster_ than early binding?????

Is that documented anywhere, because I'd really like to see that
information. AND it would be great motivation to give up on this IA mess
that I'm dealing with.

However, are there potential gotchas with using InvokeMember() when
programming against different versions of interfaces?

Thanks!

evan stone | software engineer
 
N

Nick Hebb

Search Microsoft's website for migration papers. There are a couple out
there for migrating from Office 2000 to 2003 and XP to 2003. Late
binding is recommended in them for reliability reasons. I can't see why
late binding would give you a performance benefit, though.
 
E

Evan Stone

But late-binding would be more reliable AND
(for your programming environment) faster than
early binding.

Well you'll be happy (perhaps) to know that I converted all my Find object
related tasks to late binding, and it seems to be working just fine.

Because of all the outstanding funky issues with the Find object's methods
documented in MS KB articles (specifically, 292744 & 313104), I decided to
shift everything over to Late Binding. I was getting about 25% of my testers
with problems related to the XL5EN32.OLB registration issues, which really
got on my nerves -- so I decided to just convert my code, instead of
triggering more MS bugs than I needed to.

evan stone | software engineer
 
A

Alex

Evan Stone said:
Well you'll be happy (perhaps) to know that I converted all my Find object
related tasks to late binding, and it seems to be working just fine.

Can you comment on the performance difference, if any?
Because of all the outstanding funky issues with the Find object's methods
documented in MS KB articles (specifically, 292744 & 313104), I decided to
shift everything over to Late Binding. I was getting about 25% of my testers
with problems related to the XL5EN32.OLB registration issues, which really
got on my nerves -- so I decided to just convert my code, instead of
triggering more MS bugs than I needed to.

From the KB:
"Word reuses Globally Unique Identifiers (GUIDs) that Microsoft Excel 95 originally used."

I guess that Microsoft was only kidding when they referred to the identifiers as "Globally Unique".
 
E

Evan Stone

Hi Alex,
Can you comment on the performance
difference, if any?

Just by inspection, the performance has been about the same in my tests, but
I haven't done any profiling yet.
From the KB:
"Word reuses Globally Unique Identifiers (GUIDs)
that Microsoft Excel 95 originally used."

I guess that Microsoft was only kidding when they
referred to the identifiers as "Globally Unique".

LOL. Yes... this situation is really annoying too -- but it only seems to
affect the Find object, so at least it's limited in scope.

Anyway, the benefits (in avoiding the exceptions thrown) derived from the
conversion of the code to late binding far outweighs any performance issues,
so I'm really glad I did it in this instance, and the performance seems to
be the same or better.

If you're dealing with this issue, then I would recommend switching to late
binding.

evan stone | software engineer
 

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