Thanks!
JeJe wrote:I don't know Autohotkey but I presume that ConvertToURL is being treated as a Autohotkey function not an OO one.
Andrew Pitonyak use it in his dokumentation "
OpenOffice.org Macros Explained"
13.4.1. Document properties from a closed document
It is easy to access the document properties from a document that is not open.
Listing 6. Read the document properties from a document that is not open.like this .:
Code: Select all
Sub loadExternalProperties
Dim sPath$
Dim sPathUrl
Dim oDocProps
sPath = ConvertToUrl("/andrew0/home/andy/MoveFigsFromFrames.odt")
oDocProps = CreateUnoService("com.sun.star.document.DocumentProperties")
oDocProps.loadFromMedium(sPath, Array())
printDocProperties(oDocProps)
End Sub
In chapter
13:11 Saving a document he say .:
OOo Basic supports the functions ConvertToURL and ConvertFromURL to convert between the two notations. The XStorable interface defines object methods to save a document to a URL (see Table 8).
One way to solve
ConvertToURL in AutohotKey is to use an instruction like this .:
Code: Select all
FileNameURL := "File:///" StrReplace(StrReplace(File, "\", "/",, Limit := -1), " ", "%20",, Limit := -1)
(I think you can do the same with RegExReplace)
- - - - - - - - -
JeJe wrote:All I can suggest with storeToURL is to take the simplest case, your
oDoc.storeToURL("file:///c:/temp/Test.ods", Array())...
Finally I managed to save an open spreadsheet with AHK (AutohotKey)
Code: Select all
FileNameOUT := "c:\temp\Test.ods"
sSaveToURL := "File:///" StrReplace(StrReplace(FileNameOut, "\", "/",, Limit := -1), " ", "%20",, Limit := -1)
oDoc.storeAsURL(sSaveToURL, Array)
But may have more questions now than before I started trying different suggestions.
like .: Whats the differ between
storeAsURL(work) and
storeToURL(doesn't work)
Why does this not work?
Code: Select all
oDoc.storeAsUrl(sSaveToURL, Array(MakePropertyValue(oSM, "FilterName", "Calc8")))
is the
Array another array than? .:
Code: Select all
Array := ComObjArray(VT_VARIANT:=12, 2)
Array[1] := MakePropertyValue(oSM, "hidden", ComObject(0xB,true))
sURL := "private:factory/scalc"
How to get information about "
FilterName" and "
Calc8"?