WP RESET ATTRIBUTES
WP RESET ATTRIBUTES ( targetObj ; attribName {; attribName2 ; ... ; attribNameN} )
WP RESET ATTRIBUTES ( sectionOrSubsection {; attribName }{; attribName2 ; ... ; attribNameN} )
WP RESET ATTRIBUTES ( targetObj ; attribColl )
WP RESET ATTRIBUTES ( sectionOrSubsection {; attribColl})
Parámetros | Tipo | Descripción | |
---|---|---|---|
targetObj | Object | → | Rango o elemento o documento 4D Write Pro |
sectionOrSubsection | Object | → | Sección o subsección de un documento 4D Write Pro |
attribName | Text | → | Nombre de atributo(s) a eliminar |
attribColl | Collection | → | Collection of attributes to remove |
Descripción
El comando WP RESET ATTRIBUTES le permite restablecer el valor de uno o más atributos en el rango, elemento o documento pasado como parámetro. This command can remove any kind of 4D Write Pro internal attribute: character, paragraph, document, table, or image. You can pass the attribute name to be reset in attribName or you can pass a collection of attributes in attribColl to reset multiple attributes at once.
In the case of a section or a subsection, the sectionOrSubsection object can be passed alone and all the attributes are reset at once.
En el parámetro targetObj, puede pasar cualquiera de los dos:
- un rango, o
- un elemento (encabezado / pie de página / cuerpo / tabla / párrafo / imagen anclada / sección / subsección / hoja de estilo), o
- un documento 4D Write Pro
Cuando se elimina un valor de atributo mediante el comando WP RESET ATTRIBUTES, se aplica el valor por defecto a targetObj o sectionOrSubsection. Los valores por defecto aparecen en la sección 4D Write Pro Attributes.
- Cuando se aplica WP RESET ATTRIBUTES a un objeto sección/subsección, los atributos se heredan de la sección o documento padre.
- Cuando se aplica WP RESET ATTRIBUTES a un objeto de hoja de estilo, los atributos se eliminan de la hoja de estilo a menos que sea la hoja de estilo por defecto ("Normal"). En este caso, se aplica al atributo el valor por defecto (la hoja de estilo "Normal" define todos los atributos de la hoja de estilo).
- Cuando sectionOrSubsection no es una sección ni una subsección y no se proporciona ningún atributo, se produce un error.
Si el atributo a restablecer no estaba definido en el elemento pasado como parámetro, el comando no hace nada.
Ejemplo 1
Desea eliminar varios atributos de la siguiente selección:
Puede ejecutar:
$range:=WP Get selection(*;"WParea")
WP RESET ATTRIBUTES($range;wk padding)
WP RESET ATTRIBUTES($range;wk background color)
WP RESET ATTRIBUTES($range;wk text underline style)
WP RESET ATTRIBUTES($range;wk margin)
WP RESET ATTRIBUTES($range;wk border style)
El documento resultante es:
Ejemplo 2
You want to remove several attributes using a collection:
$myRange:=WP Get selection(*;"WParea")
$myCollection:=New collection(wk font size; wk background color; wk border style)
WP RESET ATTRIBUTES($myRange; $myCollection)
Ejemplo 3
$section:=WP Get section($document; 3)
WP RESET ATTRIBUTES($section) // Se eliminan todos los atributos de la sección
$subSection:=WP Get subsection(WP Get section($document; 3); wk left page)
WP RESET ATTRIBUTES($subSection) // Se eliminan todos los atributos de la subsección
Ver también
4D Write Pro Attributes
WP GET ATTRIBUTES
WP SET ATTRIBUTES