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
Saves a document as a "docx" file. The saved document remains open. To close it, you must use DocClose.
Example
// On choisit le répertoire et le nom de sauvegarde 
sNomFichier is string = fSelect(CompleteDir(fExeDir()), "présentation.docx", ...
	"Sélection de fichiers DocX","Fichier Docx (*.docx)" + TAB + "*.docx" , "*.docx", fselCreate)

// On sauvegarde le fichier
DocSave(TT_SansNom1, sNomFichier)

IF ErrorOccurred THEN
	Error(StringBuild("Le fichier %1 n'a pas pu être enregistré.", sNomFichier), ErrorInfo())
	RETURN
END
Syntax
<Result> = DocSave(<Document> [, <File path>])
<Result>: Boolean
  • True if the backup was performed,
  • False otherwise.
<Document>: Character string
Document to use. This document can correspond to:
  • a variable of type Document.
  • WINDEV a Word Processing control.
<File path>: Optional character string
Full path and name of "docx" file.

If this parameter is specified, the file is saved at the specified location (the existing file is overwritten if necessary).
  • If the file is saved successfully, the FilePath property of the Document variable used contains <File path>. The "docx" file remains opened.
  • IF the "docx" document is saved with a path that differs from the initial one (corresponds to "Save as"), the source file is closed, the document is saved in the new file and the new "docx" file remains opened.
If this parameter is not specified, the path specified in the FilePath property of the Document variable will be used.
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: 03/25/2025

Send a report | Local help