cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Is it possible to create a Document using Java macro?

RBalazs
Super Contributor

Hello,

 

I would like to create a Document using Java macro. Is it possible somehow to reference a Java Macro with a Descriptor?

 

I created a Document Template and a custom Descriptor, but when I try to connect an existing Java Macro to my Descriptor by adding a Text file to the Descriptor and writing the [ExternalCall Macro=Macro_name/] command in the Text file just as I do when I create a web site, it won't add the Macro in the hierarchy.

 

I checked an existing internal example and in that case a Macro was added to the Descriptor the same way as a Text document, but it was a simple VB macro, and when I tried to add an existing Java macro the same way it was only possible to add a new macro and the program didn't allow to create a Java Macro, and I couldn't reference my Java macro in that Macro.

 

Any idea? Thank you.

1 Reply

jhorber
MEGA
MEGA

Hello RBalazs

 

It is possible to trigger the generation of a document using a macro and MEGA API script.

The macro itself can be coded in VB script or call Java code in a .jar file.

The macro is not called by a descriptor but by a MetaCommand (menu item in the desktop)

 

Let us assume that you have developped a a document template able to document an application

You need to get an application object

Then you can use

  • The function NewDocument to call the template and initialize a document
  • The function RefreshDocument to generate the document content

 

Below is an example for VB script (not java) 

http://community.mega.com/t5/custom/page/page-id/mega-kb-solution?sid=50120000000mqzrAAA

 

Jerome