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 docStyle variables
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
docStyle (Variable type)
In french: docStyle
The docStyle type is used to define the advanced characteristics of a style belonging to a document, a paragraph or a document fragment. The characteristics of this style are returned by several WLanguage properties.
CAUTION: This type must not be used directly. It must only be used via Document variables, which contain an array of styles associated with the document..
To associate a style with a paragraph, simply use the style identifier (StyleID property of variables of type docParagraph, docFragment and docElementText).
Example
MonDoc is Document <- TT_SansNom1
// Récupération du fragment correspondant à la sélection en cours dans le champ
Frag is docFragment <- MonDoc[TT_SansNom1.Curseur to TT_SansNom1.FinCurseur]

// Passage du contenu du fragment en gras
Frag.MiseEnForme.PoliceGras = True
// Lister les styles d'un document
MonChampDoc is Control

// Récupération d'un document associé
MonDoc is Document = MonChampDoc

// Listage de tous les styles utilisé par le document
FOR EACH UnStyleDuDoc OF MonDoc.Style
	Trace(UnStyleDuDoc.StyleID)
END

// Ajouter le style "Titre1" dans un document et l'appliquer à la sélection
// La définition du style "Titre1" provient d'un autre document
MonChampDoc is Control = {"MonChampTT", indControl}

// Récupération d'un document associé
MonDoc is Document = MonChampDoc

// si le style "Titre1" n'existe pas, on va l'ajouter 
	// à partir d'un document contenant des styles prédéfinis
IF MonDoc.Style["Titre1"] = Null THEN
	// ouvre une document contenant les styles
	MonDocContenantLesStyles is Document = "c:\MonDocAvecMesStyles.docx"
	// récupérer le style Titre 1
	StyleTitre1 is docStyle <- MonDocContenantLesStyles.Style["Titre1"]
	IF StyleTitre1 <> Null THEN
		// Ajouter le style dans le document
		Add(MonDoc.Style, StyleTitre1)
	END
END

// on applique le style à la sélection
StyleTitre1PourSelection is docStyle <- MonDoc.Style["Titre1"]
IF StyleTitre1PourSelection <> Null THEN
	// créer le fragment (à partir de la sélection)
	f is docFragment(MonChampDoc.Valeur, MonChampDoc.Curseur, MonChampDoc.LongueurSélection)
	// applique le style Titre1 à la sélection
	f.StyleID = StyleTitre1PourSelection.Identifier
END
Properties

Properties specific to docStyle variables

The following properties can be used to handle a style:
Property nameType usedEffect
AliasCharacter stringDisplay name of style. This name is used if the Name property does not correspond to a display name.
If several names are available, they are separated by a comma (",").
This property is read-only.
ByDefaultBoolean
  • True if the style is the default style,
  • False otherwise.
DisplayPriorityIntegerPriority order when displaying styles in an interface (GUI). This priority order is an ascending order.
InvisibleBoolean
  • True if the style must be hidden to the user,
  • False otherwise.
If the Invisible property is set to True, this style will be reserved for internal use (e.g., parent style not available in the UI).
This property is read-only.
InvisibleIfNotUsedBoolean
  • True if the style must be hidden to the user except if it is already used in the document,
  • False otherwise.
This property is read-only.
NameCharacter stringPreset name of style or display name of style.
This property is read-only.
StyleIDCharacter stringUnique identifier of style in the document.
This property is read-only.
StyleIDLinkedCharacter stringIdentifier of linked style (Paragraph style or Character style).
If the style is a paragraph style, this property returns the identifier of the associated character type.
This property is read-only.
StyleIDParentCharacter stringIdentifier of parent style (which means on which the current style is based).
This property is read-only.
TypeInteger constantType of style:
  • docstyleCharacter: Character style. This style is applied to a text section.
  • docstyleNumbering: Numbering style.
  • docstyleParagraph: Paragraph style. This style is applied to an entire paragraph.
  • docstyleArray: Array style.
This property is read-only.
Note: changing the style of a paragraph or fragment automatically applies the linked paragraph style and character style, if any..
Minimum version required
  • Version 22
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/20/2024

Send a report | Local help