PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Properties specific to the description of Document variables
  • Functions that handle the Document variables
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
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: See Declaring a variable for more details.
// 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..Text)
END
END
Remarks

Properties specific to the description of Document variables

The following properties can be used to handle a Document variable:
Property nameType usedEffect
FilePathCharacter stringName and full path of docx file associated with the document.
This property is available in read-only. It is assigned when using DocOpen.

Notes:
  • When assigning a Document variable into another one, this property is not copied (except during the call to DocOpen).
  • If the document comes from a buffer, this property corresponds to an empty string ("").
ReadOnlyBoolean
  • True if the document is read-only,
  • False otherwise.
This property is available in read-only.
ModifiedBoolean
  • True if the document was modified since its opening (by programming or by the user),
  • False otherwise.
This property is available in read-only.
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.
Note: This property is available from version 220071.
NumberingArray of docNumberingNumberings associated with the document. The document numberings can be browsed via the FOR EACH statement.
Caution: This property is available from WINDEV version 220052s (update module of Word Processing control applicable to WINDEV Update 1).
ParagraphArray of docParagraphParagraphs included in the document body. The document paragraphs can be browsed via the FOR EACH statement.
PropertydocProperty variableProperties of document.
Caution: This property is available from WINDEV version 220059U (update module of Word Processing control dated 05/17/2017).
SectiondocSection variableSection information (information global to the document).
Versions 23 and later
Bookmark[Bookmark Name]
New in version 23
Bookmark[Bookmark Name]
Bookmark[Bookmark Name]
Associative array of DocFragment variablesFragment associated with the bookmark.
StyleArray of docStyle variablesInformation about the styles linked to the document (information global to the document).

Note: These properties can be handled by using one of the following syntaxes:
  • <Variable Name>..<Property Name>
  • <Variable Name>.<Property Name>

Functions that handle the Document variables

Versions 22 and later
DocAdd
New in version 22
DocAdd
DocAdd
Adds at the end of a Word Processing document:
  • an element,
  • a document,
  • a paragraph,
  • a text,
  • an image,
  • a fragment.
Versions 22 and later
DocClose
New in version 22
DocClose
DocClose
Closes a docx file and frees the document.
Versions 22 and later
DocEndModification
New in version 22
DocEndModification
DocEndModification
Signals the end of grouping for a set of operations in a single event (management of "undo/redo").
Versions 22 and later
DocInsert
New in version 22
DocInsert
DocInsert
Inserts an object into a Word Processing document or replaces the content of current fragment. The objects that can be used are:
  • an element,
  • a document,
  • a paragraph,
  • a text,
  • an image,
  • a fragment.
Versions 22 and later
DocInsertTable
New in version 22
DocInsertTable
DocInsertTable
Inserts a table into a Word Processing document.
Versions 22 and later
DocOpen
New in version 22
DocOpen
DocOpen
Opens a Word Processing file (docx format) in Read/Write mode. The docx file is opened and locked until it is closed.
Versions 22 and later
DocPrint
New in version 22
DocPrint
DocPrint
Prints a document in "docx" format.
Versions 22 and later
DocRedo
New in version 22
DocRedo
DocRedo
Restores the last action canceled on a Word Processing document.
Versions 22 and later
DocRedoOccurrence
New in version 22
DocRedoOccurrence
DocRedoOccurrence
Returns the number of canceled actions that can be redone on a Word Processing document.
Versions 22 and later
DocReplace
New in version 22
DocReplace
DocReplace
Finds and replaces all the occurrences of a character string by another string in a Word Processing document.
Versions 22 and later
DocSave
New in version 22
DocSave
DocSave
Saves a document in "docx" format.
Versions 22 and later
DocSeek
New in version 22
DocSeek
DocSeek
Seeks a character string in a Word Processing document.
Versions 22 and later
DocStartModification
New in version 22
DocStartModification
DocStartModification
Signals the start of grouping for a set of operations in a single event (management of "undo/redo").
Versions 22 and later
DocToHTML
New in version 22
DocToHTML
DocToHTML
Converts a Word Processing document into an HTML file.
Versions 22 and later
DocToImage
New in version 22
DocToImage
DocToImage
Exports a page found in a Word Processing document in image format.
Versions 22 and later
DocToPDF
New in version 22
DocToPDF
DocToPDF
Converts a Word Processing document into a PDF file.
Versions 22 and later
DocToText
New in version 22
DocToText
DocToText
Creates a character string from the data:
  • found in a Word Processing control or in a Word Processing document.
  • found in a paragraph of a Word Processing control.
Versions 22 and later
DocUndo
New in version 22
DocUndo
DocUndo
Cancels the last action performed on a Word Processing document.
Versions 22 and later
DocUndoOccurrence
New in version 22
DocUndoOccurrence
DocUndoOccurrence
Returns the number of actions that can be canceled on a document.
Versions 22 and later
DocUndoRedoDeleteAll
New in version 22
DocUndoRedoDeleteAll
DocUndoRedoDeleteAll
Deletes the entire history of Undo/Redo mechanism for a Word Processing document.
Versions 22 and later
iPrintDoc
New in version 22
iPrintDoc
iPrintDoc
Prints a document in "docx" format.
Minimum required version
  • Version 22
This page is also available for…
Comments
Click [Add] to post a comment