OfficeIMO

API Reference

Class

ImageShapeStyleHelper

Namespace OfficeIMO.Word
Assembly OfficeIMO.Word
Modifiers static

Helper class for getting and setting the style of a V.Shape object.

Inheritance

  • Object
  • ImageShapeStyleHelper

Examples

This is a sample of how to use this class.


// Get the style
var style = ShapeStyleHelper.GetStyle(shape1);

// Modify the style
style["position"] = "absolute";
style["margin-left"] = "0";

// Set the style
ShapeStyleHelper.SetStyle(shape1, style);

        

Methods

public static Dictionary<String, String> GetStyle(Shape shape) #
Returns: Dictionary<String, String>

Retrieves the style attributes of a Shape as a dictionary.

Parameters

shape DocumentFormat.OpenXml.Vml.Shape requiredposition: 0
The VML Shape whose style should be parsed.

Returns

A dictionary containing style names and values.

public static Void SetStyle(Shape shape, Dictionary<String, String> style) #
Returns: Void

Applies the provided style dictionary to the given Shape.

Parameters

shape DocumentFormat.OpenXml.Vml.Shape requiredposition: 0
The VML Shape to update.
style System.Collections.Generic.Dictionary{System.String,System.String} requiredposition: 1
The style dictionary to serialize and assign.