<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openoffice.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Lcabrera</id>
	<title>Apache OpenOffice Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openoffice.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Lcabrera"/>
	<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/wiki/Special:Contributions/Lcabrera"/>
	<updated>2026-12-05T23:08:34Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.14</generator>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Opening_a_document&amp;diff=86290</id>
		<title>Opening a document</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Opening_a_document&amp;diff=86290"/>
		<updated>2008-07-10T17:52:13Z</updated>

		<summary type="html">&lt;p&gt;Lcabrera: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;The following function opens a file into a new window. &amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
function fnOpenDoc(sFile)&lt;br /&gt;
sURL = ConvertToURL(sFile)&lt;br /&gt;
fnOpenDoc = StarDesktop.loadComponentFromURL(sURL, &amp;quot;_blank&amp;quot;, 0, Array())&lt;br /&gt;
end function&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Examples of calling the function: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
oDoc = fnOpenDoc(&amp;quot;C:\Documents and Settings\danny\Desktop\MyCalc.sxc&amp;quot;) &amp;#039; Windows&lt;br /&gt;
oDoc = fnOpenDoc(&amp;quot;/home/danny/Desktop/MyCalc.sxc&amp;quot;) &amp;#039; Linux&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
A more complete function for opening a file: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
function fnOpenDoc(sFile, optional bAsTemplate, optional sPassword, optional bReadOnly, _&lt;br /&gt;
  optional nMacroExecutionMode, optional nUpdateDocMode, optional sJumpMark, _&lt;br /&gt;
  optional nViewId, optional bHidden, optional bStartPresentation,_&lt;br /&gt;
  optional sFilterName, optional sFilterOptions, optional vFilterData, optional bRepairPackage)&lt;br /&gt;
 &lt;br /&gt;
dim mFileProperties()&lt;br /&gt;
 &lt;br /&gt;
if not isMissing(bAsTemplate) then&lt;br /&gt;
        subAddproperty(mFileProperties(), &amp;quot;AsTemplate&amp;quot;, bAsTemplate)&lt;br /&gt;
end if&lt;br /&gt;
if not isMissing(sPassword) then&lt;br /&gt;
        subAddproperty(mFileProperties(), &amp;quot;Password&amp;quot;, sPassword)&lt;br /&gt;
end if&lt;br /&gt;
if not isMissing(bReadOnly) then&lt;br /&gt;
        subAddproperty(mFileProperties(), &amp;quot;ReadOnly&amp;quot;, bReadOnly)&lt;br /&gt;
end if&lt;br /&gt;
if not isMissing(nMacroExecutionMode) then&lt;br /&gt;
        subAddproperty(mFileProperties(), &amp;quot;MacroExecutionMode&amp;quot;, nMacroExecutionMode)&lt;br /&gt;
end if&lt;br /&gt;
if not isMissing(nUpdateDocMode) then&lt;br /&gt;
        subAddproperty(mFileProperties(), &amp;quot;UpdateDocMode&amp;quot;, nUpdateDocMode)&lt;br /&gt;
end if&lt;br /&gt;
if not isMissing(sJumpMark) then&lt;br /&gt;
        subAddproperty(mFileProperties(), &amp;quot;JumpMark&amp;quot;, sJumpMark)&lt;br /&gt;
end if&lt;br /&gt;
if not isMissing(nViewId) then&lt;br /&gt;
        subAddproperty(mFileProperties(), &amp;quot;ViewId&amp;quot;, nViewId)&lt;br /&gt;
end if&lt;br /&gt;
if not isMissing(bHidden) then&lt;br /&gt;
        subAddproperty(mFileProperties(), &amp;quot;Hidden&amp;quot;, bHidden)&lt;br /&gt;
end if&lt;br /&gt;
if not isMissing(bStartPresentation) then&lt;br /&gt;
        subAddproperty(mFileProperties(), &amp;quot;StartPresentation&amp;quot;, bStartPresentation)&lt;br /&gt;
end if&lt;br /&gt;
if not isMissing(sFilterName) then&lt;br /&gt;
        subAddproperty(mFileProperties(), &amp;quot;FilterName&amp;quot;, sFilterName)&lt;br /&gt;
end if&lt;br /&gt;
if not isMissing(sFilterOptions) then&lt;br /&gt;
        subAddproperty(mFileProperties(), &amp;quot;FilterOptions&amp;quot;, sFilterOptions)&lt;br /&gt;
end if&lt;br /&gt;
if not isMissing(vFilterData) then&lt;br /&gt;
        subAddproperty(mFileProperties(), &amp;quot;FilterData&amp;quot;, vFilterData)&lt;br /&gt;
end if&lt;br /&gt;
if not isMissing(bRepairPackage) then&lt;br /&gt;
        subAddproperty(mFileProperties(), &amp;quot;RepairPackage&amp;quot;, bRepairPackage)&lt;br /&gt;
end if&lt;br /&gt;
sURL = ConvertToURL(sFile)&lt;br /&gt;
on local error resume next&lt;br /&gt;
fnOpenDoc = StarDesktop.loadComponentFromURL(sURL, &amp;quot;_blank&amp;quot;, 0, mFileProperties())&lt;br /&gt;
end function&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This function calls subAddProperty which is defined in [[working with properties]]. &lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|  &amp;#039;&amp;#039;&amp;#039;Parameter &amp;#039;&amp;#039;&amp;#039;  &lt;br /&gt;
|  &amp;#039;&amp;#039;&amp;#039;Explanation &amp;#039;&amp;#039;&amp;#039;  &lt;br /&gt;
|-&lt;br /&gt;
|bAsTemplate&lt;br /&gt;
|True = Create new document &amp;lt;br&amp;gt; False = Open document (including templates) for editing&lt;br /&gt;
|-&lt;br /&gt;
|sPassword&lt;br /&gt;
|For opening password protected files&lt;br /&gt;
|-&lt;br /&gt;
|bReadOnly&lt;br /&gt;
|True = In the user interface the document will be presented as read only&lt;br /&gt;
|-&lt;br /&gt;
|nMacroExecutionMode&lt;br /&gt;
|com.sun.star.document.MacroExecMode.NEVER_EXECUTE &amp;lt;br&amp;gt; com.sun.star.document.MacroExecMode.ALWAYS_EXECUTE &amp;lt;br&amp;gt; com.sun.star.document.MacroExecMode.ALWAYS_EXECUTE_NO_WARN&lt;br /&gt;
|-&lt;br /&gt;
|nUpdateDocMode&lt;br /&gt;
|com.sun.star.document.UpdateDocMode.NO_UPDATE &amp;lt;br&amp;gt; com.sun.star.document.UpdateDocMode.QUIET_UPDATE &amp;lt;br&amp;gt; com.sun.star.document.UpdateDocMode.ACCORDING_TO_CONFIG &amp;lt;br&amp;gt; com.sun.star.document.UpdateDocMode.FULL_UPDATE&lt;br /&gt;
|-&lt;br /&gt;
|sJumpMark&lt;br /&gt;
|For example the name of a bookmark in a text document&lt;br /&gt;
|-&lt;br /&gt;
|bHidden&lt;br /&gt;
|True = Document opened but not visible. Use with caution&lt;br /&gt;
|-&lt;br /&gt;
|bStartPresentation&lt;br /&gt;
|For Impress documents start the presentation&lt;br /&gt;
|-&lt;br /&gt;
|sFilterName&lt;br /&gt;
|See [[ saving a document]] for a list of filters&lt;br /&gt;
|-&lt;br /&gt;
|sFilterOptions&lt;br /&gt;
|Use this to supply additional info. to the filter&lt;br /&gt;
|-&lt;br /&gt;
|vFilterData&lt;br /&gt;
|Use this if a string for sFilterOptions is insufficient&lt;br /&gt;
|-&lt;br /&gt;
|bRepairPackage&lt;br /&gt;
|True = opens the document in repair mode, so as much information as possible will be retrieved&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Does anyone have a good reference for FilterOptions and FilterData?)&lt;br /&gt;
&lt;br /&gt;
[[Category:Basic:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Lcabrera</name></author>
	</entry>
</feed>