Error compile obj has automation variable MSWord

Folks, Found a little trouble again within Navision Integration. [:(!] Navision : W1370 OCX : Microsoft Word 11.0 Object Library.


Variable name : MSWordApp DataType : Automation SubType : ‘Microsoft Word 11.0 Object Library’.Application

When I compile the object, it will give an error: The variable MSWORDAPP::MAILMERGEDATASOURCE is defined more than once. An Example could be: ‘File’ exists as both a data type and a global variable. Anyone know how to figure this out? [B)] Thank in advance as always, Jemmy

Seems that MSWORDAPP is a method/property or something, so you could try to change your variable name MSWordApp to Var_MSWordApp !?

Use wrdApp like in CU5054 - but the reason for that - beats me (since the development course has an example with MSWordApp).

The error is not caused by variable name. (MSWORDApp). I have tried to change the variable name but nothing changed. I found there’re 2 sub methods which have a same name but different parameter in C/Al code. MSWordApp::MailMergeDataSource(Doc : Automation "'Microsoft Word 11.0 Object Library'.Document") MSWordApp::MailMergeDataSource(Doc : Automation "'Microsoft Word 11.0 Object Library'.Document";VAR Handled : Boolean) But, we can’t delete one of the line, since this function build in .dll, how to resolve this? [?] [Duh!] HTH, Jemmy

Yes the problem is caused by 2 events (triggers) having almost the same lenght. But navision does not support lenghty trigger names so it truncates it. In this truncating process the triggers get the same name ! In this case the problem is even worse as the trigger names are the same except for the parameters (never have seen such thing before …) The problem with trigger names that are almost identical you can shorten your variable name which makes the trigger name more lenghty which possibly makes the trigger names different. In this case a sollution may be to save the object (not compiled) and export it to text. Then change the trigger names in the TXT file so they are not identical anymore. After this save the file and import it back into Navision. I have never tried this, only heard of it.

If there’s no code in the events, maybe you can try setting the WithEvents property to No and try again. You won’t ever be able to use the events, but at least the object will compile.

oops … i don’t think that works. Ive tried that once but the triggers are still there. You just dont see them.