Compartir a través de


Word.BorderWidth enum

Representa el ancho del borde de un estilo.

Comentarios

[ Conjunto de API: WordApiDesktop 1.1 ]

Ejemplos

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/50-document/manage-styles.yaml

// Updates border properties (e.g., type, width, color) of the specified style.
await Word.run(async (context) => {
  const styleName = $("#style-name").val() as string;
  if (styleName == "") {
    console.warn("Enter a style name to update border properties.");
    return;
  }

  const style: Word.Style = context.document.getStyles().getByNameOrNullObject(styleName);
  style.load();
  await context.sync();

  if (style.isNullObject) {
    console.warn(`There's no existing style with the name '${styleName}'.`);
  } else {
    const borders: Word.BorderCollection = style.borders;
    borders.load("items");
    await context.sync();

    borders.outsideBorderType = Word.BorderType.dashed;
    borders.outsideBorderWidth = Word.BorderWidth.pt025;
    borders.outsideBorderColor = "green";
    console.log("Updated outside borders.");
  }
});

Campos

mixed = "Mixed"

Ancho mixto.

none = "None"

Ancho ninguno.

pt025 = "Pt025"

0,25 puntos.

pt050 = "Pt050"

0,50 puntos.

pt075 = "Pt075"

0,75 puntos.

pt100 = "Pt100"

1,00 punto. Este valor es predeterminado.

pt150 = "Pt150"

1,50 puntos.

pt225 = "Pt225"

2,25 puntos.

pt300 = "Pt300"

3,00 puntos.

pt450 = "Pt450"

4,50 puntos.

pt600 = "Pt600"

6,00 puntos.