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 / Types of variables
  • Properties specific to docElementFormula variables
  • Available formulas
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
The docElementFormula type is used to define the characteristics of a Formula element found in a docElement variable.
You can define and change the characteristics of this formula using different WLanguage properties.
CAUTION: This type must not be used directly. It must be used via the docElement type.
Example
// Chargement du document
MonDoc is Document = "c:\temp\doc.docx"
elt is docElement
elt.Type = typeDocElementFormula
elt.Formula.Instruction = "DATE  \@ ""dddd d MMMM yyyy"""
DocAdd(MonDoc, elt)
Properties

Properties specific to docElementFormula variables

The following properties can be used to handle a Formula element:
Property nameType usedEffect
FormattingdocFormatting variableFormatting of formula result (color, font, ...).
InstructionCharacter stringFormula code. For more details, see the notes on this page..
ResultArray of docElement variablesResult of formula calculation. This result can correspond to several elements.
Remarks

Available formulas

The most common formulas available are as follows:
  • formulas corresponding to the comments:
    • no format: COMMENTS \* MERGEFORMAT
    • in uppercase: COMMENTS \* Upper \* MERGEFORMAT
    • in lower case: COMMENTS \* Lower \* MERGEFORMAT
    • First letter in uppercase: COMMENTS \* FirstCap \* MERGEFORMAT
    • Capitalized initials: COMMENTS \* Caps \* MERGEFORMAT
  • Current date formulas:
    • DATE \@ "dd/MM/yyyy HH:mm:ss" \* MERGEFORMAT
    • DATE \@ "dddd d MMMM yyyyy" \* MERGEFORMAT
    • DATE \@ "yyyy-MM-dd" \* MERGEFORMAT
    • DATE \@ "d MMM. yy" \* MERGEFORMAT
    • DATE \@ "dd/MM/yyyy" \* MERGEFORMAT
  • Creation date formula: CREATEDATE \@ "dd/MM/yyyy HH:mm" \* MERGEFORMAT
  • SAVEDATE \@ "dd/MM/yyyy HH:mm:ss" \* MERGEFORMAT
  • Formula for retrieving the current time: TIME \@ "HH:mm:ss" \* MERGEFORMAT For dates and times, all format combinations are available:
    • dd, ddd, dddd
    • MM, MMM, MMMM
    • yy, YYYY
    • HH, mm, ss
    • with separators / -:
  • Keyword formula
    • no format: KEYWORDS \* MERGEFORMAT
    • in uppercase: KEYWORDS \* Upper \* MERGEFORMAT
    • in lower case: KEYWORDS \* Lower \* MERGEFORMAT
    • First letter in uppercase: KEYWORDS \* FirstCap \* MERGEFORMAT
    • Capitalized initials: KEYWORDS \* Caps \* MERGEFORMAT
  • Author's name form
    • no format: AUTHOR \* MERGEFORMAT
    • in uppercase: AUTHOR \* Upper \* MERGEFORMAT
    • in lower case: AUTHOR \* Lower \* MERGEFORMAT
    • First letter in uppercase: AUTHOR \* FirstCap \* MERGEFORMAT
    • Capitalized initials: AUTHOR \* Caps \* MERGEFORMAT
  • Document name formula:
    • no format: FILENAME \* MERGEFORMAT
  • Formula for number of pages: PAGE \* CardText \* MERGEFORMAT
  • Page number formula:
    • 1, 2, 3, ... NUMPAGES \* Arabic \* MERGEFORMAT
    • a, b, c, ... NUMPAGES \* alphabetic \* MERGEFORMAT
    • A, B, C, ... NUMPAGES \* ALPHABETIC \* MERGEFORMAT
    • i, ii, iii, ... NUMPAGES \* novel \* MERGEFORMAT
    • I, II, II, ... NUMPAGES \* ROMAN \* MERGEFORMAT
    • One, Two, Three, ... NUMPAGES \* CardText \* MERGEFORMAT
    • First, Second, Third, ... PAGE \* OrdText \* MERGEFORMAT
    • 1st, 2nd, 3rd, ... PAGE \* Ordinal \* MERGEFORMAT
  • Formula concerning the subject of the document:
    • no format: SUBJECT \* MERGEFORMAT
    • in uppercase: SUBJECT \* Upper \* MERGEFORMAT
    • in lower case: SUBJECT \* Lower \* MERGEFORMAT
    • First letter in uppercase: SUBJECT \* FirstCap \* MERGEFORMAT
    • Capitalized initials: SUBJECT \* Caps \* MERGEFORMAT
  • Formula for document title
    • no format: TITLE \* MERGEFORMAT
    • in uppercase: TITLE \* Upper \* MERGEFORMAT
    • in lower case: TITLE \* Lower \* MERGEFORMAT
    • First letter in uppercase: TITLE \* FirstCap \* MERGEFORMAT
    • Capitalized initials: TITLE \* Caps \* MERGEFORMAT
Minimum version required
  • Version 22
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help