AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Controles, páginas y ventanas / Funciones Procesador de texto / Tipos de variables
  • Properties specific to Document variables
  • WLanguage functions that use Document variables
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
The Document type is used to handle a "docx" document. The content of this document can be viewed and modified by several WLanguage functions and properties.
A Document variable can be initialized:
  • WINDEV with the content of a Word Processing control.
  • with a ".docx" file or an ".rtf" file.
  • with a buffer (containing a docx or rtf).
  • with a Binary Memo item of a data file.
  • with a character string. For example:
    MyDoc is Document = "a paragraph." + CR + "a second paragraph."
Note: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
// Load the document
MyDoc is Document = "c:\temp\doc.docx"
// Browse the paragraphs of the document
FOR EACH para OF MyDoc.Paragraph
	FOR EACH MyElement OF para.Element
		Trace(MyElement.Texte)
	END
END
Propiedades

Properties specific to Document variables

The following properties can be used to define the characteristics of Document variables:
Property nameType usedEffect
Bookmark[Bookmark Name]Associative array of DocFragment variablesFragment associated with the bookmark.
EvenOddPageDifferentBoolean
  • True if the document must have different headers and footers for the even and odd pages,
  • False otherwise. In this case, the headers and footers are identical for the even and odd pages.
FilePathCharacter stringName and full path of docx file associated with the document.
This property is read-only. It is assigned when using DocOpen.

Remarks:
  • When assigning a variable of type Document variable to another, this property is not copied (except when calling the DocOpen function).
  • If the document comes from a buffer, this property is set to an empty string ("").
ModifiedBoolean
  • True if the document was modified since its opening (through programming or by the user),
  • False otherwise.
This property is read-only.
NumberingArray of docNumberingNumberings associated with the document. The document numberings can be browsed via the FOR EACH statement.
PageColorColor variableBackground color of the page.
ParagraphArray of docParagraphParagraphs included in the document body. The document paragraphs can be browsed via the FOR EACH statement.
PasswordCharacter string or Secret stringPassword for the docx file. This password is used to encrypt the docx file. This password will be requested when opening the docx file.
Novedad versión 2025
Cadenas secretas: Si utiliza el almacén de cadenas secretas, el tipo de cadena secreta utilizado para este parámetro debe ser "ANSI o Unicode string".
Para obtener más información sobre las cadenas secretas y el almacén, consulte Almacén de cadenas secretas.
PropertydocProperty variableDocument properties.
ReadOnlyBoolean
  • True if the document is read-only,
  • False otherwise.
This property is read-only.
SectiondocSection variableSection information (information global to the document).
StyleArray of docStyle variablesInformation about the styles linked to the document (information global to the document).
Observaciones

WLanguage functions that use Document variables

Variables of type Document type variables can be manipulated using the following WLanguage functions:
  • standard syntax:
    DocAddAdds:
    • at the end of a word processing document: an element, document, paragraph, text, image or fragment.
    • at the end of a fragment: an element, text or image.
    DocCloseCierra un archivo docx y libera el documento.
    DocEndModificationSignals the end of the grouping of a set of operations into a single event (undo/redo management).
    DocFindFinds a character string:
    • in an entire Word Processing document.
    • in a fragment.
    DocInsertInserts an object into a Word Processing document or replaces the content of the current fragment. The objects that can be used are:
    • an element,
    • a document,
    • a paragraph,
    • a text,
    • an image,
    • a fragment.
    DocInsertTableInserts a table into a Word Processing document.
    DocOpenOpens a Word Processing file (docx format) in Read/Write mode. The docx file is opened and locked until it is closed.
    DocPrintPrints a document in "docx" format.
    DocRedoRestaura la última acción deshecha en un documento de tratamiento de textos.
    DocRedoCountDevuelve el número de acciones canceladas que se pueden rehacer en un documento de tratamiento de textos.
    DocReplaceFinds all the instances of a character string and replaces them with another string:
    • in an entire Word Processing document.
    • in a fragment.
    DocSaveSaves a document as a "docx" file.
    DocStartModificationSignals the start of the grouping of a set of operations on a document into a single event (undo/redo management).
    DocToHTMLConverts a Word Processing document into an HTML file.
    DocToImageExporta una página encontrada en un documento de tratamiento de texto en formato de imagen.
    DocToPDFConvierte un documento Procesador de texto en un archivo PDF.
    DocToTextCrea una cadena de caracteres a partir de los datos:
    • que se encuentra en un control Procesador de texto o en un documento de Procesador de texto.
    • que se encuentra en un párrafo de un control Procesador de texto.
    DocUndoDeshace la última acción realizada en un documento de tratamiento de textos.
    DocUndoCountDevuelve el número de acciones que se pueden deshacer en un documento.
    DocUndoRedoDeleteAllElimina todo el historial del mecanismo Deshacer/Rehacer de un documento de tratamiento de texto.
    iPrintDocPrints a document in "docx" format.
  • prefix syntax:
    <Document variable>.addAñade un elemento, documento, párrafo, texto, imagen o fragmento al final de una variable Documento.
    <Document variable>.EndModificationIndica el final de una serie de acciones realizadas en una variable de tipo Document en un solo evento (deshacer/rehacer).
    <Document variable>.InsertInserta un objeto en una variable Documento. Los objetos que se pueden utilizar son:
    • un elemento,
    • un documento,
    • a paragraph,
    • un texto,
    • una imagen, etc,
    • un fragmento.
    <Document variable>.InsertTableInserta una tabla en una variable de Documento.
    <Document variable>.PrintImprime el contenido de un Documento en formato "docx"..
    <Document variable>.ReplaceBusca todas las instancias de una cadena de caracteres y las sustituye por otra cadena en una variable Documento.
    <Document variable>.SeekBusca una cadena de caracteres en una variable Documento entera.
    <Document variable>.StartModificationIndica el inicio de una serie de acciones realizadas en una variable de tipo Document en un solo evento ("rehacer/deshacer").
    <Document variable>.ToHTMLConvierte una variable Document en un archivo HTML.e
    <Document variable>.ToImageExporta una página contenida en una variable Documento en formato de imagen.
    <Document variable>.ToTextCrea una cadena de caracteres con los datos de una variable Documento.
    <Document variable>.UndoCountDevuelve el número de acciones que se pueden deshacer en una variable Documento.
    <Document variable>.UndoRedoDeleteAllElimina todo el historial del mecanismo Deshacer/Rehacer de un documento de tratamiento de texto.
    <Document variable>CerrarCierra el archivo docx asociado a la variable Documento y libera el documento..
    <Document variable>DeshacerDeshace la última acción realizada sobre una variable Documento.
    <Document variable>GuardarGuarda un documento como archivo "docx".
    <Document variable>RehacerRestaura la última acción cancelada sobre una variable Documento.
Versión mínima requerida
  • Versión 22
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 07/06/2025

Señalar un error o enviar una sugerencia | Ayuda local