MsWordVersion Enumeration

Allows Aspose.Wods to mimic MS Word version-specific application behavior.

Namespace:  Aspose.Words.Settings
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public enum MsWordVersion
Members
  Member nameValueDescription
Word20000 Optimize Aspose.Words behavior to match MS Word 2000 version.
Word20021 Optimize Aspose.Words behavior to match MS Word 2002 version.
Word20032 Optimize Aspose.Words behavior to match MS Word 2003 version.
Word20073 Optimize Aspose.Words behavior to match MS Word 2007 version.
Word20104 Optimize Aspose.Words behavior to match MS Word 2010 version.
Word20135 Optimize Aspose.Words behavior to match MS Word 2013 version.
Word20166 Optimize Aspose.Words behavior to match MS Word 2016 version.
Word20197 Optimize Aspose.Words behavior to match MS Word 2019 version.
Examples
Shows how to display the shape, inside a table or outside of it.
//Document doc = new Document(MyDir + "Shape.LayoutInCell.docx");
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

builder.StartTable();
builder.RowFormat.Height = 100;
builder.RowFormat.HeightRule = HeightRule.Exactly;

for (int i = 0; i < 31; i++)
{
    if (i != 0 && i % 7 == 0) builder.EndRow();
    builder.InsertCell();
    builder.Write("Cell contents");
}

builder.EndTable();

NodeCollection runs = doc.GetChildNodes(NodeType.Run, true);
int num = 1;

foreach (Run run in runs.OfType<Run>())
{
    Shape watermark = new Shape(doc, ShapeType.TextPlainText);
    watermark.RelativeHorizontalPosition = RelativeHorizontalPosition.Page;
    watermark.RelativeVerticalPosition = RelativeVerticalPosition.Page;
    // False - display the shape outside of table cell, True - display the shape outside of table cell
    watermark.IsLayoutInCell = true; 

    watermark.Width = 30;
    watermark.Height = 30;
    watermark.HorizontalAlignment = HorizontalAlignment.Center;
    watermark.VerticalAlignment = VerticalAlignment.Center;

    watermark.Rotation = -40;
    watermark.Fill.Color = Color.Gainsboro;
    watermark.StrokeColor = Color.Gainsboro;

    watermark.TextPath.Text = string.Format("{0}", num);
    watermark.TextPath.FontFamily = "Arial";

    watermark.Name = $"WaterMark_{Guid.NewGuid()}";
    // Property will take effect only if the WrapType property is set to something other than WrapType.Inline
    watermark.WrapType = WrapType.None; 
    watermark.BehindText = true;

    builder.MoveTo(run);
    builder.InsertNode(watermark);

    num = num + 1;
}

// Behaviour of MS Word on working with shapes in table cells is changed in the last versions
// Adding the following line is needed to make the shape displayed in center of a page
doc.CompatibilityOptions.OptimizeFor(MsWordVersion.Word2010);

doc.Save(ArtifactsDir + "Shape.LayoutInTableCell.docx");
See Also