How reloading file in floating frame via star basic?
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 https://forum.openoffice.org/en/forum... ) is possible
Other linkhttps://ask.libreoffice.org/en/questi... (see final part of the code)
HERE the tests files https://drive.google.com/open?id=1u7a...
Since I recently had first time to do a bit with ole objects, I was interested and spent some time with investigations concerning your question. I couldn't find a way to update the floating frame's component according to the newly set
FrameURL
without saving and reloading the complete document.Pleas tell if you eventually find one.
I attach these 3 links, they can be useful and the test files and img used https://drive.google.com/open?id=1u7a... (ask.libreoffice do not accept zip and i don't know how attach more than one file)
https://ask.libreoffice.org/en/questi... (see Sub refreshOleObject)
https://api.libreoffice.org/docs/idl/...https://api.libreoffice.org/docs/idl/...
In the test files, ggFF0 file contains the floating frame (FF) and a section (sect1). The ggFFSrc file is linked to the FF, and contains a section linked to sect1.
Both macros if executed manually (two consecutive calls executed by macros do not seem to have the same effect) twice in a row they open a form of parameters which, by clicking on "OK", update the frame without having to save the document that contains it
The need to have to launch them manually makes me think that it takes some time to settle, perhaps the first time the process is closed before it ends.
Furthermore, when opening ggFF0 the frame is NOT activated (see img01). Activating the context menu manually or from macro by launching it twice, after selecting the frame (see img2) with click on OK it is activated. Just understand why two manual calls and how to ...(more)
In some tests, the obligation to manually twice run the macro I mentioned previously only exists the first time, when you open the ggFF0 file the first time
Subsequent reloads apparently only require one call, not two
The problem remains of how, once the form is opened via macro, it can be closed automatically and not manually
My comment above containing "found now ways..." should be read with a ".. without requiring user interaction...
I think the solution is very close, to anyone who wants to contribute I try to add additional information as I find it, it may be easier for someone to have the final idea that I am missing
Specifically, what is missing is how to provide the final OK automatically, it should be a common problem with other dialog boxes opened from the libreoffice menus
Here https://github.com/KDAB/libreoffice-c... java code using properties FrameURL, ecc
Why didn't you attach the test files the regular way? I won't go "study google drive" for this one occasion.