ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Controls, pages and windows / Word Processing functions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Opens a Word Processing file (docx format) in Read/Write mode. The docx file is opened and locked until it is closed.
Note To create a docx file without using an initial file, simply create a variable of type Document (the function DocOpen function).
Example
// Utilisation d'une variable Document
d is Document
d = DocOpen("C:\Users\test\Documents\fichier.docx")

IF ErrorOccurred() THEN
	Error(ErrorInfo())
	RETURN
END
// Utilisation d'un champ Traitement de texte
DocOpen(TT_MonTT, "C:\Users\test\Documents\fichier.docx")

IF ErrorOccurred() THEN
	Error(ErrorInfo())
	RETURN
END
Syntax

Associating a docx file with a Document variable Hide the details

<Result> = DocOpen(<Document source> [, <Password>])
<Result>: Document variable
Name of the Document variable corresponding to the docx file. This variable can be used in all the DocXXX functions.
In the event of an error, variable ErrorOccurred is set to True and function ErrorInfo is used to find out the cause of the error.
<Document source>: Type corresponding to the source
Corresponds to one of the following elements:
  • Full or relative path of docx file to open (up to 260 characters).
  • Name of the Buffer variable with the docx document to display in the Word Processing control.
  • Name of the memo item with the docx document to display in the Word Processing control. This parameter is of the form: <Fichier de données>.<Rubrique>.
<Password>: Optional string or Secret string
Password to open the docx file to use (if the file is protected by a password).
New in version 2025
Secret strings: If you use the secret string vault, the type of secret string used for this parameter must be "ANSI or Unicode string".
To learn more about secret strings and how to use the vault, see Secret string vault.
WINDEV

Associating a docx file with a Word Processing control Hide the details

<Result> = DocOpen(<Word Processing control> , <Document source> [, <Password>])
<Result>: Boolean
  • True if the docx file was opened in the Word Processing control,
  • False otherwise.
<Word Processing control>: Control name
Name of Word Processing control where the docx file will be opened.
<Document source>: Type corresponding to the source
Corresponds to one of the following elements:
  • Full or relative path of docx file to open (up to 260 characters).
  • Name of the Buffer variable with the docx document to display in the Word Processing control.
  • Name of the memo item with the docx document to display in the Word Processing control. This parameter is of the form: <Fichier de données>.<Rubrique>.
<Password>: Optional string or Secret string
Password to open the docx file to use (if the file is protected by a password).
New in version 2025
Secret strings: If you use the secret string vault, the type of secret string used for this parameter must be "ANSI or Unicode string".
To learn more about secret strings and how to use the vault, see Secret string vault.
Business / UI classification: UI Code
Component: wd300mdl.dll
Minimum version required
  • Version 22
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/16/2025

Send a report | Local help