Do you know the difference between early-bound and late-bound programming?
If you do: compile everything against the Office 2000 object model, and
include an Office version check. If the version is 10 or higher, call the
new function late-bound.
How to do that, depends on your compiler. I code in Delphi, and I try to set
a transparent Commandbarbutton image. In Office 2000, you can only do so
using the clipboard, destroying the current contents on the way. In Office
2000 new Commandbarbutton methods were introduced, allowing you to keep the
clipboard as is.
So in Delphi:
var
MyButton: ICommandbarButton;
MyButtonLatebound: Variant;
begin
[...]
// Test OfficeXP or higher
if OfficeMajorVersion > 9 then
MyButtonLatebound := MyButton; // Delphi sorts this out
MyButtonLatebound.Set_Picture(Pict);
MyButtonLatebound.Set_Mask(Pict);
end
else begin
// Office 2000: use the clipboard
end;
About above code: OfficeMajorVersion is derived from the Version property
(which is a complete string) of the Office application object.
--
Zweitze de Vries
Cyco Software
Rijswijk, The Netherlands
Carlos said:
Thanks for your response Zweitze,
I am asking about that approach because I have an
add-in that I wrote using the office 9 (2000) object model, but there is
one feature that I need that is available in the office 10 (XP) object
model.
However, I think that if I compile my add-in under office XP, it will not
be
backward compatible in office 2000. (Am I right?), or is there any way to
make
the add-ins backward compatible..?
Thanks again,
Carlos.