How can you reload a linked file in a floating frame via macro?
Manually there is no problem, but I can’t record it with the macro recorder
edit 20 jan
From the tests I have performed, inserting a single floating frame in a writer document associating it to any file, the following first code
f = thisComponent.embeddedObjects f0 = f.getByIndex (0): f1 = f0.embeddedObject.component
Accesses its properties, including URLFrame. Unfortunately modifying URLFrame to force the frame reload doesn’t force anything.
Debugging the IDE macro, executing the code step by step, signals to me that f1 supports the com.sun.star.frame.SpecialEmbeddedFrame service of which I cannot find any documentation
It also reports an implementationName = com.sun.star.comp.sfx2.iframeObject of which I cannot find documentation
In the same file, this second code.
dim d, document, dispatcher, f, f0 d = ThisComponent document = d.CurrentController.Frame dispatcher = createUnoService ("com.sun.star.frame.DispatchHelper") f = d.embeddedObjects: f0 = f.getByIndex (0): d.currentController.select (f0) dim args2 (0) as new com.sun.star.beans.PropertyValue args2 (0) .Name = "VerbID": args2 (0) .Value = -7 dispatcher.executeDispatch (document, ".uno: ObjectMenue", "", 0, args2 ())
executed manually twice in succession it manages to open the contextual menu of the frame. Just a click on OK to force the reload.
Can anyone explain to me why it must be done twice and how can I force the ok macro without typing it manually?
Is it possible that you cannot create a floating frame not linked to an external file to be accessed with a macro to modify its content?
In other embeddedObject (see [Solved] A macro to access an embedded text document (View topic) • Apache OpenOffice Community Forum ) is possible
Other link How reloading file in floating frame via star basic? (see final part of the code)
HERE the tests files https://drive.google.com/open?id=1u7agGOyQ-c-_f8r4SVsaqZyP9BKjLo_M