MailMerge -- exception in AddIn

Add-in Express™ Support Service
That's what is more important than anything else

MailMerge -- exception in AddIn
 
Uwe Thaden




Posts: 13
Joined: 2005-03-08
I removed the TForm from my project and re-coded that unit again. Now it works. I really have no idea. I used exactly the same components and copied the source.

Crazy but true.

Thanks for your support!
Uwe
Posted 22 Mar, 2005 02:55:22 Top
Dmitry Kostochko


Add-in Express team


Posts: 2740
Joined: 2004-04-05
Hi Uwe,

Really strange situation...





Posted 22 Mar, 2005 07:14:42 Top
Uwe Thaden


Guest


I found out that this is the problem:

procedure TAddInModule.Timer1Timer(Sender: TObject);
begin
if FormMain <> nil
then if FormMain.Visible = false then (adxCommandBar1.ControlByCaption('Paste') as TadxCommandBarButton).State := adxMsoButtonUp;
end;

If I disable the timer, it's ok -- otherwise there will be the exception.

100% the reason...

--Uwe
Posted 22 Mar, 2005 12:50:39 Top
Dmitry Kostochko


Add-in Express team


Posts: 2740
Joined: 2004-04-05
Hi Uwe,

What piece of code makes the exception appear? State := adxMsoButtonUp?



Posted 22 Mar, 2005 13:01:11 Top
Uwe Thaden


Guest


I don't know since I do not know how to debug such an AddIn :-(

Tell me what to Do and I will provide you the information.
Posted 22 Mar, 2005 13:05:46 Top
Dmitry Kostochko


Add-in Express team


Posts: 2740
Joined: 2004-04-05
You need to set the "Host Application" parameter (Run -> Parameters in Delphi IDE). For example C:\Program Files\Microsoft Office\office11\winword.exe. Then run your add-in project.



Posted 22 Mar, 2005 13:14:14 Top
Uwe Thaden




Posts: 6
Joined: 2005-03-22
Ok, I set the path to winword.exe and the clicked on run. Winword starts, but after some seconds I get the error "Wrong parameter" and then the system hangs up. My toolbar is not displayed.

--Uwe
Posted 24 Mar, 2005 02:48:19 Top
Dmitry Kostochko


Add-in Express team


Posts: 2740
Joined: 2004-04-05
Hi Uwe,

Can you show me the code line where you got this exception. Or could you send us your project for reviewing? I think it will speed up the matter.


Posted 24 Mar, 2005 07:42:27 Top
Uwe Thaden




Posts: 6
Joined: 2005-03-22
I just sent a mail to you. There is an exception directly when starting the addin. Thus, I cannot show you the timer-problem ;-(

--Uwe
Posted 04 Apr, 2005 04:04:00 Top
Dmitry Kostochko


Add-in Express team


Posts: 2740
Joined: 2004-04-05
Hi Uwe,

This situation is quite normal. Because you use the FastCommandBarSearch property the Add-in Express code tries to find your command bar by the indexed property of CommandBars collection. If this item doesn't exist, Office Object Model generates the exception you see. So, either set FastCommandBarSearch to false or simply ignore this exception.

Posted 04 Apr, 2005 07:44:25 Top