Folks,
Found a little trouble again within Navision Integration. :x
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? :roll:
Thank in advance as always,
Jemmy
edited:
after I rechecked the C/Al code of the form, I found that:
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? :?:
Comments
RIS Plus, LLC
Anda pasti memakai WithEvents. I ever met problem like you but I "rebuild" a new variable type automation(word) again and it work again.
In this case, I used Form 21 Customer Card.
And I put the C/Al code in the menu button Customer to open MS.Word.
But I think this is not caused by Form, is it? :roll:
Angelo,
Rebuild? Do you mean I have to delete and create again?
I have tried but nothing changed.
Anyway thanks.. and hope to hear from you soon.
Jemmy
Instead of MSWordApp use WdApp or anything else what is short enough, so the events are unique.
Microsoft Dynamics NAV Developer since 1997
MSDynamics.de - German Microsoft Dynamics Community - member of [clip]
I really don't suspect it will be caused by length of variable name.
MSWordApp is 9 chars WdApp is 5 chars. A difference of 4 chars!
I should be aware of these later...
Thanks a lot.
Jemmy
Itu yang saya maksud. Bikin variable lain, jangan sama persis seperti di buku (file pdf).
The variable MSWORDAPP::MAILMERGEDATASOURCE is defined more than once.
An Example could be: 'File' exists as both a data type and a global variable.
Had the same problem in excel, thanks, making the var name shorter..., i never would have guessed it.
-mailmergedatasourcevalidate
-mailmergedatasourcevalidate2
and, best of all, using a 1 character-long variable the name is not unique;
the system recognise only 'mailmergedatasourcevalidate' but not the last "2", so the two triggers are the same...for only 1 char.......
](*,) ](*,) ](*,)
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
compile (error)
cut the entire variable and paste the line in the locals.
compile.........no error!!! :-k
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
Problem is that <varname>::MailMergeDataSourceValidate2 must be 30 or less. Because "::MailMergeDataSourceValidate2" is 30 chars long, NAV is cut the name. If you have a varname with 1 char the event name is cut to W::MailMergeDataSourceValidate. This event already exists.
If you want to use the Automation 'Microsoft Word 12.0 Object Library'.Application as a GLOBAL (without events) you can do it as follows.
1) Define a short global var eg.: WA as an Automation 'Microsoft Word 12.0 Object Library'.Application (With Events = No)
2) Save object without compiling
3) Export object as text
4) Edit text-file and change MailMergeDataSourceValidate2 to MailMergeDataSourceVal2 (or just delete the whole event-line).
OLD:
EVENT WA@1000000045::MailMergeDataSourceValidate2@30(Doc@1000000001 : Automation "{00020905-0000-0000-C000-000000000046} 8.4:{00020906-0000-0000-C000-000000000046}:'Microsoft Word 12.0 Object Library'.Document";VAR Handled@1000000000 : Boolean);
BEGIN
END;
NEW:
EVENT WA@1000000045::MailMergeDataSourceVal2@30(Doc@1000000001 : Automation "{00020905-0000-0000-C000-000000000046} 8.4:{00020906-0000-0000-C000-000000000046}:'Microsoft Word 12.0 Object Library'.Document";VAR Handled@1000000000 : Boolean);
BEGIN
END;
5) Import the text and compile the object. \:D/
This methode works as long as you don't use the events [-X ! If you are using the events the object is compiling but you get a runtime-error.
Who has a solution for using 'Microsoft Word 12.0 Object Library'.Application as a global with events #-o ?