FrameFormat Class
Represents frame related formatting for a paragraph.
Inheritance Hierarchy

Namespace: Aspose.Words
Assembly: Aspose.Words (in Aspose.Words.dll) Version: 19.9
public class FrameFormat

The FrameFormat type exposes the following members.

Public propertyCode exampleHeight
Gets the height of the specified frame.
Public propertyCode exampleHeightRule
Gets the rule for determining the height of the specified frame.
Public propertyCode exampleHorizontalAlignment
Gets horizontal alignment of the specified frame.
Public propertyCode exampleHorizontalDistanceFromText
Gets horizontal distance between a frame and the surrounding text, in points.
Public propertyCode exampleHorizontalPosition
Gets horizontal distance between the edge of the frame and the item specified by the RelativeHorizontalPosition property.
Public propertyCode exampleIsFrame
Returns true if the paragraph is a frame.
Public propertyCode exampleRelativeHorizontalPosition
Gets the relative horizontal position of a frame.
Public propertyCode exampleRelativeVerticalPosition
Gets the relative vertical position of a frame.
Public propertyCode exampleVerticalAlignment
Gets vertical alignment of the specified frame.
Public propertyCode exampleVerticalDistanceFromText
Specifies vertical distance (in points) between a frame and the surrounding text.
Public propertyCode exampleVerticalPosition
Gets vertical distance between the edge of the frame and the item specified by the RelativeVerticalPosition property.
Public propertyCode exampleWidth
Gets the width of the specified frame, in points.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)

This object is always created. If a paragraph is a frame, then all properties will contain respective values, otherwise all properties are set to their defaults.

Use IsFrame to check whether paragraph is a frame.

Shows how to get information about formatting properties of paragraph as frame.

Document doc = new Document(MyDir + "Paragraph.Frame.docx");

ParagraphCollection paragraphs = doc.FirstSection.Body.Paragraphs;

foreach (Paragraph paragraph in paragraphs.OfType<Paragraph>())
    if (paragraph.FrameFormat.IsFrame)
        Console.WriteLine("Width: " + paragraph.FrameFormat.Width);
        Console.WriteLine("Height: " + paragraph.FrameFormat.Height);
        Console.WriteLine("HeightRule: " + paragraph.FrameFormat.HeightRule);
        Console.WriteLine("HorizontalAlignment: " + paragraph.FrameFormat.HorizontalAlignment);
        Console.WriteLine("VerticalAlignment: " + paragraph.FrameFormat.VerticalAlignment);
        Console.WriteLine("HorizontalPosition: " + paragraph.FrameFormat.HorizontalPosition);
        Console.WriteLine("RelativeHorizontalPosition: " +
        Console.WriteLine("HorizontalDistanceFromText: " +
        Console.WriteLine("VerticalPosition: " + paragraph.FrameFormat.VerticalPosition);
        Console.WriteLine("RelativeVerticalPosition: " + paragraph.FrameFormat.RelativeVerticalPosition);
        Console.WriteLine("VerticalDistanceFromText: " + paragraph.FrameFormat.VerticalDistanceFromText);
See Also