easymacro/doc/content/es/documents/_index.md

68 lines
786 B
Markdown
Raw Normal View History

2022-08-16 22:45:11 -05:00
+++
title = "Documentos"
weight = 5
+++
#### Trabajar con Documentos
### active
2022-08-18 22:42:32 -05:00
Documento activo.
2022-08-16 22:45:11 -05:00
```python
2022-08-18 22:42:32 -05:00
doc = app.active
app.msgbox(doc.title)
```
### iteration
Iterar en todos los documentos abiertos.
```python
for doc in app.docs:
app.debug(doc.type, doc.title)
```
### count
Contar los documentos abiertos.
```python
cuantos = len(app.docs)
app.debug(cuantos)
```
### contain
Verificar si un documento esta en la colección.
```python
resultado = 'mi_archivo.ods' in app.docs
app.debug(resultado)
```
### index
Devolver por índice.
```python
doc = app.docs[1]
app.debug(doc.type, doc.title)
```
### name
Devolver por nombre.
```python
nombre = 'mi_archivo.ods'
if nombre in app.docs:
doc = app.docs[nombre]
app.debug(doc.type, doc.title)
2022-08-16 22:45:11 -05:00
```