public static void Run()
{
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_Text();
// ExStart:SetAnchorOfTextFrame
// Create an instance of Presentation class
Presentation presentation = new Presentation();
// Get the first slide
ISlide slide = presentation.Slides[0];
// Add an AutoShape of Rectangle type
IAutoShape ashp = slide.Shapes.AddAutoShape(ShapeType.Rectangle, 150, 75, 350, 350);
// Add TextFrame to the Rectangle
ashp.AddTextFrame(" ");
ashp.FillFormat.FillType = FillType.NoFill;
// Accessing the text frame
ITextFrame txtFrame = ashp.TextFrame;
txtFrame.TextFrameFormat.AnchoringType = TextAnchorType.Bottom;
// Create the Paragraph object for text frame
IParagraph para = txtFrame.Paragraphs[0];
// Create Portion object for paragraph
IPortion portion = para.Portions[0];
portion.Text = "A quick brown fox jumps over the lazy dog. A quick brown fox jumps over the lazy dog.";
portion.PortionFormat.FillFormat.FillType = FillType.Solid;
portion.PortionFormat.FillFormat.SolidFillColor.Color = Color.Black;
// ExEnd:SetAnchorOfTextFrame
// Save Presentation
presentation.Save(dataDir + "AnchorText_out.pptx", SaveFormat.Pptx);
}
}