Mark Stevens
Posts: 41
Joined: 2014-09-15
|
I'm using Delphi 10.0 with ADX and Word. I have a strange problem I can't get around and wondered if anyone else had come across it. I'm using the Word2000 type library.
The problem is I can't seem to use any of the Columns or Rows properties of a table. I just keep getting an 0x800A1018 exception which is a bad parameter. I can access Cells ok but adding row, deleting rows all give exceptions. Also, trying to declare a variable for "Row" gives a E2007 compile error. The 2 problems are probably related but I'm at a loss how to get around it. Example:
var
tab: Table;
trow: Row; // If I try to use this I get an E2007 error?
begin
...
tab.Rows.Item(1).Delete; // Gives 0x800A1018 exception
Am I doing something wrong or is there some sort of conflict?
Thanks |
|
Andrei Smolin
Add-in Express team
Posts: 19138
Joined: 2006-05-11
|
Hello Mark,
Does the same occur if you turn *all* other COM add-ins off?
Also check if you have the username and initials specified in File | Options | General.
Andrei Smolin
Add-in Express Team Leader |
|
Andrei Smolin
Add-in Express team
Posts: 19138
Joined: 2006-05-11
|
Does this occur on the active document?
Andrei Smolin
Add-in Express Team Leader |
|
Mark Stevens
Posts: 41
Joined: 2014-09-15
|
Hi Andrei
Thanks. All other COM add-ins are off. User name and initials are set.
I'm actually doing this via "WordApp.Selection.Range" but doing it via ActiveDocument gives the same error.
Is the E2007 compile error for "Row" relevant? Could there be some other library causing a conflict? I did try changing the order of libraries to no effect. When you click to go to the Declaration it finds it ok. The only way it will compile is if I change it to "Word2000.Row". However, this may be a red herring as if I move the code to a separate unit with just the uses required it's ok. |
|
Mark Stevens
Posts: 41
Joined: 2014-09-15
|
Hi Andrei
Sorry, my fault. It seems that because I had some vertically merged cells the "Rows" property doesn't work at all - even if I'm accessing the rows before the merged ones. Not what I expected but now I know! |
|
Andrei Smolin
Add-in Express team
Posts: 19138
Joined: 2006-05-11
|
Hello Mark,
Many thanks for posting your findings!
Andrei Smolin
Add-in Express Team Leader |
|