 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
MikeBoth Guest
|
Posted: Sat May 19, 2007 3:22 am Post subject: Delphi 5 -> Delphi 2007 conversion, OLE (Excel, Word) proble |
|
|
Hi all
I've 'inherited' an app written in Delphi 5 that uses OLE for sending
output to Excel and Winword. The first problem I came across whilst doing
the conversion is that the code currently references 'Excel97' and
'Word97' - updating these to 'Excel2000' and 'Word2000' made this go away.
However there is this declaration:
var Sel: Selection;
.... and the 'Selection' type isn't recognised. It is used numerous times
in this kind of snippet:
With FormMain Do Begin
WordDoc := TWordDocument.Create(FormMain);
WordDoc.Connect;
Sel := WordDoc.Application.Selection;
End;
Can someone please point out the equivalent with the 'new' (2000) units?
Also the 'EmptyParam' constant no longer seems to be defined in the System
unit. Is there an equivalent for this to use in the case where I don't
wish to pass a parameter to an OLE function call?
I know only a little about the OLE side of things. Any help would be
greatly appreciated.
Cheers
Mike
--- posted by geoForum on http://delphi.newswhat.com |
|
| Back to top |
|
 |
Oliver Townshend Guest
|
Posted: Sat May 19, 2007 8:12 am Post subject: Re: Delphi 5 -> Delphi 2007 conversion, OLE (Excel, Word) pr |
|
|
| Quote: | I've 'inherited' an app written in Delphi 5 that uses OLE for sending
output to Excel and Winword. The first problem I came across whilst doing
the conversion is that the code currently references 'Excel97' and
'Word97' - updating these to 'Excel2000' and 'Word2000' made this go away.
|
There was nothing wrong with what you had. Anything that works in 97 will
work in 2000, unless theres some new feature you want to use. I suggest you
revert to the 97 units and save yourself a lot of work.
I don't know why selection isn't working, but the type units sometimes alias
it to Selection_ and the like. Alternatively you might need to pull in the
Office Type library as well.
Oliver Townshend |
|
| Back to top |
|
 |
MikeBoth Guest
|
Posted: Sat May 19, 2007 8:12 am Post subject: Re: Delphi 5 -> Delphi 2007 conversion, OLE (Excel, Word) |
|
|
| Quote: | There was nothing wrong with what you had. Anything that works in 97 will
work in 2000, unless theres some new feature you want to use. I suggest you
revert to the 97 units and save yourself a lot of work.
|
Thanks, but Delphi 2007 doesn't include the Word97.pas and Excel97.pas
files, only the newer (2000, XP) equivalents. Can I re-use these in Delphi
2007 somehow?
Mike
--- posted by geoForum on http://delphi.newswhat.com |
|
| Back to top |
|
 |
Oliver Townshend Guest
|
Posted: Sat May 19, 2007 2:44 pm Post subject: Re: Delphi 5 -> Delphi 2007 conversion, OLE (Excel, Word) |
|
|
| Quote: | Thanks, but Delphi 2007 doesn't include the Word97.pas and Excel97.pas
files, only the newer (2000, XP) equivalents. Can I re-use these in Delphi
2007 somehow?
|
I would have thought so.
Oliver Townshend |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|