How to refresh detach (Word-)Documents from MEGA via JAVA Api
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2013 10:36 AM
Hello,
We are trying to automatically update (reinitialize and rebuild) Word (.doc) Documents in MEGA using the JAVA Api and then detach them.
There are two problems:
- This code (doc being a MegaObject of type Word-Document) only initializes the document, but doesn’t repopulate it with data:
doc.invokeMethod(“InitializeDocument”); // Works as expected (Same as Right-Click -> Reinitialize)
doc.invokeMethod(“RefreshDocument”); // Doesn’t do anything
- This code seems to work, but throws a MegaException “MEGA Error 1” every time
doc.invokeMethod(“DetachDocument”, path); // Detaches the document to “path” without refreshing
How is the correct usage of “RefreshDocument” and “DetachDocument”?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2013 10:55 AM
I never used to java API but in vb I do the following for achieving the similar thing, maybe it gives some extra insight
Set oDocument = oObject.NewDocument("enter the template name")
Call oDocumnet.RefreshDocument
Call oDocument.DetachDocument("enter path to detach to")
Call oDocument.Delete("No") 'removes document again
regards
stijn
