+ //Apply bounding box size and position.
+ picture.Crop.ContainerWidth = 280.8F;
+ picture.Crop.ContainerHeight = 180F;
+ picture.Crop.ContainerLeft = 360F;
+ picture.Crop.ContainerTop = 180.5F;
+ //Apply cropping size and offsets.
+ picture.Crop.Width = 410.4F;
+ picture.Crop.Height = 252F;
+ picture.Crop.OffsetX = -28.8F;
+ picture.Crop.OffsetY = 7.2F;
+
+
+ //Apply bounding box size and position.
+ picture.Crop.ContainerWidth = 280.8F;
+ picture.Crop.ContainerHeight = 180F;
+ picture.Crop.ContainerLeft = 360F;
+ picture.Crop.ContainerTop = 180.5F;
+ //Apply cropping size and offsets.
+ picture.Crop.Width = 410.4F;
+ picture.Crop.Height = 252F;
+ picture.Crop.OffsetX = -28.8F;
+ picture.Crop.OffsetY = 7.2F;
+
+
+ //Apply bounding box size and position.
+ picture.Crop.ContainerWidth = 280.8F;
+ picture.Crop.ContainerHeight = 180F;
+ picture.Crop.ContainerLeft = 360F;
+ picture.Crop.ContainerTop = 180.5F;
+ //Apply cropping size and offsets.
+ picture.Crop.Width = 410.4F;
+ picture.Crop.Height = 252F;
+ picture.Crop.OffsetX = -28.8F;
+ picture.Crop.OffsetY = 7.2F;
+
+
+ //Apply bounding box size and position.
+ picture.Crop.ContainerWidth = 280.8F;
+ picture.Crop.ContainerHeight = 180F;
+ picture.Crop.ContainerLeft = 360F;
+ picture.Crop.ContainerTop = 180.5F;
+ //Apply cropping size and offsets.
+ picture.Crop.Width = 410.4F;
+ picture.Crop.Height = 252F;
+ picture.Crop.OffsetX = -28.8F;
+ picture.Crop.OffsetY = 7.2F;
+
+
+ //Apply bounding box size and position.
+ picture.Crop.ContainerWidth = 280.8F;
+ picture.Crop.ContainerHeight = 180F;
+ picture.Crop.ContainerLeft = 360F;
+ picture.Crop.ContainerTop = 180.5F;
+ //Apply cropping size and offsets.
+ picture.Crop.Width = 410.4F;
+ picture.Crop.Height = 252F;
+ picture.Crop.OffsetX = -28.8F;
+ picture.Crop.OffsetY = 7.2F;
+
+
+ //Apply bounding box size and position.
+ picture.Crop.ContainerWidth = 280.8F;
+ picture.Crop.ContainerHeight = 180F;
+ picture.Crop.ContainerLeft = 360F;
+ picture.Crop.ContainerTop = 180.5F;
+ //Apply cropping size and offsets.
+ picture.Crop.Width = 410.4F;
+ picture.Crop.Height = 252F;
+ picture.Crop.OffsetX = -28.8F;
+ picture.Crop.OffsetY = 7.2F;
+
+
+ //Apply bounding box size and position.
+ picture.Crop.ContainerWidth = 280.8F;
+ picture.Crop.ContainerHeight = 180F;
+ picture.Crop.ContainerLeft = 360F;
+ picture.Crop.ContainerTop = 180.5F;
+ //Apply cropping size and offsets.
+ picture.Crop.Width = 410.4F;
+ picture.Crop.Height = 252F;
+ picture.Crop.OffsetX = -28.8F;
+ picture.Crop.OffsetY = 7.2F;
+
+
+ //Apply bounding box size and position.
+ picture.Crop.ContainerWidth = 280.8F;
+ picture.Crop.ContainerHeight = 180F;
+ picture.Crop.ContainerLeft = 360F;
+ picture.Crop.ContainerTop = 180.5F;
+ //Apply cropping size and offsets.
+ picture.Crop.Width = 410.4F;
+ picture.Crop.Height = 252F;
+ picture.Crop.OffsetX = -28.8F;
+ picture.Crop.OffsetY = 7.2F;
+
+
+ //Apply bounding box size and position.
+ picture.Crop.ContainerWidth = 280.8F;
+ picture.Crop.ContainerHeight = 180F;
+ picture.Crop.ContainerLeft = 360F;
+ picture.Crop.ContainerTop = 180.5F;
+ //Apply cropping size and offsets.
+ picture.Crop.Width = 410.4F;
+ picture.Crop.Height = 252F;
+ picture.Crop.OffsetX = -28.8F;
+ picture.Crop.OffsetY = 7.2F;
+
+
+ //Apply bounding box size and position.
+ picture.Crop.ContainerWidth = 280.8F;
+ picture.Crop.ContainerHeight = 180F;
+ picture.Crop.ContainerLeft = 360F;
+ picture.Crop.ContainerTop = 180.5F;
+ //Apply cropping size and offsets.
+ picture.Crop.Width = 410.4F;
+ picture.Crop.Height = 252F;
+ picture.Crop.OffsetX = -28.8F;
+ picture.Crop.OffsetY = 7.2F;
+
+
+ //Apply bounding box size and position.
+ picture.Crop.ContainerWidth = 280.8F;
+ picture.Crop.ContainerHeight = 180F;
+ picture.Crop.ContainerLeft = 360F;
+ picture.Crop.ContainerTop = 180.5F;
+ //Apply cropping size and offsets.
+ picture.Crop.Width = 410.4F;
+ picture.Crop.Height = 252F;
+ picture.Crop.OffsetX = -28.8F;
+ picture.Crop.OffsetY = 7.2F;
+
+
+ //Apply bounding box size and position.
+ picture.Crop.ContainerWidth = 280.8F;
+ picture.Crop.ContainerHeight = 180F;
+ picture.Crop.ContainerLeft = 360F;
+ picture.Crop.ContainerTop = 180.5F;
+ //Apply cropping size and offsets.
+ picture.Crop.Width = 410.4F;
+ picture.Crop.Height = 252F;
+ picture.Crop.OffsetX = -28.8F;
+ picture.Crop.OffsetY = 7.2F;
+
+
+ //Apply bounding box size and position.
+ picture.Crop.ContainerWidth = 280.8F;
+ picture.Crop.ContainerHeight = 180F;
+ picture.Crop.ContainerLeft = 360F;
+ picture.Crop.ContainerTop = 180.5F;
+ //Apply cropping size and offsets.
+ picture.Crop.Width = 410.4F;
+ picture.Crop.Height = 252F;
+ picture.Crop.OffsetX = -28.8F;
+ picture.Crop.OffsetY = 7.2F;
+
+
+ //Apply bounding box size and position.
+ picture.Crop.ContainerWidth = 280.8F;
+ picture.Crop.ContainerHeight = 180F;
+ picture.Crop.ContainerLeft = 360F;
+ picture.Crop.ContainerTop = 180.5F;
+ //Apply cropping size and offsets.
+ picture.Crop.Width = 410.4F;
+ picture.Crop.Height = 252F;
+ picture.Crop.OffsetX = -28.8F;
+ picture.Crop.OffsetY = 7.2F;
+
+
+ //Apply bounding box size and position.
+ picture.Crop.ContainerWidth = 280.8F;
+ picture.Crop.ContainerHeight = 180F;
+ picture.Crop.ContainerLeft = 360F;
+ picture.Crop.ContainerTop = 180.5F;
+ //Apply cropping size and offsets.
+ picture.Crop.Width = 410.4F;
+ picture.Crop.Height = 252F;
+ picture.Crop.OffsetX = -28.8F;
+ picture.Crop.OffsetY = 7.2F;
+
+
+ //Apply bounding box size and position.
+ picture.Crop.ContainerWidth = 280.8F;
+ picture.Crop.ContainerHeight = 180F;
+ picture.Crop.ContainerLeft = 360F;
+ picture.Crop.ContainerTop = 180.5F;
+ //Apply cropping size and offsets.
+ picture.Crop.Width = 410.4F;
+ picture.Crop.Height = 252F;
+ picture.Crop.OffsetX = -28.8F;
+ picture.Crop.OffsetY = 7.2F;
+
+
+ //Creates a new Word document
+ WordDocument document = new WordDocument();
+ //Adds new section to the document
+ IWSection section = document.AddSection();
+ //Adds new paragraph to the section
+ WParagraph paragraph = section.AddParagraph() as WParagraph;
+ //Creates new group shape
+ GroupShape groupShape = new GroupShape(document);
+ //Adds group shape to the paragraph.
+ paragraph.ChildEntities.Add(groupShape);
+ //Creates new shape
+ Shape shape = new Shape(document, AutoShapeType.RoundedRectangle);
+ //Sets height and width for shape
+ shape.Height = 100;
+ shape.Width = 150;
+ //Sets horizontal and vertical position
+ shape.HorizontalPosition = 72;
+ shape.VerticalPosition = 72;
+ //Set wrapping style for shape
+ shape.WrapFormat.TextWrappingStyle = TextWrappingStyle.InFrontOfText;
+ //Sets horizontal and vertical origin
+ shape.HorizontalOrigin = HorizontalOrigin.Page;
+ shape.VerticalOrigin = VerticalOrigin.Page;
+ //Adds the specified shape to group shape
+ groupShape.Add(shape);
+ //Creates new picture
+ WPicture picture = new WPicture(document);
+ picture.LoadImage(Image.FromFile("Image.png"));
+ //Sets wrapping style for picture
+ picture.TextWrappingStyle = TextWrappingStyle.InFrontOfText;
+ //Sets height and width for the image
+ picture.Height = 100;
+ picture.Width = 100;
+ //Sets horizontal and vertical position
+ picture.HorizontalPosition = 400;
+ picture.VerticalPosition = 150;
+ //Sets horizontal and vertical origin
+ picture.HorizontalOrigin = HorizontalOrigin.Page;
+ picture.VerticalOrigin = VerticalOrigin.Page;
+ //Adds the specified picture to group shape
+ groupShape.Add(picture);
+ //Sets group shape rotation in degree
+ groupShape.Rotation = 90;
+ //Saves the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Closes the document
+ document.Close();
+
+
+ 'Creates a new Word document
+ Dim document As WordDocument = New WordDocument
+ 'Adds new section to the document
+ Dim section As IWSection = document.AddSection
+ 'Adds new paragraph to the section
+ Dim paragraph As WParagraph = CType(section.AddParagraph, WParagraph)
+ 'Creates new group shape
+ Dim groupShape As GroupShape = New GroupShape(document)
+ 'Adds group shape to the paragraph.
+ paragraph.ChildEntities.Add(groupShape)
+ Dim shape As Shape = New Shape(document, AutoShapeType.RoundedRectangle)
+ 'Sets height and width for shape
+ shape.Height = 100
+ shape.Width = 150
+ 'Sets horizontal and vertical position
+ shape.HorizontalPosition = 72
+ shape.VerticalPosition = 72
+ 'Set wrapping style for shape
+ shape.WrapFormat.TextWrappingStyle = TextWrappingStyle.InFrontOfText
+ 'Sets horizontal and vertical origin
+ shape.HorizontalOrigin = HorizontalOrigin.Page
+ shape.VerticalOrigin = VerticalOrigin.Page
+ 'Adds the specified shape to group shape
+ groupShape.Add(shape)
+ Dim picture As WPicture = New WPicture(document)
+ picture.LoadImage(Image.FromFile("Image.png"))
+ 'Sets wrapping style for picture
+ picture.TextWrappingStyle = TextWrappingStyle.InFrontOfText
+ 'Sets height and width for the image
+ picture.Height = 100
+ picture.Width = 100
+ 'Sets horizontal and vertical position
+ picture.HorizontalPosition = 400
+ picture.VerticalPosition = 150
+ 'Sets horizontal and vertical origin
+ picture.HorizontalOrigin = HorizontalOrigin.Page
+ picture.VerticalOrigin = VerticalOrigin.Page
+ 'Adds the specified picture to group shape
+ groupShape.Add(picture)
+ 'Sets group shape rotation in degree
+ groupShape.Rotation = 90
+ 'Saves the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Closes the document
+ document.Close()
+
+
+ //Creates a new Word document
+ WordDocument document = new WordDocument();
+ //Adds new section to the document
+ IWSection section = document.AddSection();
+ //Adds new paragraph to the section
+ WParagraph paragraph = section.AddParagraph() as WParagraph;
+ //Creates new group shape
+ GroupShape groupShape = new GroupShape(document);
+ //Adds group shape to the paragraph.
+ paragraph.ChildEntities.Add(groupShape);
+ //Creates new shape
+ Shape shape = new Shape(document, AutoShapeType.RoundedRectangle);
+ //Sets height and width for shape
+ shape.Height = 100;
+ shape.Width = 150;
+ //Sets horizontal and vertical position
+ shape.HorizontalPosition = 72;
+ shape.VerticalPosition = 72;
+ //Set wrapping style for shape
+ shape.WrapFormat.TextWrappingStyle = TextWrappingStyle.InFrontOfText;
+ //Sets horizontal and vertical origin
+ shape.HorizontalOrigin = HorizontalOrigin.Page;
+ shape.VerticalOrigin = VerticalOrigin.Page;
+ //Adds the specified shape to group shape
+ groupShape.Add(shape);
+ //Creates new picture
+ WPicture picture = new WPicture(document);
+ picture.LoadImage(Image.FromFile("Image.png"));
+ //Sets wrapping style for picture
+ picture.TextWrappingStyle = TextWrappingStyle.InFrontOfText;
+ //Sets height and width for the image
+ picture.Height = 100;
+ picture.Width = 100;
+ //Sets horizontal and vertical position
+ picture.HorizontalPosition = 400;
+ picture.VerticalPosition = 150;
+ //Sets horizontal and vertical origin
+ picture.HorizontalOrigin = HorizontalOrigin.Page;
+ picture.VerticalOrigin = VerticalOrigin.Page;
+ //Adds the specified picture to group shape
+ groupShape.Add(picture);
+ //Sets horizontal flip to the group shape
+ groupShape.FlipHorizontal = true;
+ //Saves the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Closes the document
+ document.Close();
+
+
+ 'Creates a new Word document
+ Dim document As WordDocument = New WordDocument
+ 'Adds new section to the document
+ Dim section As IWSection = document.AddSection
+ 'Adds new paragraph to the section
+ Dim paragraph As WParagraph = CType(section.AddParagraph, WParagraph)
+ 'Creates new group shape
+ Dim groupShape As GroupShape = New GroupShape(document)
+ 'Adds group shape to the paragraph.
+ paragraph.ChildEntities.Add(groupShape)
+ Dim shape As Shape = New Shape(document, AutoShapeType.RoundedRectangle)
+ 'Sets height and width for shape
+ shape.Height = 100
+ shape.Width = 150
+ 'Sets horizontal and vertical position
+ shape.HorizontalPosition = 72
+ shape.VerticalPosition = 72
+ 'Set wrapping style for shape
+ shape.WrapFormat.TextWrappingStyle = TextWrappingStyle.InFrontOfText
+ 'Sets horizontal and vertical origin
+ shape.HorizontalOrigin = HorizontalOrigin.Page
+ shape.VerticalOrigin = VerticalOrigin.Page
+ 'Adds the specified shape to group shape
+ groupShape.Add(shape)
+ Dim picture As WPicture = New WPicture(document)
+ picture.LoadImage(Image.FromFile("Image.png"))
+ 'Sets wrapping style for picture
+ picture.TextWrappingStyle = TextWrappingStyle.InFrontOfText
+ 'Sets height and width for the image
+ picture.Height = 100
+ picture.Width = 100
+ 'Sets horizontal and vertical position
+ picture.HorizontalPosition = 400
+ picture.VerticalPosition = 150
+ 'Sets horizontal and vertical origin
+ picture.HorizontalOrigin = HorizontalOrigin.Page
+ picture.VerticalOrigin = VerticalOrigin.Page
+ 'Adds the specified picture to group shape
+ groupShape.Add(picture)
+ 'Sets horizontal flip to the group shape
+ groupShape.FlipHorizontal = True
+ 'Saves the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Closes the document
+ document.Close()
+
+
+ //Creates a new Word document
+ WordDocument document = new WordDocument();
+ //Adds new section to the document
+ IWSection section = document.AddSection();
+ //Adds new paragraph to the section
+ WParagraph paragraph = section.AddParagraph() as WParagraph;
+ //Creates new group shape
+ GroupShape groupShape = new GroupShape(document);
+ //Adds group shape to the paragraph.
+ paragraph.ChildEntities.Add(groupShape);
+ //Creates new shape
+ Shape shape = new Shape(document, AutoShapeType.RoundedRectangle);
+ //Sets height and width for shape
+ shape.Height = 100;
+ shape.Width = 150;
+ //Sets horizontal and vertical position
+ shape.HorizontalPosition = 72;
+ shape.VerticalPosition = 72;
+ //Set wrapping style for shape
+ shape.WrapFormat.TextWrappingStyle = TextWrappingStyle.InFrontOfText;
+ //Sets horizontal and vertical origin
+ shape.HorizontalOrigin = HorizontalOrigin.Page;
+ shape.VerticalOrigin = VerticalOrigin.Page;
+ //Adds the specified shape to group shape
+ groupShape.Add(shape);
+ //Creates new picture
+ WPicture picture = new WPicture(document);
+ picture.LoadImage(Image.FromFile("Image.png"));
+ //Sets wrapping style for picture
+ picture.TextWrappingStyle = TextWrappingStyle.InFrontOfText;
+ //Sets height and width for the image
+ picture.Height = 100;
+ picture.Width = 100;
+ //Sets horizontal and vertical position
+ picture.HorizontalPosition = 400;
+ picture.VerticalPosition = 150;
+ //Sets horizontal and vertical origin
+ picture.HorizontalOrigin = HorizontalOrigin.Page;
+ picture.VerticalOrigin = VerticalOrigin.Page;
+ //Adds the specified picture to group shape
+ groupShape.Add(picture);
+ //Sets vertical flip to the group shape
+ groupShape.FlipVertical = true;
+ //Saves the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Closes the document
+ document.Close();
+
+
+ 'Creates a new Word document
+ Dim document As WordDocument = New WordDocument
+ 'Adds new section to the document
+ Dim section As IWSection = document.AddSection
+ 'Adds new paragraph to the section
+ Dim paragraph As WParagraph = CType(section.AddParagraph, WParagraph)
+ 'Creates new group shape
+ Dim groupShape As GroupShape = New GroupShape(document)
+ 'Adds group shape to the paragraph.
+ paragraph.ChildEntities.Add(groupShape)
+ Dim shape As Shape = New Shape(document, AutoShapeType.RoundedRectangle)
+ 'Sets height and width for shape
+ shape.Height = 100
+ shape.Width = 150
+ 'Sets horizontal and vertical position
+ shape.HorizontalPosition = 72
+ shape.VerticalPosition = 72
+ 'Set wrapping style for shape
+ shape.WrapFormat.TextWrappingStyle = TextWrappingStyle.InFrontOfText
+ 'Sets horizontal and vertical origin
+ shape.HorizontalOrigin = HorizontalOrigin.Page
+ shape.VerticalOrigin = VerticalOrigin.Page
+ 'Adds the specified shape to group shape
+ groupShape.Add(shape)
+ Dim picture As WPicture = New WPicture(document)
+ picture.LoadImage(Image.FromFile("Image.png"))
+ 'Sets wrapping style for picture
+ picture.TextWrappingStyle = TextWrappingStyle.InFrontOfText
+ 'Sets height and width for the image
+ picture.Height = 100
+ picture.Width = 100
+ 'Sets horizontal and vertical position
+ picture.HorizontalPosition = 400
+ picture.VerticalPosition = 150
+ 'Sets horizontal and vertical origin
+ picture.HorizontalOrigin = HorizontalOrigin.Page
+ picture.VerticalOrigin = VerticalOrigin.Page
+ 'Adds the specified picture to group shape
+ groupShape.Add(picture)
+ 'Sets vertical flip to the group shape
+ groupShape.FlipVertical = True
+ 'Saves the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Closes the document
+ document.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add the section into Word document
+ WSection section = document.AddSection() as WSection;
+ //Add a paragraph to created section
+ WParagraph paragraph = section.AddParagraph() as WParagraph;
+ string paraText = "Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula";
+ //Append the text to the created paragraph
+ paragraph.AppendText(paraText);
+ //Add a paragraph to created section
+ paragraph = section.AddParagraph() as WParagraph;
+ //Add the rectangle shape to the document
+ Syncfusion.DocIO.DLS.Shape shape = paragraph.AppendShape(AutoShapeType.Rectangle, 200, 75);
+ //Set wrapping type as inline
+ shape.WrapFormat.TextWrappingStyle = TextWrappingStyle.Inline;
+ //Set the fillformat for the shape
+ shape.FillFormat.Color = Color.AliceBlue;
+ shape.FillFormat.Fill = true;
+ shape.FillFormat.Transparency = 60;
+ //Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add the section into Word document
+ Dim section As WSection = TryCast(document.AddSection(), WSection)
+ 'Add a paragraph to created section
+ Dim paragraph As WParagraph = TryCast(section.AddParagraph(), WParagraph)
+ Dim paraText As String = "Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula"
+ 'Append the text to the created paragraph
+ paragraph.AppendText(paraText)
+ 'Add a paragraph to created section
+ paragraph = TryCast(section.AddParagraph(), WParagraph)
+ 'Add the rectangle shape to the document
+ Dim shape As Syncfusion.DocIO.DLS.Shape = paragraph.AppendShape(AutoShapeType.Rectangle, 200, 75)
+ 'Set wrapping type as inline
+ shape.WrapFormat.TextWrappingStyle = TextWrappingStyle.Inline
+ 'Set the fillformat for the shape
+ shape.FillFormat.Color = Color.AliceBlue
+ shape.FillFormat.Fill = True
+ shape.FillFormat.Transparency = 60
+ 'Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add the section into Word document
+ WSection section = document.AddSection() as WSection;
+ //Add a paragraph to created section
+ WParagraph paragraph = section.AddParagraph() as WParagraph;
+ string paraText = "Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula";
+ //Append the text to the created paragraph
+ paragraph.AppendText(paraText);
+ //Add a paragraph to created section
+ paragraph = section.AddParagraph() as WParagraph;
+ //Add the rectangle shape to the document
+ Syncfusion.DocIO.DLS.Shape shape = paragraph.AppendShape(AutoShapeType.Rectangle, 200, 75);
+ //Set wrapping type as inline
+ shape.WrapFormat.TextWrappingStyle = TextWrappingStyle.Inline;
+ //Set the line format for the shape
+ shape.LineFormat.Line = true;
+ shape.LineFormat.Color = Color.Red;
+ shape.LineFormat.DashStyle = LineDashing.DashDot;
+ shape.LineFormat.Style = Syncfusion.DocIO.DLS.LineStyle.ThickThin;
+ shape.LineFormat.Weight = 3;
+ shape.LineFormat.Transparency = 30;
+ //Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add the section into Word document
+ Dim section As WSection = TryCast(document.AddSection(), WSection)
+ 'Add a paragraph to created section
+ Dim paragraph As WParagraph = TryCast(section.AddParagraph(), WParagraph)
+ Dim paraText As String = "Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula"
+ 'Append the text to the created paragraph
+ paragraph.AppendText(paraText)
+ 'Add a paragraph to created section
+ paragraph = TryCast(section.AddParagraph(), WParagraph)
+ 'Add the rectangle shape to the document
+ Dim shape As Syncfusion.DocIO.DLS.Shape = paragraph.AppendShape(AutoShapeType.Rectangle, 200, 75)
+ 'Set wrapping type as inline
+ shape.WrapFormat.TextWrappingStyle = TextWrappingStyle.Inline
+ 'Set the line format for the shape
+ shape.LineFormat.Line = True
+ shape.LineFormat.Color = Color.Red
+ shape.LineFormat.DashStyle = LineDashing.DashDot
+ shape.LineFormat.Style = Syncfusion.DocIO.DLS.LineStyle.ThickThin
+ shape.LineFormat.Weight = 3
+ shape.LineFormat.Transparency = 30
+ 'Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument("Template.docx");
+ //Add the section into Word document
+ WSection section = document.AddSection() as WSection;
+ //Add a paragraph to created section
+ WParagraph paragraph = document.Sections[0].Paragraphs[0];
+ //Create a new shape
+ Syncfusion.DocIO.DLS.Shape shape = new Syncfusion.DocIO.DLS.Shape(document, AutoShapeType.Rectangle);
+ //Specify the shape formatting options
+ shape.AlternativeText = "demo shape";
+ shape.FillFormat.Color = Color.LightBlue;
+ shape.Height = 75;
+ shape.Width = 100;
+ shape.HorizontalAlignment = ShapeHorizontalAlignment.Left;
+ shape.HorizontalOrigin = HorizontalOrigin.Margin;
+ shape.LineFormat.Line = true;
+ shape.LineFormat.Style = Syncfusion.DocIO.DLS.LineStyle.Single;
+ shape.Name = "Rectangle";
+ shape.Title = "Rectangle shape demo";
+ shape.VerticalAlignment = ShapeVerticalAlignment.Center;
+ shape.VerticalOrigin = VerticalOrigin.Page;
+ shape.WrapFormat.TextWrappingStyle = TextWrappingStyle.Square;
+ string paraText = "Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula";
+ //Add the new paragraph to shape with some text
+ shape.TextBody.AddParagraph().AppendText(paraText);
+ //Add the shape to paragraph
+ paragraph.ChildEntities.Add(shape);
+ //Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument("Template.docx")
+ 'Add the section into Word document
+ Dim section As WSection = TryCast(document.AddSection(), WSection)
+ 'Add a paragraph to created section
+ Dim paragraph As WParagraph = document.Sections(0).Paragraphs(0)
+ 'Create a new shape
+ Dim shape As New Syncfusion.DocIO.DLS.Shape(document, AutoShapeType.Rectangle)
+ 'Specify the shape formatting options
+ shape.AlternativeText = "demo shape"
+ shape.FillFormat.Color = Color.LightBlue
+ shape.Height = 75
+ shape.Width = 100
+ shape.HorizontalAlignment = ShapeHorizontalAlignment.Left
+ shape.HorizontalOrigin = HorizontalOrigin.Margin
+ shape.LineFormat.Line = True
+ shape.LineFormat.Style = Syncfusion.DocIO.DLS.LineStyle.[Single]
+ shape.Name = "Rectangle"
+ shape.Title = "Rectangle shape demo"
+ shape.VerticalAlignment = ShapeVerticalAlignment.Center
+ shape.VerticalOrigin = VerticalOrigin.Page
+ shape.WrapFormat.TextWrappingStyle = TextWrappingStyle.Square
+ Dim paraText As String = "Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula"
+ 'Add the new paragraph to shape with some text
+ shape.TextBody.AddParagraph().AppendText(paraText)
+ 'Add the shape to paragraph
+ paragraph.ChildEntities.Add(shape)
+ 'Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ //Creates a new Word document
+ WordDocument document = new WordDocument();
+ //Adds new section to the document
+ IWSection section = document.AddSection();
+ //Adds new paragraph to the section
+ WParagraph paragraph = section.AddParagraph() as WParagraph;
+ //Adds new shape to the document
+ Shape rectangle = paragraph.AppendShape(AutoShapeType.RoundedRectangle, 150, 100);
+ //Adds textbody contents to the shape
+ paragraph = rectangle.TextBody.AddParagraph() as WParagraph;
+ IWTextRange text = paragraph.AppendText("This text is in rounded rectangle shape");
+ //Sets rectangle shape rotation in degree
+ rectangle.Rotation = 90;
+ //Saves the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Closes the document
+ document.Close();
+
+
+ 'Creates a new Word document
+ Dim document As WordDocument = New WordDocument
+ 'Adds new section to the document
+ Dim section As IWSection = document.AddSection
+ 'Adds new paragraph to the section
+ Dim paragraph As WParagraph = CType(section.AddParagraph, WParagraph)
+ 'Adds new shape to the document
+ Dim rectangle As Shape = paragraph.AppendShape(AutoShapeType.RoundedRectangle, 150, 100)
+ 'Adds textbody contents to the shape
+ paragraph = CType(rectangle.TextBody.AddParagraph, WParagraph)
+ Dim text As IWTextRange = paragraph.AppendText("This text is in rounded rectangle shape")
+ 'Sets rectangle shape rotation in degree
+ rectangle.Rotation = 90
+ 'Saves the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Closes the document
+ document.Close()
+
+
+ //Creates a new Word document
+ WordDocument document = new WordDocument();
+ //Adds new section to the document
+ IWSection section = document.AddSection();
+ //Adds new paragraph to the section
+ WParagraph paragraph = section.AddParagraph() as WParagraph;
+ //Adds new shape to the document
+ Shape rectangle = paragraph.AppendShape(AutoShapeType.RoundedRectangle, 150, 100);
+ //Adds textbody contents to the shape
+ paragraph = rectangle.TextBody.AddParagraph() as WParagraph;
+ IWTextRange text = paragraph.AppendText("This text is in rounded rectangle shape");
+ //Sets horizontal flip to the rectangle shape
+ rectangle.FlipHorizontal = true;
+ //Saves the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Closes the document
+ document.Close();
+
+
+ 'Creates a new Word document
+ Dim document As WordDocument = New WordDocument
+ 'Adds new section to the document
+ Dim section As IWSection = document.AddSection
+ 'Adds new paragraph to the section
+ Dim paragraph As WParagraph = CType(section.AddParagraph, WParagraph)
+ 'Adds new shape to the document
+ Dim rectangle As Shape = paragraph.AppendShape(AutoShapeType.RoundedRectangle, 150, 100)
+ 'Adds textbody contents to the shape
+ paragraph = CType(rectangle.TextBody.AddParagraph, WParagraph)
+ Dim text As IWTextRange = paragraph.AppendText("This text is in rounded rectangle shape")
+ 'Sets horizontal flip to the rectangle shape
+ rectangle.FlipHorizontal = True
+ 'Saves the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Closes the document
+ document.Close()
+
+
+ //Creates a new Word document
+ WordDocument document = new WordDocument();
+ //Adds new section to the document
+ IWSection section = document.AddSection();
+ //Adds new paragraph to the section
+ WParagraph paragraph = section.AddParagraph() as WParagraph;
+ //Adds new shape to the document
+ Shape rectangle = paragraph.AppendShape(AutoShapeType.RoundedRectangle, 150, 100);
+ //Adds textbody contents to the shape
+ paragraph = rectangle.TextBody.AddParagraph() as WParagraph;
+ IWTextRange text = paragraph.AppendText("This text is in rounded rectangle shape");
+ //Sets vertical flip to the rectangle shape
+ rectangle.FlipVertical = true;
+ //Saves the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Closes the document
+ document.Close();
+
+
+ 'Creates a new Word document
+ Dim document As WordDocument = New WordDocument
+ 'Adds new section to the document
+ Dim section As IWSection = document.AddSection
+ 'Adds new paragraph to the section
+ Dim paragraph As WParagraph = CType(section.AddParagraph, WParagraph)
+ 'Adds new shape to the document
+ Dim rectangle As Shape = paragraph.AppendShape(AutoShapeType.RoundedRectangle, 150, 100)
+ 'Adds textbody contents to the shape
+ paragraph = CType(rectangle.TextBody.AddParagraph, WParagraph)
+ Dim text As IWTextRange = paragraph.AppendText("This text is in rounded rectangle shape")
+ 'Sets vertical flip to the rectangle shape
+ rectangle.FlipVertical = True
+ 'Saves the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Closes the document
+ document.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ WParagraph paragraph = section.AddParagraph() as WParagraph;
+ paragraph.AppendText("Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet");
+ //Add new shape to the document
+ Shape rectangle = paragraph.AppendShape(AutoShapeType.RoundedRectangle, 150, 100);
+ //Set position for shape
+ rectangle.VerticalPosition = 72;
+ rectangle.HorizontalPosition = 72;
+ //Set text wrapping style
+ rectangle.WrapFormat.TextWrappingStyle = TextWrappingStyle.TopAndBottom;
+ rectangle.WrapFormat.DistanceBottom = 10;
+ rectangle.WrapFormat.DistanceLeft = 10;
+ rectangle.WrapFormat.DistanceRight = 10;
+ rectangle.WrapFormat.DistanceTop = 20;
+ paragraph.AppendText("Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet");
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As WParagraph = TryCast(section.AddParagraph(), WParagraph)
+ paragraph.AppendText("Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet")
+ 'Add new shape to the document
+ Dim rectangle As Shape = paragraph.AppendShape(AutoShapeType.RoundedRectangle, 150, 100)
+ 'Set position for shape
+ rectangle.VerticalPosition = 72
+ rectangle.HorizontalPosition = 72
+ 'Set text wrapping style
+ rectangle.WrapFormat.TextWrappingStyle = TextWrappingStyle.TopAndBottom
+ rectangle.WrapFormat.DistanceBottom = 10
+ rectangle.WrapFormat.DistanceLeft = 10
+ rectangle.WrapFormat.DistanceRight = 10
+ rectangle.WrapFormat.DistanceTop = 20
+ paragraph.AppendText("Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet")
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ //Loads an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Bookmarks.docx", FormatType.Docx);
+ //Creates the bookmark navigator instance to access the bookmark
+ BookmarksNavigator bookmarkNavigator = new BookmarksNavigator(document);
+ //Moves the virtual cursor to the location before the end of the bookmark "Northwind"
+ bookmarkNavigator.MoveToBookmark("Northwind");
+ //Gets the bookmark content as WordDocumentPart
+ WordDocumentPart wordDocumentPart = bookmarkNavigator.GetContent();
+ //Saves the WordDocumentPart as separate Word document
+ WordDocument newDocument = wordDocumentPart.GetAsWordDocument();
+ newDocument.Save("Result.docx", FormatType.Docx);
+ //Releases the resources hold by WordDocument instance
+ newDocument.Close();
+ document.Close();
+
+
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Bookmarks.docx", FormatType.Docx)
+ 'Creates the bookmark navigator instance to access the bookmark
+ Dim bookmarkNavigator As New BookmarksNavigator(document)
+ 'Moves the virtual cursor to the location before the end of the bookmark "Northwind"
+ bookmarkNavigator.MoveToBookmark("Northwind")
+ 'Gets the bookmark content as WordDocumentPart
+ Dim wordDocumentPart As WordDocumentPart = bookmarkNavigator.GetContent()
+ 'Saves the WordDocumentPart as separate Word document
+ Dim newDocument As WordDocument = wordDocumentPart.GetAsWordDocument()
+ newDocument.Save("Result.docx", FormatType.Docx)
+ 'Releases the resources hold by WordDocument instance
+ newDocument.Close()
+ document.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ WordDocument document = new WordDocument("Bookmarks.docx", FormatType.Docx);
+ //Create the bookmark navigator instance to access the bookmark
+ BookmarksNavigator bookmarkNavigator = new BookmarksNavigator(document);
+ //Move the virtual cursor to the before the end location of the bookmark "Northwind"
+ bookmarkNavigator.MoveToBookmark("Northwind");
+ //Get the bookmark content
+ TextBodyPart part = bookmarkNavigator.GetBookmarkContent();
+ //Add the retrieved content into another new section
+ document.AddSection();
+ foreach(TextBodyItem item in part.BodyItems)
+ document.LastSection.Body.ChildEntities.Add(item);
+ document.Save("Result.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ Dim document As New WordDocument("Bookmarks.docx", FormatType.Docx)
+ 'Create the bookmark navigator instance to access the bookmark
+ Dim bookmarkNavigator As New BookmarksNavigator(document)
+ 'Move the virtual cursor to the before the end location of the bookmark "Northwind"
+ bookmarkNavigator.MoveToBookmark("Northwind")
+ 'Get the bookmark content
+ Dim part As TextBodyPart = bookmarkNavigator.GetBookmarkContent()
+ 'Add the retrieved content into another new section
+ document.AddSection()
+ For Each item As TextBodyItem In part.BodyItems
+ document.LastSection.Body.ChildEntities.Add(item)
+ Next
+ document.Save("Result.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ WordDocument document = new WordDocument("Bookmarks.docx", FormatType.Docx);
+ //Create the bookmark navigator instance to access the bookmark
+ BookmarksNavigator bookmarkNavigator = new BookmarksNavigator(document);
+ //Move the virtual cursor to the before the end location of the bookmark "Northwind"
+ bookmarkNavigator.MoveToBookmark("Northwind", true, false);
+ //Get the bookmark content
+ TextBodyPart part = bookmarkNavigator.GetBookmarkContent();
+ //Add the retrieved content into another new section
+ document.AddSection();
+ foreach(TextBodyItem item in part.BodyItems)
+ document.LastSection.Body.ChildEntities.Add(item);
+ document.Save("Result.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ Dim document As New WordDocument("Bookmarks.docx", FormatType.Docx)
+ 'Create the bookmark navigator instance to access the bookmark
+ Dim bookmarkNavigator As New BookmarksNavigator(document)
+ 'Move the virtual cursor to the before the end location of the bookmark "Northwind"
+ bookmarkNavigator.MoveToBookmark("Northwind", True, False)
+ 'Get the bookmark content
+ Dim part As TextBodyPart = bookmarkNavigator.GetBookmarkContent()
+ 'Add the retrieved content into another new section
+ document.AddSection()
+ For Each item As TextBodyItem In part.BodyItems
+ document.LastSection.Body.ChildEntities.Add(item)
+ Next
+ document.Save("Result.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ WordDocument document = new WordDocument("Bookmarks.docx", FormatType.Docx);
+ //Create the bookmark navigator instance to access the bookmark
+ BookmarksNavigator bookmarkNavigator = new BookmarksNavigator(document);
+ //Move the virtual cursor to the before the end location of the bookmark "Northwind"
+ bookmarkNavigator.MoveToBookmark("Northwind");
+ //Insert a new text before the bookmark end of the bookmark
+ bookmarkNavigator.InsertText(" Northwind Database is a set of tables containing data fitted into predefined categories.");
+ document.Save("Result.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ Dim document As New WordDocument("Bookmarks.docx", FormatType.Docx)
+ 'Create the bookmark navigator instance to access the bookmark
+ Dim bookmarkNavigator As New BookmarksNavigator(document)
+ 'Move the virtual cursor to the before the end location of the bookmark "Northwind"
+ bookmarkNavigator.MoveToBookmark("Northwind")
+ 'Insert a new text before the bookmark end of the bookmark
+ bookmarkNavigator.InsertText(" Northwind Database is a set of tables containing data fitted into predefined categories.")
+ document.Save("Result.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ WordDocument document = new WordDocument("Bookmarks.docx", FormatType.Docx);
+ //Create the bookmark navigator instance to access the bookmark
+ BookmarksNavigator bookmarkNavigator = new BookmarksNavigator(document);
+ //Move the virtual cursor to the before the end location of the bookmark "Northwind"
+ bookmarkNavigator.MoveToBookmark("Northwind");
+ //Insert a new text before the bookmark end of the bookmark
+ bookmarkNavigator.InsertText(" Northwind Database is a set of tables containing data fitted into predefined categories.", true);
+ document.Save("Result.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ Dim document As New WordDocument("Bookmarks.docx", FormatType.Docx)
+ 'Create the bookmark navigator instance to access the bookmark
+ Dim bookmarkNavigator As New BookmarksNavigator(document)
+ 'Move the virtual cursor to the before the end location of the bookmark "Northwind"
+ bookmarkNavigator.MoveToBookmark("Northwind")
+ 'Insert a new text before the bookmark end of the bookmark
+ bookmarkNavigator.InsertText(" Northwind Database is a set of tables containing data fitted into predefined categories.", True)
+ document.Save("Result.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ WordDocument document = new WordDocument("Bookmarks.docx", FormatType.Docx);
+ //Create the bookmark navigator instance to access the bookmark
+ BookmarksNavigator bookmarkNavigator = new BookmarksNavigator(document);
+ //Move to the virtual cursor before the end location of the bookmark "Northwind"
+ bookmarkNavigator.MoveToBookmark("Northwind", false, false);
+ //Insert a new paragraph before the bookmark end
+ IWParagraph paragraph = new WParagraph(document);
+ paragraph.AppendText("Northwind Database Contains the following tables:");
+ bookmarkNavigator.InsertParagraph(paragraph);
+ //Insert a new table before the bookmark end
+ WTable table = new WTable(document);
+ table.ResetCells(3, 2);
+ table[0, 0].AddParagraph().AppendText("Suppliers");
+ table[0, 1].AddParagraph().AppendText("2");
+ table[1, 0].AddParagraph().AppendText("Customers");
+ table[1, 1].AddParagraph().AppendText("1");
+ table[2, 0].AddParagraph().AppendText("Employees");
+ table[2, 1].AddParagraph().AppendText("3");
+ bookmarkNavigator.InsertTable(table);
+ document.Save("Result.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ Dim document As New WordDocument("Bookmarks.docx", FormatType.Docx)
+ 'Create the bookmark navigator instance to access the bookmark
+ Dim bookmarkNavigator As New BookmarksNavigator(document)
+ 'Move to the virtual cursor before the end location of the bookmark "Northwind"
+ bookmarkNavigator.MoveToBookmark("Northwind", False, False)
+ 'Insert a new paragraph before the bookmark end
+ Dim paragraph As IWParagraph = New WParagraph(document)
+ paragraph.AppendText("Northwind Database Contains the following tables:")
+ bookmarkNavigator.InsertParagraph(paragraph)
+ 'Insert a new table before the bookmark end
+ Dim table As New WTable(document)
+ table.ResetCells(3, 2)
+ table(0, 0).AddParagraph().AppendText("Suppliers")
+ table(0, 1).AddParagraph().AppendText("2")
+ table(1, 0).AddParagraph().AppendText("Customers")
+ table(1, 1).AddParagraph().AppendText("1")
+ table(2, 0).AddParagraph().AppendText("Employees")
+ table(2, 1).AddParagraph().AppendText("3")
+ bookmarkNavigator.InsertTable(table)
+ document.Save("Result.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ WordDocument document = new WordDocument("Bookmarks.docx", FormatType.Docx);
+ //Create the bookmark navigator instance to access the bookmark
+ BookmarksNavigator bookmarkNavigator = new BookmarksNavigator(document);
+ //Move to the virtual cursor after the end location of the bookmark "Northwind"
+ bookmarkNavigator.MoveToBookmark("Northwind", false, true);
+ //Insert a new picture after the bookmark end
+ WPicture picture = bookmarkNavigator.InsertParagraphItem(ParagraphItemType.Picture) as WPicture;
+ picture.LoadImage(Image.FromFile("Northwind.png"));
+ picture.WidthScale = 50;
+ picture.HeightScale = 50;
+ document.Save("Result.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ Dim document As New WordDocument("Bookmarks.docx", FormatType.Docx)
+ 'Create the bookmark navigator instance to access the bookmark
+ Dim bookmarkNavigator As New BookmarksNavigator(document)
+ 'Move to the virtual cursor after the end location of the bookmark "Northwind"
+ bookmarkNavigator.MoveToBookmark("Northwind", False, True)
+ 'Insert a new picture after the bookmark end
+ Dim picture As WPicture = TryCast(bookmarkNavigator.InsertParagraphItem(ParagraphItemType.Picture), WPicture)
+ picture.LoadImage(Image.FromFile("Northwind.png"))
+ picture.WidthScale = 50
+ picture.HeightScale = 50
+ document.Save("Result.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ WordDocument document = new WordDocument("Bookmarks.docx", FormatType.Docx);
+ //Create the bookmark navigator instance to access the bookmark
+ BookmarksNavigator bookmarkNavigator = new BookmarksNavigator(document);
+ //Move to the virtual cursor after the end location of the bookmark "Northwind"
+ bookmarkNavigator.MoveToBookmark("Northwind", false, true);
+ //Insert a new paragraph before the bookmark start
+ IWParagraph paragraph = new WParagraph(document);
+ paragraph.AppendText("Northwind Database is a set of tables containing data fitted into predefined categories.");
+ bookmarkNavigator.InsertParagraph(paragraph);
+ document.Save("Result.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ Dim document As New WordDocument("Bookmarks.docx", FormatType.Docx)
+ 'Create the bookmark navigator instance to access the bookmark
+ Dim bookmarkNavigator As New BookmarksNavigator(document)
+ 'Move to the virtual cursor after the end location of the bookmark "Northwind"
+ bookmarkNavigator.MoveToBookmark("Northwind", False, True)
+ 'Insert a new paragraph before the bookmark start
+ Dim paragraph As IWParagraph = New WParagraph(document)
+ paragraph.AppendText("Northwind Database is a set of tables containing data fitted into predefined categories.")
+ bookmarkNavigator.InsertParagraph(paragraph)
+ document.Save("Result.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ WordDocument document = new WordDocument("Bookmarks.docx", FormatType.Docx);
+ //Create the bookmark navigator instance to access the bookmark
+ BookmarksNavigator bookmarkNavigator = new BookmarksNavigator(document);
+ //Move to the virtual cursor before the bookmark end location of the bookmark "Northwind"
+ bookmarkNavigator.MoveToBookmark("Northwind");
+ //Get the bookmark content
+ TextBodyPart textBodyPart = bookmarkNavigator.GetBookmarkContent();
+ document.AddSection();
+ IWParagraph paragraph = document.LastSection.AddParagraph();
+ paragraph.AppendText("Northwind Database is a set of tables containing data fitted into predefined categories.");
+ //Add the new bookmark into Word document
+ paragraph.AppendBookmarkStart("bm_empty");
+ paragraph.AppendBookmarkEnd("bm_empty");
+ //Move to the virtual cursor after the start location of the bookmark "bm_empty"
+ bookmarkNavigator.MoveToBookmark("bm_empty", true, true);
+ //Insert the text body part after the bookmark start
+ bookmarkNavigator.InsertTextBodyPart(textBodyPart);
+ document.Save("Result.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ Dim document As New WordDocument("Bookmarks.docx", FormatType.Docx)
+ 'Create the bookmark navigator instance to access the bookmark
+ Dim bookmarkNavigator As New BookmarksNavigator(document)
+ 'Move to the virtual cursor before the bookmark end location of the bookmark "Northwind"
+ bookmarkNavigator.MoveToBookmark("Northwind")
+ 'Get the bookmark content
+ Dim textBodyPart As TextBodyPart = bookmarkNavigator.GetBookmarkContent()
+ document.AddSection()
+ Dim paragraph As IWParagraph = document.LastSection.AddParagraph()
+ paragraph.AppendText("Northwind Database is a set of tables containing data fitted into predefined categories.")
+ 'Add the new bookmark into Word document
+ paragraph.AppendBookmarkStart("bm_empty")
+ paragraph.AppendBookmarkEnd("bm_empty")
+ 'Move to the virtual cursor after the start location of the bookmark "bm_empty"
+ bookmarkNavigator.MoveToBookmark("bm_empty", True, True)
+ 'Insert the text body part after the bookmark start
+ bookmarkNavigator.InsertTextBodyPart(textBodyPart)
+ document.Save("Result.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ WordDocument document = new WordDocument("Bookmarks.docx", FormatType.Docx);
+ //Create the bookmark navigator instance to access the bookmark
+ BookmarksNavigator bookmarkNavigator = new BookmarksNavigator(document);
+ //Move the virtual cursor to the before the end location of the bookmark "Northwind"
+ bookmarkNavigator.MoveToBookmark("Northwind");
+ //Get the bookmark content
+ TextBodyPart part = bookmarkNavigator.GetBookmarkContent();
+ //Add the retrieved content into another new section
+ document.AddSection();
+ foreach(TextBodyItem item in part.BodyItems)
+ document.LastSection.Body.ChildEntities.Add(item);
+ document.Save("Result.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ Dim document As New WordDocument("Bookmarks.docx", FormatType.Docx)
+ 'Create the bookmark navigator instance to access the bookmark
+ Dim bookmarkNavigator As New BookmarksNavigator(document)
+ 'Move the virtual cursor to the before the end location of the bookmark "Northwind"
+ bookmarkNavigator.MoveToBookmark("Northwind")
+ 'Get the bookmark content
+ Dim part As TextBodyPart = bookmarkNavigator.GetBookmarkContent()
+ 'Add the retrieved content into another new section
+ document.AddSection()
+ For Each item As TextBodyItem In part.BodyItems
+ document.LastSection.Body.ChildEntities.Add(item)
+ Next
+ document.Save("Result.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load the template document with bookmark "Northwind" whose start and end preserved in different section
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ //Create the bookmark navigator instance to access the bookmark
+ BookmarksNavigator bookmarkNavigator = new BookmarksNavigator(document);
+ //Move the virtual cursor to the before the end location of the bookmark "Northwind"
+ bookmarkNavigator.MoveToBookmark("Northwind");
+ //Get the bookmark content as WordDocumentPart
+ WordDocumentPart wordDocumentPart = bookmarkNavigator.GetContent();
+ //Save the WordDocumentPart as separate Word document
+ WordDocument newDocument = wordDocumentPart.GetAsWordDocument();
+ newDocument.Save("Result.docx", FormatType.Docx);
+ //Release the resources hold by WordDocument instance
+ newDocument.Close();
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load the template document with bookmark "Northwind" whose start and end preserved in different section
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ 'Create the bookmark navigator instance to access the bookmark
+ Dim bookmarkNavigator As New BookmarksNavigator(document)
+ 'Move the virtual cursor to the before the end location of the bookmark "Northwind"
+ bookmarkNavigator.MoveToBookmark("Northwind")
+ 'Get the bookmark content as WordDocumentPart
+ Dim wordDocumentPart As WordDocumentPart = bookmarkNavigator.GetContent()
+ 'Save the WordDocumentPart as separate Word document
+ Dim newDocument As WordDocument = wordDocumentPart.GetAsWordDocument()
+ newDocument.Save("Result.docx", FormatType.Docx)
+ 'Release the resources hold by WordDocument instance
+ newDocument.Close()
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ WordDocument document = new WordDocument("Bookmarks.docx", FormatType.Docx);
+ //Create the bookmark navigator instance to access the bookmark
+ BookmarksNavigator bookmarkNavigator = new BookmarksNavigator(document);
+ //Move the virtual cursor to the before the end location of the bookmark " Northwind "
+ bookmarkNavigator.MoveToBookmark("Northwind");
+ //Delete bookmark content without deleting the format in the target document.
+ bookmarkNavigator.DeleteBookmarkContent(false);
+ document.Save("Result.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ Dim document As New WordDocument("Bookmarks.docx", FormatType.Docx)
+ 'Create the bookmark navigator instance to access the bookmark
+ Dim bookmarkNavigator As New BookmarksNavigator(document)
+ 'Move the virtual cursor to the before the end location of the bookmark " Northwind "
+ bookmarkNavigator.MoveToBookmark("Northwind")
+ 'Delete bookmark content without deleting the format in the target document.
+ bookmarkNavigator.DeleteBookmarkContent(False)
+ document.Save("Result.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ WordDocument document = new WordDocument("Bookmarks.docx", FormatType.Docx);
+ //Create the bookmark navigator instance to access the bookmark
+ BookmarksNavigator bookmarkNavigator = new BookmarksNavigator(document);
+ //Move to the virtual cursor before the bookmark end location of the bookmark "Northwind"
+ bookmarkNavigator.MoveToBookmark("Northwind");
+ //Get the bookmark content
+ TextBodyPart textBodyPart = bookmarkNavigator.GetBookmarkContent();
+ document.AddSection();
+ IWParagraph paragraph = document.LastSection.AddParagraph();
+ paragraph.AppendText("Northwind Database is a set of tables containing data fitted into predefined categories.");
+ //Add the new bookmark into Word document
+ paragraph.AppendBookmarkStart("bm_empty");
+ paragraph.AppendBookmarkEnd("bm_empty");
+ //Move to the virtual cursor before the end location of the bookmark "bm_empty"
+ bookmarkNavigator.MoveToBookmark("bm_empty");
+ //Replace the bookmark content with text body part
+ bookmarkNavigator.ReplaceBookmarkContent(textBodyPart);
+ document.Save("Result.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ Dim document As New WordDocument("Bookmarks.docx", FormatType.Docx)
+ 'Create the bookmark navigator instance to access the bookmark
+ Dim bookmarkNavigator As New BookmarksNavigator(document)
+ 'Move to the virtual cursor before the bookmark end location of the bookmark "Northwind"
+ bookmarkNavigator.MoveToBookmark("Northwind")
+ 'Get the bookmark content
+ Dim textBodyPart As TextBodyPart = bookmarkNavigator.GetBookmarkContent()
+ document.AddSection()
+ Dim paragraph As IWParagraph = document.LastSection.AddParagraph()
+ paragraph.AppendText("Northwind Database is a set of tables containing data fitted into predefined categories.")
+ 'Add the new bookmark into Word document
+ paragraph.AppendBookmarkStart("bm_empty")
+ paragraph.AppendBookmarkEnd("bm_empty")
+ 'Move to the virtual cursor before the end location of the bookmark "bm_empty"
+ bookmarkNavigator.MoveToBookmark("bm_empty")
+ 'Replace the bookmark content with text body part
+ bookmarkNavigator.ReplaceBookmarkContent(textBodyPart)
+ document.Save("Result.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load the template document with bookmark "Northwind" whose start and end preserved in different section
+ WordDocument templateDocument = new WordDocument("Template.docx", FormatType.Docx);
+ //Create the bookmark navigator instance to access the bookmark
+ BookmarksNavigator bookmarkNavigator = new BookmarksNavigator(templateDocument);
+ //Move the virtual cursor to the before the end location of the bookmark "Northwind"
+ bookmarkNavigator.MoveToBookmark("Northwind");
+ //Get the bookmark content as WordDocumentPart
+ WordDocumentPart wordDocumentPart = bookmarkNavigator.GetContent();
+ //Close the template document
+ templateDocument.Close();
+ //Load the Word document with bookmark NorthwindDB
+ WordDocument document = new WordDocument("Bookmarks.docx", FormatType.Docx);
+ //Create the bookmark navigator instance to access the bookmark
+ bookmarkNavigator = new BookmarksNavigator(document);
+ //Move the virtual cursor to the before the end location of the bookmark "NorthwindDB"
+ bookmarkNavigator.MoveToBookmark("NorthwindDB");
+ //Replace the bookmark content with word body part
+ bookmarkNavigator.ReplaceContent(wordDocumentPart);
+ document.Save("Result.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load the template document with bookmark "Northwind" whose start and end preserved in different section
+ Dim templateDocument As New WordDocument("Template.docx", FormatType.Docx)
+ 'Create the bookmark navigator instance to access the bookmark
+ Dim bookmarkNavigator As New BookmarksNavigator(templateDocument)
+ 'Move the virtual cursor to the before the end location of the bookmark "Northwind"
+ bookmarkNavigator.MoveToBookmark("Northwind")
+ 'Get the bookmark content as WordDocumentPart
+ Dim wordDocumentPart As WordDocumentPart = bookmarkNavigator.GetContent()
+ 'Close the template document
+ templateDocument.Close()
+ 'Load the Word document with bookmark NorthwindDB
+ Dim document As New WordDocument("Bookmarks.docx", FormatType.Docx)
+ 'Create the bookmark navigator instance to access the bookmark
+ bookmarkNavigator = New BookmarksNavigator(document)
+ 'Move the virtual cursor to the before the end location of the bookmark "NorthwindDB"
+ bookmarkNavigator.MoveToBookmark("NorthwindDB")
+ 'Replace the bookmark content with word body part
+ bookmarkNavigator.ReplaceContent(wordDocumentPart)
+ document.Save("Result.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ WordDocument document = new WordDocument("Bookmarks.docx", FormatType.Docx);
+ //Create the bookmark navigator instance to access the bookmark
+ BookmarksNavigator bookmarkNavigator = new BookmarksNavigator(document);
+ document.AddSection();
+ IWParagraph paragraph = document.LastSection.AddParagraph();
+ //Add the new bookmark into Word document
+ paragraph.AppendBookmarkStart("bm_empty");
+ paragraph.AppendBookmarkEnd("bm_empty");
+ //Move to the virtual cursor before the end location of the bookmark "bm_empty"
+ bookmarkNavigator.MoveToBookmark("bm_empty");
+ //Replace the bookmark content with text body part
+ bookmarkNavigator.ReplaceBookmarkContent(" Northwind Database is a set of tables containing data fitted into predefined categories.", true);
+ document.Save("Result.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ Dim document As New WordDocument("Bookmarks.docx", FormatType.Docx)
+ 'Create the bookmark navigator instance to access the bookmark
+ Dim bookmarkNavigator As New BookmarksNavigator(document)
+ document.AddSection()
+ Dim paragraph As IWParagraph = document.LastSection.AddParagraph()
+ 'Add the new bookmark into Word document
+ paragraph.AppendBookmarkStart("bm_empty")
+ paragraph.AppendBookmarkEnd("bm_empty")
+ 'Move to the virtual cursor before the end location of the bookmark "bm_empty"
+ bookmarkNavigator.MoveToBookmark("bm_empty")
+ 'Replace the bookmark content with text body part
+ bookmarkNavigator.ReplaceBookmarkContent(" Northwind Database is a set of tables containing data fitted into predefined categories.", True)
+ document.Save("Result.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Bookmarks.docx", FormatType.Docx);
+ //Get the bookmark instance with bookmark name
+ Syncfusion.DocIO.DLS.Bookmark bookmark = document.Bookmarks["Northwind"];
+ //Access the bookmark start�s owner paragraph using bookmark and change its back color
+ bookmark.BookmarkStart.OwnerParagraph.ParagraphFormat.BackColor = Color.AliceBlue;
+ document.Save("Result.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Bookmarks.docx", FormatType.Docx)
+ 'Get the bookmark instance with bookmark name
+ Dim bookmark As Syncfusion.DocIO.DLS.Bookmark = document.Bookmarks("Northwind")
+ 'Access the bookmark start�s owner paragraph using bookmark and change its back color
+ bookmark.BookmarkStart.OwnerParagraph.ParagraphFormat.BackColor = Color.AliceBlue
+ document.Save("Result.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Bookmarks.docx", FormatType.Docx);
+ //Get the bookmark instance using FindByName method of BookmarkCollection with bookmark name
+ Bookmark bookmark = document.Bookmarks.FindByName("Northwind");
+ //Access the bookmark start�s owner paragraph using bookmark and change its back color
+ bookmark.BookmarkStart.OwnerParagraph.ParagraphFormat.BackColor = Color.AliceBlue;
+ document.Save("Result.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Bookmarks.docx", FormatType.Docx)
+ 'Get the bookmark instance using FindByName method of BookmarkCollection with bookmark name
+ Dim bookmark As Bookmark = document.Bookmarks.FindByName("Northwind")
+ 'Access the bookmark start�s owner paragraph using bookmark and change its back color
+ bookmark.BookmarkStart.OwnerParagraph.ParagraphFormat.BackColor = Color.AliceBlue
+ document.Save("Result.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Bookmarks.docx", FormatType.Docx);
+ //Remove the bookmark at the second index from Word document.
+ document.Bookmarks.RemoveAt(1);
+ document.Save("Result.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Bookmarks.docx", FormatType.Docx)
+ 'Remove the bookmark at the second index from Word document.
+ document.Bookmarks.RemoveAt(1)
+ document.Save("Result.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Bookmarks.docx", FormatType.Docx);
+ //Get the bookmark instance using FindByName method of BookmarkCollection with bookmark name
+ Bookmark bookmark = document.Bookmarks.FindByName("Northwind");
+ //Remove the bookmark named "Northwind" from Word document.
+ document.Bookmarks.Remove(bookmark);
+ document.Save("Result.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Bookmarks.docx", FormatType.Docx)
+ 'Get the bookmark instance using FindByName method of BookmarkCollection with bookmark name
+ Dim bookmark As Bookmark = document.Bookmarks.FindByName("Northwind")
+ 'Remove the bookmark named "Northwind" from Word document.
+ document.Bookmarks.Remove(bookmark)
+ document.Save("Result.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Bookmarks.docx", FormatType.Docx);
+ //Remove all the bookmarks from Word document
+ document.Bookmarks.Clear();
+ document.Save("Result.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Bookmarks.docx", FormatType.Docx)
+ 'Remove all the bookmarks from Word document
+ document.Bookmarks.Clear()
+ document.Save("Result.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ foreach (WSection section in document.Sections)
+ {
+ //Populates the specified number of columns with specified spacing.
+ if (section.Columns.Count > 0)
+ section.Columns.Populate(2, 10);
+ }
+ //Add the section into Word document
+ IWSection newSection = document.AddSection();
+ //Add the column into the section
+ newSection.AddColumn(150, 20);
+ //Add the column into the section
+ newSection.AddColumn(150, 20);
+ //Add a paragraph to created section
+ IWParagraph paragraph = newSection.AddParagraph();
+ //Add a paragraph to created section
+ paragraph = newSection.AddParagraph();
+ string paraText = "Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula";
+ //Append the text to the created paragraph
+ paragraph.AppendText(paraText);
+ //Add the column breaks
+ paragraph.AppendBreak(BreakType.ColumnBreak);
+ //Add a paragraph to created section
+ paragraph = newSection.AddParagraph();
+ //Append the text to the created paragraph
+ paragraph.AppendText(paraText);
+ //Add the column breaks
+ paragraph.AppendBreak(BreakType.ColumnBreak);
+ //Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ For Each section As WSection In document.Sections
+ 'Populates the specified number of columns with specified spacing.
+ If section.Columns.Count > 0 Then
+ section.Columns.Populate(2, 10)
+ End If
+ Next
+ 'Add the section into Word document
+ Dim newSection As IWSection = document.AddSection()
+ 'Add the column into the section
+ newSection.AddColumn(150, 20)
+ 'Add the column into the section
+ newSection.AddColumn(150, 20)
+ 'Add a paragraph to created section
+ Dim paragraph As IWParagraph = newSection.AddParagraph()
+ 'Add a paragraph to created section
+ paragraph = newSection.AddParagraph()
+ Dim paraText As String = "Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula"
+ 'Append the text to the created paragraph
+ paragraph.AppendText(paraText)
+ 'Add the column breaks
+ paragraph.AppendBreak(BreakType.ColumnBreak)
+ 'Add a paragraph to created section
+ paragraph = newSection.AddParagraph()
+ 'Append the text to the created paragraph
+ paragraph.AppendText(paraText)
+ 'Add the column breaks
+ paragraph.AppendBreak(BreakType.ColumnBreak)
+ 'Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Comment.docx");
+ //Iterate the comments in the Word document
+ foreach (WComment comment in document.Comments)
+ {
+ //Modify the last paragraph text of an existing comment if it is added by "Peter"
+ if (comment.Format.User == "Peter")
+ comment.TextBody.LastParagraph.Text = "Modified Comment Content";
+ }
+ document.Save("ModifiedComment.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Comment.docx")
+ 'Iterate the comments in the Word document
+ For Each comment As WComment In document.Comments
+ 'Modify the last paragraph text of an existing comment if it is added by "Peter"
+ If comment.Format.User = "Peter" Then
+ comment.TextBody.LastParagraph.Text = "Modified Comment Content"
+ End If
+ Next
+ document.Save("ModifiedComment.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Comment.docx");
+ //Remove the second comment from a document
+ document.Comments.RemoveAt(1);
+ //Save and close the Word document
+ document.Save("Result.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Comment.docx")
+ 'Remove the second comment from a document
+ document.Comments.RemoveAt(1)
+ 'Save and close the Word document
+ document.Save("Result.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Comment.docx");
+ //Remove all the comments in a Word document
+ document.Comments.Clear();
+ //Save and close the Word document
+ document.Save("Result.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Comment.docx")
+ 'Remove all the comments in a Word document
+ document.Comments.Clear()
+ 'Save and close the Word document
+ document.Save("Result.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Comment.docx");
+ //Get the second comment from a document.
+ WComment comment = document.Comments[1];
+ //Remove comment from a document.
+ document.Comments.Remove(comment);
+ //Save and close the Word document
+ document.Save("Result.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Comment.docx")
+ 'Get the second comment from a document.
+ Dim comment As WComment = document.Comments(1)
+ 'Remove comment from a document.
+ document.Comments.Remove(comment)
+ 'Save and close the Word document
+ document.Save("Result.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Open an input Word template
+ WordDocument document = new WordDocument(inputFileName);
+ //Access the styles collection which contains paragraph and character styles in Word document
+ WParagraphStyle style = new WParagraphStyle(document);
+ //Specify the style name.
+ style.Name = "User_Defined_style";
+ //Specify the character properties for the style
+ style.CharacterFormat.Bold = true;
+ style.CharacterFormat.FontName = "Arial";
+ style.CharacterFormat.FontSize = 14;
+ //Specify the paragraph properties for the style
+ style.ParagraphFormat.BackColor = Color.LightGray;
+ style.ParagraphFormat.AfterSpacing = 18f;
+ style.ParagraphFormat.BeforeSpacing = 18f;
+ StyleCollection styleCollection = document.Styles as StyleCollection;
+ //Add the style to the document styles collection.
+ styleCollection.Add(style);
+ //Save and close the document
+ document.Save(outputFileName, FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Open an input Word template
+ Dim document As New WordDocument(inputFileName)
+ 'Access the styles collection which contains paragraph and character styles in Word document
+ Dim style As New WParagraphStyle(document)
+ 'Specify the style name.
+ style.Name = "User_Defined_style"
+ 'Specify the character properties for the style
+ style.CharacterFormat.Bold = True
+ style.CharacterFormat.FontName = "Arial"
+ style.CharacterFormat.FontSize = 14
+ 'Specify the paragraph properties for the style
+ style.ParagraphFormat.BackColor = Color.LightGray
+ style.ParagraphFormat.AfterSpacing = 18F
+ style.ParagraphFormat.BeforeSpacing = 18F
+ Dim styleCollection As StyleCollection = TryCast(document.Styles, StyleCollection)
+ 'Add the style to the document styles collection.
+ styleCollection.Add(style)
+ 'Save and close the document
+ document.Save(outputFileName, FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Open an input Word template
+ WordDocument document = new WordDocument(inputFileName);
+ //Access the styles collection which contains paragraph and character styles in Word document
+ IStyleCollection styleCollection = document.Styles;
+ //Find the style with the name "Heading 1"
+ WParagraphStyle heading1ParagraphStyle = styleCollection.FindByName("Heading 1") as WParagraphStyle;
+ //Change the text color of style "Heading 1" as DarkBlue
+ heading1ParagraphStyle.CharacterFormat.TextColor = Color.DarkBlue;
+ //Change the first line indent of Paragraph as 36 points
+ heading1ParagraphStyle.ParagraphFormat.FirstLineIndent = 36;
+ document.Save(outputFileName, FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Open an input Word template
+ Dim document As New WordDocument(inputFileName)
+ 'Access the styles collection which contains paragraph and character styles in Word document
+ Dim styleCollection As IStyleCollection = document.Styles
+ 'Find the style with the name "Heading 1"
+ Dim heading1ParagraphStyle As WParagraphStyle = TryCast(styleCollection.FindByName("Heading 1"), WParagraphStyle)
+ 'Change the text color of style "Heading 1" as DarkBlue
+ heading1ParagraphStyle.CharacterFormat.TextColor = Color.DarkBlue
+ 'Change the first line indent of paragraph as 36 points
+ heading1ParagraphStyle.ParagraphFormat.FirstLineIndent = 36
+ document.Save(outputFileName, FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Open an input Word template
+ WordDocument document = new WordDocument(inputFileName);
+ //Access the styles collection which contains paragraph and character styles in Word document
+ IStyleCollection styleCollection = document.Styles;
+ //Find the style with the name "Heading 1"
+ WParagraphStyle heading1ParagraphStyle = styleCollection.FindByName("Heading 1", StyleType.ParagraphStyle) as WParagraphStyle;
+ //Change the text color of style "Heading 1" as DarkBlue
+ heading1ParagraphStyle.CharacterFormat.TextColor = Color.DarkBlue;
+ //Change the first line indent of Paragraph as 36 points
+ heading1ParagraphStyle.ParagraphFormat.FirstLineIndent = 36;
+ document.Save(outputFileName, FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Open an input Word template
+ Dim document As New WordDocument(inputFileName)
+ 'Access the styles collection which contains paragraph and character styles in Word document
+ Dim styleCollection As IStyleCollection = document.Styles
+ 'Find the style with the name "Heading 1"
+ Dim heading1ParagraphStyle As WParagraphStyle = TryCast(styleCollection.FindByName("Heading 1", StyleType.ParagraphStyle), WParagraphStyle)
+ 'Change the text color of style "Heading 1" as DarkBlue
+ heading1ParagraphStyle.CharacterFormat.TextColor = Color.DarkBlue
+ 'Change the first line indent of Paragraph as 36 points
+ heading1ParagraphStyle.ParagraphFormat.FirstLineIndent = 36
+ document.Save(outputFileName, FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Open an input Word template
+ WordDocument document = new WordDocument("Template.docx");
+ //Access the styles collection which contains paragraph and character styles in Word document
+ WParagraphStyle style = new WParagraphStyle(document);
+ //Specify the style name.
+ style.Name = "User_Defined_style";
+ //Specify the character properties for the style
+ style.CharacterFormat.Bold = true;
+ style.CharacterFormat.FontName = "Arial";
+ style.CharacterFormat.FontSize = 14;
+ //Specify the paragraph properties for the style
+ style.ParagraphFormat.BackColor = Color.LightGray;
+ style.ParagraphFormat.AfterSpacing = 18f;
+ style.ParagraphFormat.BeforeSpacing = 18f;
+ StyleCollection styleCollection = document.Styles as StyleCollection;
+ //Add the style to the document styles collection.
+ styleCollection.Add(style);
+ //Save and close the document
+ document.Save("Result.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Open an input Word template
+ Dim document As New WordDocument(inputFileName)
+ 'Access the styles collection which contains paragraph and character styles in Word document
+ Dim style As New WParagraphStyle(document)
+ 'Specify the style name.
+ style.Name = "User_Defined_style"
+ 'Specify the character properties for the style
+ style.CharacterFormat.Bold = True
+ style.CharacterFormat.FontName = "Arial"
+ style.CharacterFormat.FontSize = 14
+ 'Specify the paragraph properties for the style
+ style.ParagraphFormat.BackColor = Color.LightGray
+ style.ParagraphFormat.AfterSpacing = 18F
+ style.ParagraphFormat.BeforeSpacing = 18F
+ Dim styleCollection As StyleCollection = TryCast(document.Styles, StyleCollection)
+ 'Add the style to the document styles collection.
+ styleCollection.Add(style)
+ 'Save and close the document
+ document.Save(outputFileName, FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Open an input Word template
+ WordDocument document = new WordDocument("Template.docx");
+ //Access the styles collection which contains paragraph and character styles in Word document
+ IStyleCollection styleCollection = document.Styles;
+ //Find the style with the name "Heading 1"
+ WParagraphStyle heading1ParagraphStyle = styleCollection.FindByName("Heading 1") as WParagraphStyle;
+ //Change the text color of style "Heading 1" as DarkBlue
+ heading1ParagraphStyle.CharacterFormat.TextColor = Color.DarkBlue;
+ //Change the first line indent of Paragraph as 36 points
+ heading1ParagraphStyle.ParagraphFormat.FirstLineIndent = 36;
+ document.Save("Result.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Open an input Word template
+ Dim document As New WordDocument(inputFileName)
+ 'Access the styles collection which contains paragraph and character styles in Word document
+ Dim styleCollection As IStyleCollection = document.Styles
+ 'Find the style with the name "Heading 1"
+ Dim heading1ParagraphStyle As WParagraphStyle = TryCast(styleCollection.FindByName("Heading 1"), WParagraphStyle)
+ 'Change the text color of style "Heading 1" as DarkBlue
+ heading1ParagraphStyle.CharacterFormat.TextColor = Color.DarkBlue
+ 'Change the first line indent of paragraph as 36 points
+ heading1ParagraphStyle.ParagraphFormat.FirstLineIndent = 36
+ document.Save(outputFileName, FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Open an input Word template
+ WordDocument document = new WordDocument("Template.docx");
+ //Access the styles collection which contains paragraph and character styles in Word document
+ IStyleCollection styleCollection = document.Styles;
+ //Find the style with the name "Heading 1"
+ WParagraphStyle heading1ParagraphStyle = styleCollection.FindByName("Heading 1", StyleType.ParagraphStyle) as WParagraphStyle;
+ //Change the text color of style "Heading 1" as DarkBlue
+ heading1ParagraphStyle.CharacterFormat.TextColor = Color.DarkBlue;
+ //Change the first line indent of Paragraph as 36 points
+ heading1ParagraphStyle.ParagraphFormat.FirstLineIndent = 36;
+ document.Save("Result.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Open an input Word template
+ Dim document As New WordDocument(inputFileName)
+ 'Access the styles collection which contains paragraph and character styles in Word document
+ Dim styleCollection As IStyleCollection = document.Styles
+ 'Find the style with the name "Heading 1"
+ Dim heading1ParagraphStyle As WParagraphStyle = TryCast(styleCollection.FindByName("Heading 1", StyleType.ParagraphStyle), WParagraphStyle)
+ 'Change the text color of style "Heading 1" as DarkBlue
+ heading1ParagraphStyle.CharacterFormat.TextColor = Color.DarkBlue
+ 'Change the first line indent of Paragraph as 36 points
+ heading1ParagraphStyle.ParagraphFormat.FirstLineIndent = 36
+ document.Save(outputFileName, FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ //Load an existing Word document into DocIO instance.
+ WordDocument document = new WordDocument("Template.docx");
+ //get all the revisions from the revision collection and accepts all.
+ document.Revisions.AcceptAll();
+ //Save and Close the Word document.
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+
+
+ 'Load an existing Word document into DocIO instance.
+ Dim document As WordDocument = New WordDocument("Template.docx")
+ 'Get all the revision from the revision collection and accepts all.
+ document.Revisions.AcceptAll()
+ 'Save and Close the Word document.
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ //Load an existing Word document into DocIO instance.
+ WordDocument document = new WordDocument("Template.docx");
+ //get all the revisions from the revision collection and reject all.
+ document.Revisions.RejectAll();
+ //Save and Close the Word document.
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+
+
+ 'Load an existing Word document into DocIO instance.
+ Dim document As WordDocument = New WordDocument("Template.docx")
+ 'Get all the revisions from the revision collection and reject all.
+ document.Revisions.RejectAll()
+ 'Save and Close the Word document.
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ //Loads an existing Word document
+ WordDocument document = new WordDocument("Template.docx");
+ //Gets the revision from the revision collections
+ Revision revision = document.Revisions[0];
+ //If the revision is formatting type of revision, then accept it
+ if (revision.RevisionType == RevisionType.Formatting)
+ revision.Accept();
+ //Saves and closes the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+
+
+ 'Loads an existing Word document
+ Dim document As WordDocument = New WordDocument("Template.docx")
+ 'Gets the revision from the revision collections
+ Dim rev As Revision = document.Revisions(0)
+ 'If the revision is formatting type of revision, then accept it
+ If rev.RevisionType Is RevisionType.Formatting Then rev.Accept()
+ 'Saves and closes the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add tab at position 0;
+ paragraph.ParagraphFormat.Tabs.AddTab();
+ //Add tab stop at position 11
+ Tab firstTab = paragraph.ParagraphFormat.Tabs.AddTab(11);
+ //Add tab stop at position 62, with tab justification and tab leader.
+ paragraph.ParagraphFormat.Tabs.AddTab(62, TabJustification.Left, TabLeader.Single);
+ paragraph.AppendText("This sample\t illustrates the use of tabs in the paragraph. Tabs\t can be inserted or removed from the paragraph.");
+ //Remove tab stop from the collection
+ paragraph.ParagraphFormat.Tabs.RemoveByTabPosition(11);
+ //Remove tab at index 0;
+ paragraph.ParagraphFormat.Tabs.RemoveAt(0);
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add tab at position 0;
+ paragraph.ParagraphFormat.Tabs.AddTab()
+ 'Add tab stop at position 11
+ Dim firstTab As Tab = paragraph.ParagraphFormat.Tabs.AddTab(11)
+ 'Add tab stop at position 62, with tab justification and tab leader.
+ paragraph.ParagraphFormat.Tabs.AddTab(62, TabJustification.Left, TabLeader.[Single])
+ paragraph.AppendText("This sample" & vbTab & " illustrates the use of tabs in the paragraph. Tabs" & vbTab & " can be inserted or removed from the paragraph.")
+ 'Remove tab stop from the collection
+ paragraph.ParagraphFormat.Tabs.RemoveByTabPosition(11)
+ 'Remove tab at index 0;
+ paragraph.ParagraphFormat.Tabs.RemoveAt(0)
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //open a template document
+ WordDocument document = new WordDocument("Textbox.docx");
+ //Remove the textbox at index one.
+ document.TextBoxes.RemoveAt(1);
+ //Save and close the document
+ document.Save("Sample.docx");
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'open a template document
+ Dim document As New WordDocument("Textbox.docx")
+ 'Remove the textbox at index one.
+ document.TextBoxes.RemoveAt(1)
+ 'Save and close the document
+ document.Save("Sample.docx")
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //open a template document
+ WordDocument document = new WordDocument("Textbox.docx");
+ //Removes the textboxes from the document
+ document.TextBoxes.Clear();
+ //Save and close the document
+ document.Save("Sample.docx");
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'open a template document
+ Dim document As New WordDocument("Textbox.docx")
+ 'Removes the textboxes from the document
+ document.TextBoxes.Clear()
+ 'Save and close the document
+ document.Save("Sample.docx")
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section
+ IWSection section = document.AddSection();
+ //Add new paragraph
+ section.AddParagraph().AppendText("Price Details");
+ section.AddParagraph();
+ //Add a new table into Word document
+ IWTable table = section.AddTable();
+ //Add the first row into table
+ WTableRow row = table.AddRow();
+ //Create a new cell
+ WTableCell cell = new WTableCell(document);
+ //Specify the cell width
+ cell.Width = 200;
+ cell.AddParagraph().AppendText("Item");
+ //Add the cell to the cells collection.
+ row.Cells.Add(cell);
+ int index = row.Cells.IndexOf(cell);
+ //Create a new cell
+ cell = new WTableCell(document);
+ //Specify the cell width
+ cell.Width = 200;
+ cell.AddParagraph().AppendText("Price($)");
+ //Add the cell to the cells collection.
+ row.Cells.Insert(index + 1, cell);
+ //Add the second row into table
+ row = table.AddRow(true, false);
+ //Add the first cell into second row
+ cell = row.AddCell();
+ //Specify the cell width
+ cell.Width = 200;
+ cell.AddParagraph().AppendText("Apple");
+ //Add the second cell into second row
+ cell = row.AddCell();
+ //Specify the cell width
+ cell.Width = 200;
+ cell.AddParagraph().AppendText("50");
+ //Add the third row into table
+ row = table.AddRow(true, false);
+ //Add the first cell into third row
+ cell = row.AddCell();
+ //Specify the cell width
+ cell.Width = 200;
+ cell.AddParagraph().AppendText("Orange");
+ //Add the second cell into third row
+ cell = row.AddCell();
+ //Specify the cell width
+ cell.Width = 200;
+ cell.AddParagraph().AppendText("30");
+ //Add the third cell into third row
+ cell = row.AddCell();
+ //Specify the cell width
+ cell.Width = 200;
+ cell.AddParagraph().AppendText("Banana");
+ //Removes the specified cell.
+ row.Cells.Remove(cell);
+ //Save and close the document
+ document.Save("Table.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph
+ section.AddParagraph().AppendText("Price Details")
+ section.AddParagraph()
+ 'Add a new table into Word document
+ Dim table As IWTable = section.AddTable()
+ 'Add the first row into table
+ Dim row As WTableRow = table.AddRow()
+ 'Create a new cell
+ Dim cell As New WTableCell(document)
+ 'Specify the cell width
+ cell.Width = 200
+ cell.AddParagraph().AppendText("Item")
+ 'Add the cell to the cells collection.
+ row.Cells.Add(cell)
+ Dim index As Integer = row.Cells.IndexOf(cell)
+ 'Create a new cell
+ cell = New WTableCell(document)
+ 'Specify the cell width
+ cell.Width = 200
+ cell.AddParagraph().AppendText("Price($)")
+ 'Add the cell to the cells collection.
+ row.Cells.Insert(index + 1, cell)
+ 'Add the second row into table
+ row = table.AddRow(True, False)
+ 'Add the first cell into second row
+ cell = row.AddCell()
+ 'Specify the cell width
+ cell.Width = 200
+ cell.AddParagraph().AppendText("Apple")
+ 'Add the second cell into second row
+ cell = row.AddCell()
+ 'Specify the cell width
+ cell.Width = 200
+ cell.AddParagraph().AppendText("50")
+ 'Add the third row into table
+ row = table.AddRow(True, False)
+ 'Add the first cell into third row
+ cell = row.AddCell()
+ 'Specify the cell width
+ cell.Width = 200
+ cell.AddParagraph().AppendText("Orange")
+ 'Add the second cell into third row
+ cell = row.AddCell()
+ 'Specify the cell width
+ cell.Width = 200
+ cell.AddParagraph().AppendText("30")
+ 'Add the third cell into third row
+ cell = row.AddCell()
+ 'Specify the cell width
+ cell.Width = 200
+ cell.AddParagraph().AppendText("Banana")
+ 'Removes the specified cell.
+ row.Cells.Remove(cell)
+ 'Save and close the document
+ document.Save("Table.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument("Template.docx");
+ //Find the specified text from the document
+ TextSelection selection = document.Find("paragraph", false, false);
+ WTextRange range = selection.GetAsOneRange();
+ //Get its owner paragraph
+ WParagraph paragraph = range.OwnerParagraph;
+ WTextBody textbody = paragraph.OwnerTextBody;
+ //Get the collection of paragraphs in the section
+ WParagraphCollection collection = (WParagraphCollection)textbody.Paragraphs;
+ //Get the index of the paragraph
+ int index = collection.IndexOf(range.OwnerParagraph);
+ paragraph = new WParagraph(document);
+ paragraph.AppendText("hello world");
+ //Insert new item
+ collection.Insert(index + 1, paragraph);
+ //Removes paragraph at index zero
+ collection.RemoveAt(0);
+ //Save and close the paragraph.
+ document.Save("Result.docx");
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument("Template.docx")
+ 'Find the specified text from the document
+ Dim selection As TextSelection = document.Find("paragraph", False, False)
+ Dim range As WTextRange = selection.GetAsOneRange()
+ 'Get its owner paragraph
+ Dim paragraph As WParagraph = range.OwnerParagraph
+ Dim textbody As WTextBody = paragraph.OwnerTextBody
+ 'Get the collection of paragraphs in the section
+ Dim collection As WParagraphCollection = DirectCast(textbody.Paragraphs, WParagraphCollection)
+ 'Get the index of the paragraph
+ Dim index As Integer = collection.IndexOf(range.OwnerParagraph)
+ paragraph = New WParagraph(document)
+ paragraph.AppendText("hello world")
+ 'Insert new item
+ collection.Insert(index - 1, paragraph)
+ 'Removes paragraph at index zero
+ collection.RemoveAt(0)
+ 'Save and close the paragraph.
+ document.Save("Result.docx")
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ IWSection section = document.AddSection();
+ section.AddParagraph().AppendText("Price Details");
+ section.AddParagraph();
+ //Add a new table into Word document
+ IWTable table = section.AddTable();
+ //Get the rows collection from table
+ WRowCollection rowCollection = table.Rows;
+ //Add the first row into table
+ WTableRow row = new WTableRow(document);
+ //Add the first cell into first row
+ WTableCell cell = row.AddCell();
+ //Specify the cell width
+ cell.Width = 200;
+ cell.AddParagraph().AppendText("Item");
+ //Add the second cell into first row
+ cell = row.AddCell();
+ //Specify the cell width
+ cell.Width = 200;
+ cell.AddParagraph().AppendText("Price($)");
+ //Add row to the collection
+ rowCollection.Add(row);
+ //Add the second row into table
+ row = new WTableRow(document);
+ //Add the first cell into second row
+ cell = row.AddCell();
+ //Specify the cell width
+ cell.Width = 200;
+ cell.AddParagraph().AppendText("Apple");
+ //Add the second cell into second row
+ cell = row.AddCell();
+ //Specify the cell width
+ cell.Width = 200;
+ cell.AddParagraph().AppendText("50");
+ //Insert row at index 1
+ rowCollection.Insert(1, row);
+ //Add the third row into table
+ row = new WTableRow(document);
+ //Add the first cell into third row
+ cell = row.AddCell();
+ //Specify the cell width
+ cell.Width = 200;
+ cell.AddParagraph().AppendText("Orange");
+ //Add the second cell into third row
+ cell = row.AddCell();
+ //Specify the cell width
+ cell.Width = 200;
+ cell.AddParagraph().AppendText("30");
+ //Insert row
+ rowCollection.Insert(2, row);
+ //Remove row at index 0.
+ rowCollection.RemoveAt(0);
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ Dim section As IWSection = document.AddSection()
+ section.AddParagraph().AppendText("Price Details")
+ section.AddParagraph()
+ 'Add a new table into Word document
+ Dim table As IWTable = section.AddTable()
+ 'Get the rows collection from table
+ Dim rowCollection As WRowCollection = table.Rows
+ 'Add the first row into table
+ Dim row As New WTableRow(document)
+ 'Add the first cell into first row
+ Dim cell As WTableCell = row.AddCell()
+ 'Specify the cell width
+ cell.Width = 200
+ cell.AddParagraph().AppendText("Item")
+ 'Add the second cell into first row
+ cell = row.AddCell()
+ 'Specify the cell width
+ cell.Width = 200
+ cell.AddParagraph().AppendText("Price($)")
+ 'Add row to the collection
+ rowCollection.Add(row)
+ 'Add the second row into table
+ row = New WTableRow(document)
+ 'Add the first cell into second row
+ cell = row.AddCell()
+ 'Specify the cell width
+ cell.Width = 200
+ cell.AddParagraph().AppendText("Apple")
+ 'Add the second cell into second row
+ cell = row.AddCell()
+ 'Specify the cell width
+ cell.Width = 200
+ cell.AddParagraph().AppendText("50")
+ 'Insert row at index 1
+ rowCollection.Insert(1, row)
+ 'Add the third row into table
+ row = New WTableRow(document)
+ 'Add the first cell into third row
+ cell = row.AddCell()
+ 'Specify the cell width
+ cell.Width = 200
+ cell.AddParagraph().AppendText("Orange")
+ 'Add the second cell into third row
+ cell = row.AddCell()
+ 'Specify the cell width
+ cell.Width = 200
+ cell.AddParagraph().AppendText("30")
+ 'Insert row
+ rowCollection.Insert(2, row)
+ 'Remove row at index 0.
+ rowCollection.RemoveAt(0)
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load a template document
+ WordDocument document = new WordDocument("Template.docx");
+ //Get the tables collection
+ WTableCollection tablecollection = document.Sections[0].Tables as WTableCollection;
+ //Create new table
+ WTable table = new WTable(document);
+ table.ResetCells(2,2);
+ //Add table to the collection
+ tablecollection.Add(table);
+ //Get the index of the added table
+ int index = tablecollection.IndexOf(table);
+ //Insert another table at next index
+ table = new WTable(document);
+ table.ResetCells(3, 3);
+ tablecollection.Insert(index + 1, table);
+ //Remove the table at index 0
+ tablecollection.RemoveAt(0);
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load a template document
+ Dim document As New WordDocument("Template.docx")
+ 'Get the tables collection
+ Dim tablecollection As WTableCollection = TryCast(document.Sections(0).Tables, WTableCollection)
+ 'Create new table
+ Dim table As New WTable(document)
+ table.ResetCells(2, 2)
+ 'Add table to the collection
+ tablecollection.Add(table)
+ 'Get the index of the added table
+ Dim index As Integer = tablecollection.IndexOf(table)
+ 'Insert another table at next index
+ table = New WTable(document)
+ table.ResetCells(3, 3)
+ tablecollection.Insert(index + 1, table)
+ 'Remove the table at index 0
+ tablecollection.RemoveAt(0)
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Loads an existing document
+ WordDocument document = new WordDocument("Template.docx");
+ HTMLExport export = new HTMLExport();
+ //The images in the input document will be copied to this folder
+ document.SaveOptions.HtmlExportImagesFolder = @"D:\Data\";
+ //The headers and footers in the input will be exported
+ document.SaveOptions.HtmlExportHeadersFooters = true;
+ //Export the text form fields as editable
+ document.SaveOptions.HtmlExportTextInputFormFieldAsText = false;
+ //Set the style sheet type
+ document.SaveOptions.HtmlExportCssStyleSheetType = CssStyleSheetType.External;
+ //Set name for style sheet
+ document.SaveOptions.HtmlExportCssStyleSheetFileName = "UserDefinedFileName.css";
+ //Set the use absolute path as true
+ export.UseAbsolutePath = true;
+ //Save the document as html file
+ export.SaveAsXhtml(document, "WordtoHtml.html");
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Loads an existing document
+ Dim document As New WordDocument("Template.docx")
+ Dim export As New HTMLExport()
+ 'The images in the input document will be copied to this folder
+ document.SaveOptions.HtmlExportImagesFolder = "D:\Data\"
+ 'The headers and footers in the input will be exported
+ document.SaveOptions.HtmlExportHeadersFooters = True
+ 'Export the text form fields as editable
+ document.SaveOptions.HtmlExportTextInputFormFieldAsText = False
+ 'Set the style sheet type
+ document.SaveOptions.HtmlExportCssStyleSheetType = CssStyleSheetType.External
+ 'Set name for style sheet
+ document.SaveOptions.HtmlExportCssStyleSheetFileName = "UserDefinedFileName.css"
+ 'Set the use absolute path as true
+ export.UseAbsolutePath = True;
+ 'Save the document as html file
+ export.SaveAsXhtml(document, "WordtoHtml.html")
+ document.Close()
+ End Sub
+
+
+ //Loads an existing document
+ WordDocument document = new WordDocument("Template.docx");
+ HTMLExport export = new HTMLExport();
+ //Save the document as Xhtml file
+ export.SaveAsXhtml(document, "WordtoXHtml.html");
+ document.Close();
+
+
+ 'Loads an existing document
+ Dim document As New WordDocument("Template.docx")
+ Dim export As New HTMLExport()
+ 'Save the document as Xhtml file
+ export.SaveAsXhtml(document, "WordtoXHtml.html")
+ document.Close()
+
+
+ //Loads an existing document
+ WordDocument document = new WordDocument("Template.docx");
+ HTMLExport export = new HTMLExport();
+ //Save the document as Xhtml file
+ export.SaveAsXhtml(document, "WordtoXHtml.html", Encoding.Unicode);
+ document.Close();
+
+
+ 'Loads an existing document
+ Dim document As New WordDocument("Template.docx")
+ Dim export As New HTMLExport()
+ 'Save the document as Xhtml file
+ export.SaveAsXhtml(document, "WordtoXHtml.html", Encoding.Unicode)
+ document.Close()
+
+
+ //Creates a new Word document
+ WordDocument document = new WordDocument();
+ //Adds new section to the document
+ IWSection section = document.AddSection();
+ //Adds new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Adds new text to the paragraph
+ paragraph.AppendText("Hello World!");
+ HTMLExport export = new HTMLExport();
+ MemoryStream stream = new MemoryStream();
+ //Save the document as Xhtml file
+ export.SaveAsXhtml(document, stream);
+ document.Close();
+
+
+ 'Creates a new Word document
+ Dim document As New WordDocument()
+ 'Adds new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Adds new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Adds new text to the paragraph
+ paragraph.AppendText("Hello World!")
+ Dim export As New HTMLExport()
+ Dim stream As New MemoryStream()
+ 'Save the document as Xhtml file
+ export.SaveAsXhtml(document, stream)
+ document.Close()
+
+
+ //Creates a new Word document
+ WordDocument document = new WordDocument();
+ //Adds new section to the document
+ IWSection section = document.AddSection();
+ //Adds new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Adds new text to the paragraph
+ paragraph.AppendText("Hello World!");
+ HTMLExport export = new HTMLExport();
+ MemoryStream stream = new MemoryStream();
+ //Save the document as Xhtml file
+ export.SaveAsXhtml(document, stream, Encoding.Unicode);
+ document.Close();
+
+
+ 'Creates a new Word document
+ Dim document As New WordDocument()
+ 'Adds new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Adds new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Adds new text to the paragraph
+ paragraph.AppendText("Hello World!")
+ Dim export As New HTMLExport()
+ Dim stream As New MemoryStream()
+ 'Save the document as Xhtml file
+ export.SaveAsXhtml(document, stream, Encoding.Unicode)
+ document.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create an instance of WordDocument class
+ WordDocument document = new WordDocument();
+ //Set the background type of the document
+ document.Background.Type = BackgroundType.Picture;
+ //Set the background image of the document
+ document.Background.Picture = Image.FromFile("Image.png");
+ //Add one section with one paragraph to the document
+ document.EnsureMinimal();
+ //Add the text range to the last paragraph of the section
+ document.LastParagraph.AppendText("Hello World!");
+ //Save the document in the given name and format
+ document.Save("Sample.docx", FormatType.Docx);
+ //Release the resources occupied by WordDocument instance
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create an instance of WordDocument class
+ Dim document As New WordDocument()
+ 'Set the background type of the document
+ document.Background.Type = BackgroundType.Picture
+ 'Set the background image of the document
+ document.Background.Picture = Image.FromFile("Image.png")
+ 'Add one section with one paragraph to the document
+ document.EnsureMinimal()
+ 'Add the text range to the last paragraph of the section
+ document.LastParagraph.AppendText("Hello World!")
+ 'Save the document in the given name and format
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Release the resources occupied by WordDocument instance
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into WordDocument instance
+ WordDocument document = new WordDocument("Sample.docx");
+ //Set the background type of the document
+ document.Background.Type = BackgroundType.Color;
+ //Set the background color of the document
+ document.Background.Color = Color.AliceBlue;
+ //Save the document in the given name and format
+ document.Save("Document.docx", FormatType.Docx);
+ //Release the resources occupied by WordDocument instance
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into WordDocument instance
+ Dim document As New WordDocument("Sample.docx")
+ 'Set the background type of the document
+ document.Background.Type = BackgroundType.Color
+ 'Set the background color of the document
+ document.Background.Color = Color.AliceBlue
+ 'Save the document in the given name and format
+ document.Save("Document.docx", FormatType.Docx)
+ 'Release the resources occupied by WordDocument instance
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create an instance of WordDocument class
+ WordDocument document = new WordDocument();
+ //Set the background type of the document
+ document.Background.Type = BackgroundType.Gradient;
+ //Set the first color of the background gradient of the document
+ document.Background.Gradient.Color1 = Color.AliceBlue;
+ //Set the second color of the background gradient of the document
+ document.Background.Gradient.Color2 = Color.Purple;
+ //Set the first shading style of the background gradient of the document
+ document.Background.Gradient.ShadingStyle = GradientShadingStyle.DiagonalDown;
+ //Set the first shading variant of the background gradient of the document
+ document.Background.Gradient.ShadingVariant = GradientShadingVariant.ShadingMiddle;
+ //Add one section with one paragraph to the document
+ document.EnsureMinimal();
+ //Add the text range to the last paragraph of the section
+ document.LastParagraph.AppendText("Hello World!");
+ //Save the document in the given name and format
+ document.Save("Sample.docx", FormatType.Docx);
+ //Release the resources occupied by WordDocument instance
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create an instance of WordDocument class
+ Dim document As New WordDocument()
+ 'Set the background type of the document
+ document.Background.Type = BackgroundType.Gradient
+ 'Set the first color of the background gradient of the document
+ document.Background.Gradient.Color1 = Color.AliceBlue
+ 'Set the second color of the background gradient of the document
+ document.Background.Gradient.Color2 = Color.Purple
+ 'Set the first shading style of the background gradient of the document
+ document.Background.Gradient.ShadingStyle = GradientShadingStyle.DiagonalDown
+ 'Set the first shading variant of the background gradient of the document
+ document.Background.Gradient.ShadingVariant = GradientShadingVariant.ShadingMiddle
+ 'Add one section with one paragraph to the document
+ document.EnsureMinimal()
+ 'Add the text range to the last paragraph of the section
+ document.LastParagraph.AppendText("Hello World!")
+ 'Save the document in the given name and format
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Release the resources occupied by WordDocument instance
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ //Set the value for Company property of the document
+ document.BuiltinDocumentProperties.Company = "Northwind Traders";
+ //Set the value for Manager property of the document
+ document.BuiltinDocumentProperties.Manager = "Paul Anderson";
+ //Set the value for Author property of the document
+ document.BuiltinDocumentProperties.Author = "Peter";
+ //Set the value for Comments property of the document
+ document.BuiltinDocumentProperties.Comments = "This document provide the sales information of the year 2015";
+ //Set the value for LastAuthor property of the document
+ document.BuiltinDocumentProperties.LastAuthor = "Johnson";
+ //Set the value for Title property of the document
+ document.BuiltinDocumentProperties.Title = "Sales Information";
+ //Set the value for Category property of the document
+ document.BuiltinDocumentProperties.Category = "Sales";
+ document.Save("Result.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ 'Set the value for Company property of the document
+ document.BuiltinDocumentProperties.Company = "Northwind Traders"
+ 'Set the value for Manager property of the document
+ document.BuiltinDocumentProperties.Manager = "Paul Anderson"
+ 'Set the value for Author property of the document
+ document.BuiltinDocumentProperties.Author = "Peter"
+ 'Set the value for Comments property of the document
+ document.BuiltinDocumentProperties.Comments = "This document provide the sales information of the year 2015"
+ 'Set the value for LastAuthor property of the document
+ document.BuiltinDocumentProperties.LastAuthor = "Johnson"
+ 'Set the value for Title property of the document
+ document.BuiltinDocumentProperties.Title = "Sales Information"
+ 'Set the value for Category property of the document
+ document.BuiltinDocumentProperties.Category = "Sales"
+ document.Save("Result.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add the section into Word document
+ WSection section = document.AddSection() as WSection;
+ //Add the column into the section
+ Column column1 = new Column(document);
+ column1.Width = 150;
+ column1.Space = 20;
+ section.Columns.Add(column1);
+ //Add the column into the section
+ Column column2 = new Column(document);
+ column2.Width = 150;
+ column2.Space = 20;
+ section.Columns.Add(column2);
+ //Add the column into the section
+ Column column3 = new Column(document);
+ column3.Width = 150;
+ column3.Space = 20;
+ section.Columns.Add(column3);
+ //Add a paragraph to created section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add a paragraph to created section
+ paragraph = section.AddParagraph();
+ string paraText = "Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula";
+ //Append the text to the created paragraph
+ paragraph.AppendText(paraText);
+ //Add the column breaks
+ paragraph.AppendBreak(BreakType.ColumnBreak);
+ //Add a paragraph to created section
+ paragraph = section.AddParagraph();
+ //Append the text to the created paragraph
+ paragraph.AppendText(paraText);
+ //Add the column breaks
+ paragraph.AppendBreak(BreakType.ColumnBreak);
+ //Add a paragraph to created section
+ paragraph = section.AddParagraph();
+ //Append the text to the created paragraph
+ paragraph.AppendText(paraText);
+ //Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add the section into Word document
+ Dim section As WSection = TryCast(document.AddSection(), WSection)
+ 'Add the column into the section
+ Dim column1 As New Column(document)
+ column1.Width = 150
+ column1.Space = 20
+ section.Columns.Add(column1)
+ 'Add the column into the section
+ Dim column2 As New Column(document)
+ column2.Width = 150
+ column2.Space = 20
+ section.Columns.Add(column2)
+ 'Add the column into the section
+ Dim column3 As New Column(document)
+ column3.Width = 150
+ column3.Space = 20
+ section.Columns.Add(column3)
+ 'Add a paragraph to created section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add a paragraph to created section
+ paragraph = section.AddParagraph()
+ Dim paraText As String = "Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula"
+ 'Append the text to the created paragraph
+ paragraph.AppendText(paraText)
+ 'Add the column breaks
+ paragraph.AppendBreak(BreakType.ColumnBreak)
+ 'Add a paragraph to created section
+ paragraph = section.AddParagraph()
+ 'Append the text to the created paragraph
+ paragraph.AppendText(paraText)
+ 'Add the column breaks
+ paragraph.AppendBreak(BreakType.ColumnBreak)
+ 'Add a paragraph to created section
+ paragraph = section.AddParagraph()
+ 'Append the text to the created paragraph
+ paragraph.AppendText(paraText)
+ 'Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Add the new custom property Typist with value
+ document.CustomDocumentProperties.Add("Typist", "Andrew");
+ //Add the new custom property Publisher with value
+ document.CustomDocumentProperties.Add("Publisher", "Stephen");
+ //Add the new custom property Recorded by with value
+ document.CustomDocumentProperties.Add("Recorded by", "Harry");
+ //Add the new custom property Recorded date with value
+ document.CustomDocumentProperties.Add("Recorded date", new DateTime(2015, 2, 23));
+ //Save and close the Word document
+ document.Save("Result.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Add the new custom property Typist with value
+ document.CustomDocumentProperties.Add("Typist", "Andrew")
+ 'Add the new custom property Publisher with value
+ document.CustomDocumentProperties.Add("Publisher", "Stephen")
+ 'Add the new custom property Recorded by with value
+ document.CustomDocumentProperties.Add("Recorded by", "Harry")
+ 'Add the new custom property Recorded date with value
+ document.CustomDocumentProperties.Add("Recorded date", New DateTime(2015, 2, 23))
+ 'Save and close the Word document
+ document.Save("Result.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ paragraph.AppendText("Web Hyperlink: ");
+ paragraph = section.AddParagraph();
+ //Append web hyperlink to the paragraph
+ IWField field = paragraph.AppendHyperlink("http://www.syncfusion.com", "Syncfusion", HyperlinkType.WebLink);
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ paragraph.AppendText("Web Hyperlink: ")
+ paragraph = section.AddParagraph()
+ 'Append web hyperlink to the paragraph
+ Dim field As IWField = paragraph.AppendHyperlink("http://www.syncfusion.com", "Syncfusion", HyperlinkType.WebLink)
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ paragraph.AppendText("Email hyperlink: ");
+ paragraph = section.AddParagraph();
+ //Append Email hyperlink to the paragraph
+ paragraph.AppendHyperlink("mailto:john@gmail.com","John" , HyperlinkType.EMailLink);
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ paragraph.AppendText("Email hyperlink: ")
+ paragraph = section.AddParagraph()
+ 'Append Email hyperlink to the paragraph
+ paragraph.AppendHyperlink("mailto:john@gmail.com", "John", HyperlinkType.EMailLink)
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ paragraph.AppendText("File Hyperlinks: ");
+ paragraph = section.AddParagraph();
+ //Append hyperlink field to the paragraph
+ paragraph.AppendHyperlink(@"D:\Template.docx","File", HyperlinkType.FileLink);
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ paragraph.AppendText("File Hyperlinks: ")
+ paragraph = section.AddParagraph()
+ 'Append hyperlink field to the paragraph
+ paragraph.AppendHyperlink("D:\Template.docx", "File", HyperlinkType.FileLink)
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Create new Bookmark
+ paragraph.AppendBookmarkStart("Introduction");
+ paragraph.AppendText("Hyperlink");
+ paragraph.AppendBookmarkEnd("Introduction");
+ paragraph.AppendText("\nA hyperlink is a reference or navigation element in a document to another section of the same document or to another document that may be on or part of a (different) domain.");
+ paragraph = section.AddParagraph();
+ paragraph.AppendText("Bookmark Hyperlink: ");
+ paragraph = section.AddParagraph();
+ //Append Bookmark hyperlink to the paragraph
+ paragraph.AppendHyperlink("Introduction", "Bookmark", HyperlinkType.Bookmark);
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Create new Bookmark
+ paragraph.AppendBookmarkStart("Introduction")
+ paragraph.AppendText("Hyperlink")
+ paragraph.AppendBookmarkEnd("Introduction")
+ paragraph.AppendText(vbLf & "A hyperlink is a reference or navigation element in a document to another section of the same document or to another document that may be on or part of a (different) domain.")
+ paragraph = section.AddParagraph()
+ paragraph.AppendText("Bookmark Hyperlink: ")
+ paragraph = section.AddParagraph()
+ 'Append Bookmark hyperlink to the paragraph
+ paragraph.AppendHyperlink("Introduction", "Bookmark", HyperlinkType.Bookmark)
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ paragraph.AppendText("Image Hyperlink");
+ paragraph = section.AddParagraph();
+ //Create a new image instance and load image
+ WPicture picture = new WPicture(document);
+ picture.LoadImage(Image.FromFile("Image.png"));
+ //Append new image hyperlink to the paragraph
+ paragraph.AppendHyperlink("http://www.syncfusion.com", picture, HyperlinkType.WebLink);
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ paragraph.AppendText("Image Hyperlink")
+ paragraph = section.AddParagraph()
+ 'Create a new image instance and load image
+ Dim picture As New WPicture(document)
+ picture.LoadImage(Image.FromFile("Image.png"))
+ 'Append new image hyperlink to the paragraph
+ paragraph.AppendHyperlink("http://www.syncfusion.com", picture, HyperlinkType.WebLink)
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add a section and a paragraph in the document
+ document.EnsureMinimal();
+ IWParagraph paragraph = document.LastParagraph;
+ paragraph.AppendText("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua");
+ //Create a new picture watermark
+ PictureWatermark picWatermark = new PictureWatermark();
+ //Set the scaling to picture
+ picWatermark.Scaling = 120f;
+ picWatermark.Washout = true;
+ //Set the picture watermark to document
+ document.Watermark = picWatermark;
+ //Set the image to the picture watermark
+ picWatermark.Picture = Image.FromFile("ImagesPath" + "Water lilies.jpg");
+ document.Save("PictureWatermark.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add a section and a paragraph in the document
+ document.EnsureMinimal()
+ Dim paragraph As IWParagraph = document.LastParagraph
+ paragraph.AppendText("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua")
+ 'Create a new picture watermark
+ Dim picWatermark As New PictureWatermark()
+ 'Set the scaling to picture
+ picWatermark.Scaling = 120.0F
+ picWatermark.Washout = True
+ Set the picture watermark to document
+ document.Watermark = picWatermark
+ Set the image to the picture watermark
+ picWatermark.Picture = Image.FromFile(ImagesPath + "Water lilies.jpg")
+ document.Save("PictureWatermark.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Create a new picture watermark
+ PictureWatermark picWatermark = new PictureWatermark(Image.FromFile("ImagesPath" + "Water lilies.jpg"), false);
+ //Set the picture watermark to document
+ document.Watermark = picWatermark;
+ document.Save("PictureWatermark.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Create a new picture watermark
+ Dim picWatermark As New PictureWatermark(Image.FromFile(ImagesPath + "Water lilies.jpg"), False)
+ 'Set the picture watermark to document
+ document.Watermark = picWatermark
+ document.Save("PictureWatermark.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument("Template.docx");
+ //Add the section into Word document
+ WSection section = document.AddSection() as WSection;
+ //Access the first paragraph of the document
+ WParagraph paragraph = document.Sections[0].Paragraphs[0];
+ //Get the first tab from the paragraph
+ Tab tab = paragraph.ParagraphFormat.Tabs[0];
+ //Adjust the tab values
+ tab.Justification = TabJustification.Centered;
+ tab.Position = 200;
+ tab.TabLeader = Syncfusion.DocIO.DLS.TabLeader.Dotted;
+ //Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument("Template.docx")
+ 'Add the section into Word document
+ Dim section As WSection = TryCast(document.AddSection(), WSection)
+ 'Access the first paragraph of the document
+ Dim paragraph As WParagraph = document.Sections(0).Paragraphs(0)
+ 'Get the first tab from the paragraph
+ Dim tab As Tab = paragraph.ParagraphFormat.Tabs(0)
+ 'Adjust the tab values
+ tab.Justification = TabJustification.Centered
+ tab.Position = 200
+ tab.TabLeader = Syncfusion.DocIO.DLS.TabLeader.Dotted
+ 'Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add a section and a paragraph in the document
+ document.EnsureMinimal();
+ IWParagraph paragraph = document.LastParagraph;
+ paragraph.AppendText("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua");
+ //Create a new text watermark
+ TextWatermark textWatermark = new TextWatermark();
+ //Set the created watermark to document
+ document.Watermark = textWatermark;
+ //Set the text watermark font size
+ textWatermark.Size = 72;
+ //Set the text watermark layout to Horizontal
+ textWatermark.Layout = WatermarkLayout.Horizontal;
+ textWatermark.Semitransparent = false;
+ //Set the text watermark text color
+ textWatermark.Color = Color.Black;
+ //Set the text to text watermark text
+ textWatermark.Text = "TextWatermark";
+ document.Save("TextWatermark.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add a section and a paragraph in the document
+ document.EnsureMinimal()
+ Dim paragraph As IWParagraph = document.LastParagraph
+ paragraph.AppendText("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua")
+ 'Create a new text watermark
+ Dim textWatermark As New TextWatermark()
+ 'Set the text watermark to document
+ document.Watermark = textWatermark
+ 'Set the text watermark font size
+ textWatermark.Size = 72
+ 'Set the text watermark layout to Horizontal
+ textWatermark.Layout = WatermarkLayout.Horizontal
+ textWatermark.Semitransparent = False
+ 'Set the text watermark text color
+ textWatermark.Color = Color.Black
+ 'Set the text to the text watermark
+ textWatermark.Text = "TextWatermark"
+ document.Save("TextWatermark.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template,docx");
+ //Create a new text watermark
+ TextWatermark textWatermark = new TextWatermark("Demo Text");
+ //Set the created watermark to document
+ document.Watermark = textWatermark;
+ document.Save("TextWatermark.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template,docx")
+ 'Create a new text watermark
+ Dim textWatermark As New TextWatermark("Demo Text")
+ 'Set the created watermark to document
+ document.Watermark = textWatermark
+ document.Save("TextWatermark.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template,docx");
+ //Create a new text watermark
+ TextWatermark textWatermark = new TextWatermark("Demo Text", "Arial", 48, WatermarkLayout.Diagonal);
+ //Set the created watermark to document
+ document.Watermark = textWatermark;
+ document.Save("TextWatermark.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template,docx")
+ 'Create a new text watermark
+ Dim textWatermark As New TextWatermark("Demo Text", "Arial", 48, WatermarkLayout.Diagonal)
+ 'Set the created watermark to document
+ document.Watermark = textWatermark
+ document.Save("TextWatermark.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ WordDocument document = new WordDocument();
+ IWSection section = document.AddSection();
+ IWParagraph paragraph = section.AddParagraph();
+ paragraph.AppendText("First Name of the customer: ");
+ //Add the DocVariable field with Variable name and its type
+ paragraph.AppendField("FirstName", FieldType.FieldDocVariable);
+ paragraph = section.AddParagraph();
+ paragraph.AppendText("Last Name of the customer: ");
+ //Add the DocVariable field with Variable name and its type
+ paragraph.AppendField("LastName", FieldType.FieldDocVariable);
+ //Add the value for variable in WordDocument.Variable collection
+ document.Variables.Add("FirstName", "Jeff");
+ document.Variables.Add("LastName", "Smith");
+ //Update the document fields
+ document.UpdateDocumentFields();
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ Dim document As New WordDocument()
+ Dim section As IWSection = document.AddSection()
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ paragraph.AppendText("First Name of the customer: ")
+ 'Add the DocVariable field with Variable name and its type
+ paragraph.AppendField("FirstName", FieldType.FieldDocVariable)
+ paragraph = section.AddParagraph()
+ paragraph.AppendText("Last Name of the customer: ")
+ 'Add the DocVariable field with Variable name and its type
+ paragraph.AppendField("LastName", FieldType.FieldDocVariable)
+ 'Add the value for variable in WordDocument.Variable collection
+ document.Variables.Add("FirstName", "Jeff")
+ document.Variables.Add("LastName", "Smith")
+ 'Update the document fields
+ document.UpdateDocumentFields()
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Creates a new document.
+ WordDocument document = new WordDocument();
+ //Adds the first section to the document.
+ IWSection section = document.AddSection();
+ //Adds a paragraph to the section.
+ IWParagraph paragraph = section.AddParagraph();
+ //Sets DifferentFirstPage and DifferentOddEvenPages to true for inserting Header and Footer text.
+ section.PageSetup.DifferentFirstPage = true;
+ section.PageSetup.DifferentOddAndEvenPages = true;
+ //Appends some text to the first page in document.
+ paragraph.AppendText("\r\r[ First Page ] \r\rText Body_Text Body_Text Body_Text Body_Text Body_Text Body");
+ paragraph.ParagraphFormat.PageBreakAfter = true;
+ //Appends some text to the second page in document.
+ paragraph = section.AddParagraph();
+ paragraph.AppendText("\r\r[ Second Page ] \r\rText Body_Text Body_Text Body_Text Body_Text Body_Text Body");
+ paragraph.ParagraphFormat.PageBreakAfter = true;
+ //Appends some text to the third page in document.
+ paragraph = section.AddParagraph();
+ paragraph.AppendText("\r\r[ Third Page ] \r\rText Body_Text Body_Text Body_Text Body_Text Body_Text Body");
+ //Inserts First Page Header.
+ paragraph = new WParagraph(document);
+ paragraph.AppendText("[ FIRST PAGE Header ]");
+ section.HeadersFooters.FirstPageHeader.Paragraphs.Add(paragraph);
+ //Inserts First Page Footer.
+ paragraph = new WParagraph(document);
+ paragraph.AppendText("[ FIRST PAGE Footer ]");
+ section.HeadersFooters.FirstPageFooter.Paragraphs.Add(paragraph);
+ //Inserts Odd Pages Header.
+ paragraph = new WParagraph(document);
+ paragraph.AppendText("[ ODD Page Header Text goes here ]");
+ section.HeadersFooters.OddHeader.Paragraphs.Add(paragraph);
+ //Inserts Odd Pages Footer.
+ paragraph = new WParagraph(document);
+ paragraph.AppendText("[ ODD Page Footer Text goes here ]");
+ section.HeadersFooters.OddFooter.Paragraphs.Add(paragraph);
+ //Inserts Even Pages Header.
+ paragraph = new WParagraph(document);
+ paragraph.AppendText("[ EVEN Page Header Text goes here ]");
+ section.HeadersFooters.EvenHeader.Paragraphs.Add(paragraph);
+ //Inserts Even Pages Footer.
+ paragraph = new WParagraph(document);
+ paragraph.AppendText("[ EVEN Page Footer Text goes here ]");
+ section.HeadersFooters.EvenFooter.Paragraphs.Add(paragraph);
+ //Adds the second section to the document.
+ section = document.AddSection();
+ section.PageSetup.DifferentFirstPage = true;
+ //Appends some text to the Second Sections's first page in the document.
+ paragraph = section.AddParagraph();
+ paragraph.AppendText("\r\r[ First Page for SECOND SECTION ]\r[ ON DIFFERENT FIRTS PAGE ]\r\rText Body_Text Body_Text Body_Text Body_Text Body_Text Body");
+ paragraph.ParagraphFormat.PageBreakAfter = true;
+ //Appends some text to the Second Sections's second page in the document.
+ paragraph = section.AddParagraph();
+ paragraph.AppendText("\r\r[ Second Page for SECOND SECTION ]\rText Body_Text Body_Text Body_Text Body_Text Body_Text Body");
+ //Inserts Second Sections's First Header.
+ paragraph = new WParagraph(document);
+ paragraph.AppendText("[ SECOND SECTION FIRST PAGE Header ]");
+ section.HeadersFooters.FirstPageHeader.Paragraphs.Add(paragraph);
+ //Inserts Second Sections's First Footer.
+ paragraph = new WParagraph(document);
+ paragraph.AppendText("[ SECOND SECTION FIRST PAGE Footer ]");
+ section.HeadersFooters.FirstPageFooter.Paragraphs.Add(paragraph);
+ //Inserts Second Sections's Header.
+ paragraph = new WParagraph(document);
+ paragraph.AppendText("SECOND SECTION Header Text goes here");
+ section.HeadersFooters.OddHeader.Paragraphs.Add(paragraph);
+ //Inserts Second Sections's Footer.
+ paragraph = new WParagraph(document);
+ paragraph.AppendText("SECOND SECTION Footer Text goes here");
+ section.HeadersFooters.OddFooter.Paragraphs.Add(paragraph);
+ //Saves the document to disk.
+ document.Save("Sample.docx", FormatType.Docx);
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Creates a new document.
+ Dim document As WordDocument = New WordDocument()
+ 'Adds the first section to the document.
+ Dim section As IWSection = document.AddSection()
+ 'Adds a paragraph to the section.
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Sets DifferentFirstPage and DifferentOddEvenPages as true for inserting Header and Footer text.
+ section.PageSetup.DifferentFirstPage = True
+ section.PageSetup.DifferentOddAndEvenPages = True
+ 'Appends some text to the first page in document.
+ paragraph.AppendText(Constants.VB.NETCr + Constants.VB.NETCr and "[ First Page ] " and Constants.VB.NETCr + Constants.VB.NETCr and "Text Body_Text Body_Text Body_Text Body_Text Body_Text Body")
+ paragraph.ParagraphFormat.PageBreakAfter = True
+ 'Appends some text to the second page in document.
+ paragraph = section.AddParagraph()
+ paragraph.AppendText(Constants.VB.NETCr + Constants.VB.NETCr and "[ Second Page ] " and Constants.VB.NETCr + Constants.VB.NETCr and "Text Body_Text Body_Text Body_Text Body_Text Body_Text Body")
+ paragraph.ParagraphFormat.PageBreakAfter = True
+ 'Appends some text to the third page in document.
+ paragraph = section.AddParagraph()
+ paragraph.AppendText(Constants.VB.NETCr + Constants.VB.NETCr and "[ Third Page ] " and Constants.VB.NETCr + Constants.VB.NETCr and "Text Body_Text Body_Text Body_Text Body_Text Body_Text Body")
+ 'Inserts First Page Header.
+ paragraph = New WParagraph(document)
+ paragraph.AppendText("[ FIRST PAGE Header ]")
+ section.HeadersFooters.FirstPageHeader.Paragraphs.Add(paragraph)
+ 'Inserts First Page Footer.
+ paragraph = New WParagraph(document)
+ paragraph.AppendText("[ FIRST PAGE Footer ]")
+ section.HeadersFooters.FirstPageFooter.Paragraphs.Add(paragraph)
+ 'Inserts Odd Pages Header.
+ paragraph = New WParagraph(document)
+ paragraph.AppendText("[ ODD Page Header Text goes here ]")
+ section.HeadersFooters.OddHeader.Paragraphs.Add(paragraph)
+ 'Inserts Odd Pages Footer.
+ paragraph = New WParagraph(document)
+ paragraph.AppendText("[ ODD Page Footer Text goes here ]")
+ section.HeadersFooters.OddFooter.Paragraphs.Add(paragraph)
+ 'Inserts Even Pages Header.
+ paragraph = New WParagraph(document)
+ paragraph.AppendText("[ EVEN Page Header Text goes here ]")
+ section.HeadersFooters.EvenHeader.Paragraphs.Add(paragraph)
+ 'Inserts Even Pages Footer.
+ paragraph = New WParagraph(document)
+ paragraph.AppendText("[ EVEN Page Footer Text goes here ]")
+ section.HeadersFooters.EvenFooter.Paragraphs.Add(paragraph)
+ 'Adds the second section to the document.
+ section = document.AddSection()
+ section.PageSetup.DifferentFirstPage = True
+ 'Appends some text to the Second Sections's first page in the document.
+ paragraph = section.AddParagraph()
+ paragraph.AppendText(Constants.VB.NETCr + Constants.VB.NETCr and "[ First Page for SECOND SECTION ]" and Constants.VB.NETCr and "[ ON DIFFERENT FIRTS PAGE ]" and Constants.VB.NETCr + Constants.VB.NETCr and "Text Body_Text Body_Text Body_Text Body_Text Body_Text Body")
+ paragraph.ParagraphFormat.PageBreakAfter = True
+ 'Appends some text to the Second Sections's second page in the document.
+ paragraph = section.AddParagraph()
+ paragraph.AppendText(Constants.VB.NETCr + Constants.VB.NETCr and "[ Second Page for SECOND SECTION ]" and Constants.VB.NETCr and "Text Body_Text Body_Text Body_Text Body_Text Body_Text Body")
+ 'Inserts Second Sections's First Header.
+ paragraph = New WParagraph(document)
+ paragraph.AppendText("[ SECOND SECTION FIRST PAGE Header ]")
+ section.HeadersFooters.FirstPageHeader.Paragraphs.Add(paragraph)
+ 'Inserts Second Sections's First Footer.
+ paragraph = New WParagraph(document)
+ paragraph.AppendText("[ SECOND SECTION FIRST PAGE Footer ]")
+ section.HeadersFooters.FirstPageFooter.Paragraphs.Add(paragraph)
+ 'Inserts Second Sections's Header.
+ paragraph = New WParagraph(document)
+ paragraph.AppendText("SECOND SECTION Header Text goes here")
+ section.HeadersFooters.OddHeader.Paragraphs.Add(paragraph)
+ 'Inserts Second Sections's Footer.
+ paragraph = New WParagraph(document)
+ paragraph.AppendText("SECOND SECTION Footer Text goes here")
+ section.HeadersFooters.OddFooter.Paragraphs.Add(paragraph)
+ 'Saves the document to disk.
+ document.Save("Sample.docx", FormatType.Docx)
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new document
+ WordDocument document = new WordDocument();
+ //Add the first section to the document
+ IWSection section = document.AddSection();
+ //Insert the first section header
+ section.HeadersFooters.Header.AddParagraph().AppendText("[ First Section Header ]");
+ //Insert the first section footer
+ section.HeadersFooters.Footer.AddParagraph().AppendText("[ First Section Footer ]");
+ //Add a paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ string paraText = "Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula";
+ //Append some text to the first page in document
+ paragraph.AppendText("\r\r[ First Page ] \r\r" + paraText);
+ //Add the second section to the document
+ section = document.AddSection();
+ //Insert the second section header
+ section.HeadersFooters.Header.AddParagraph().AppendText("[ Second Section Header ]");
+ //Insert the second section footer.
+ section.HeadersFooters.Footer.AddParagraph().AppendText("[ Second Section Footer ]");
+ //Set LinkToPrevious as true for retrieve the header and footer from previous section
+ section.HeadersFooters.LinkToPrevious = true;
+ //Append some text to the second page in document
+ paragraph = section.AddParagraph();
+ paragraph.AppendText("\r\r[ Second Page ] \r\r" + paraText);
+ //Add the third section to the document
+ section = document.AddSection();
+ //Insert the third section header
+ section.HeadersFooters.Header.AddParagraph().AppendText("[ Third Section Header ]");
+ //Insert the third section footer
+ section.HeadersFooters.Footer.AddParagraph().AppendText("[ Third Section Footer ]");
+ //Append some text to the third page in document
+ paragraph = section.AddParagraph();
+ paragraph.AppendText("\r\r[ Third Page ] \r\r" + paraText);
+ //Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new document
+ Dim document As New WordDocument()
+ 'Add the first section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Insert the first section header
+ section.HeadersFooters.Header.AddParagraph().AppendText("[ First Section Header ]")
+ 'Insert the first section footer
+ section.HeadersFooters.Footer.AddParagraph().AppendText("[ First Section Footer ]")
+ 'Add a paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ Dim paraText As String = "Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula"
+ 'Append some text to the first page in document
+ paragraph.AppendText(Convert.ToString(vbCr & vbCr & "[ First Page ] " & vbCr & vbCr) & paraText)
+ 'Add the second section to the document
+ section = document.AddSection()
+ 'Insert the second section header
+ section.HeadersFooters.Header.AddParagraph().AppendText("[ Second Section Header ]")
+ 'Insert the second section footer
+ section.HeadersFooters.Footer.AddParagraph().AppendText("[ Second Section Footer ]")
+ 'Set LinkToPrevious as true for retrieve the header and footer from previous section
+ section.HeadersFooters.LinkToPrevious = True
+ 'Append some text to the second page in document
+ paragraph = section.AddParagraph()
+ paragraph.AppendText(Convert.ToString(vbCr & vbCr & "[ Second Page ] " & vbCr & vbCr) & paraText)
+ 'Add the third section to the document
+ section = document.AddSection()
+ 'Insert the third section header
+ section.HeadersFooters.Header.AddParagraph().AppendText("[ Third Section Header ]")
+ 'Insert the third section footer
+ section.HeadersFooters.Footer.AddParagraph().AppendText("[ Third Section Footer ]")
+ 'Append some text to the third page in document
+ paragraph = section.AddParagraph()
+ paragraph.AppendText(Convert.ToString(vbCr & vbCr & "[ Third Page ] " & vbCr & vbCr) & paraText)
+ �Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create new Word document
+ WordDocument document = new WordDocument();
+ //Add new section
+ IWSection section = document.AddSection();
+ WTextBody textbody = section.Body;
+ //Add a paragraph to the text body
+ WParagraph paragraph = textbody.AddParagraph() as WParagraph;
+ //Add text
+ paragraph.AppendText("A new paragraph is added");
+ //Save and close the document
+ document.Save("Sample.docx");
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create new Word document
+ Dim document As New WordDocument()
+ 'Add new section
+ Dim section As IWSection = document.AddSection()
+ Dim textbody As WTextBody = section.Body
+ 'Add a paragraph to the text body
+ Dim paragraph As WParagraph = TryCast(textbody.AddParagraph(), WParagraph)
+ 'Add text
+ paragraph.AppendText("A new paragraph is added")
+ 'Save and close the document
+ document.Save("Sample.docx")
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create new Word document
+ WordDocument document = new WordDocument();
+ //Add new section
+ IWSection section = document.AddSection();
+ WTextBody textbody = section.Body;
+ //Add a table to the text body
+ IWTable table = textbody.AddTable();
+ table.ResetCells(2, 2);
+ //Save and close the document
+ document.Save("Sample.docx");
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create new Word document
+ Dim document As New WordDocument()
+ 'Add new section
+ Dim section As IWSection = document.AddSection()
+ Dim textbody As WTextBody = section.Body
+ 'Add a table to the text body
+ Dim table As IWTable = textbody.AddTable()
+ table.ResetCells(2, 2)
+ 'Save and close the document
+ document.Save("Sample.docx")
+ document.Close()
+ End Sub
+
+
+ //Create new Word document
+ WordDocument document = new WordDocument();
+ //Add new section
+ IWSection section = document.AddSection();
+ WTextBody textbody = section.Body;
+ //Add a block content control to the text body
+ BlockContentControl blockControl = textbody.AddBlockContentControl(ContentControlType.RichText) as BlockContentControl;
+ //Add text to the control added
+ blockControl.TextBody.AddParagraph().AppendText("A new block control is added");
+ //Save and close the document
+ document.Save("Sample.docx");
+ document.Close();
+
+
+ 'Create new Word document
+ Dim document As New WordDocument()
+ 'Add new section
+ Dim section As IWSection = document.AddSection()
+ Dim textbody As WTextBody = section.Body
+ 'Add a block content control to the text body
+ Dim blockControl As BlockContentControl = TryCast(textbody.AddBlockContentControl(ContentControlType.RichText), BlockContentControl)
+ 'Add text to the control added
+ blockControl.TextBody.AddParagraph().AppendText("A new block control is added")
+ 'Save and close the document
+ document.Save("Sample.docx")
+ document.Close()
+
+
+ //Load the template document
+ WordDocument document = new WordDocument("Template.docx");
+ //Html string to be inserted
+ string htmlstring = "This text is inserted as HTML string.
";
+ //Append Html string as first item of the second paragraph in the document
+ document.Sections[0].Body.InsertXHTML(htmlstring);
+ //Save and close the document
+ document.Save("Sample.docx");
+ document.Close();
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load the template document
+ Dim document As New WordDocument("Template.docx")
+ 'Html string to be inserted
+ Dim htmlstring As String = "This text is inserted as HTML string.
"
+ 'Append Html string as first item of the second paragraph in the document
+ document.Sections(0).Body.InsertXHTML(htmlstring)
+ 'Save and close the document
+ document.Save("Sample.docx")
+ document.Close()
+ End Sub
+
+
+ //Load the template document
+ WordDocument document = new WordDocument("Template.docx");
+ //Html string to be inserted
+ string htmlstring = "This text is inserted as HTML string.
";
+ //Append Html string as first item of the second paragraph in the document
+ document.Sections[0].Body.InsertXHTML(htmlstring, 2);
+ //Save and close the document
+ document.Save("Sample.docx");
+ document.Close();
+
+
+ 'Load the template document
+ Dim document As New WordDocument("Template.docx")
+ 'Html string to be inserted
+ Dim htmlstring As String = "This text is inserted as HTML string.
"
+ 'Append Html string as first item of the second paragraph in the document
+ document.Sections(0).Body.InsertXHTML(htmlstring, 2)
+ 'Save and close the document
+ document.Save("Sample.docx")
+ document.Close()
+
+
+ //Load the template document
+ WordDocument document = new WordDocument("Template.docx");
+ //Html string to be inserted
+ string htmlstring = "This text is inserted as HTML string.
";
+ //Validating the Html string
+ bool isValidHtml = document.LastSection.Body.IsValidXHTML(htmlstring, XHTMLValidationType.Transitional);
+ //If the Html string passes validation, it is inserted to document
+ if (isValidHtml)
+ {
+ //Append Html string as first item of the second paragraph in the document
+ document.Sections[0].Body.InsertXHTML(htmlstring, 2, 0);
+ }
+ //Save and close the document
+ document.Save("Sample.docx");
+ document.Close();
+
+
+ 'Load the template document
+ Dim document As New WordDocument("Template.docx")
+ 'Html string to be inserted
+ Dim htmlstring As String = "This text is inserted as HTML string.
"
+ 'Validating the Html string
+ Dim isValidHtmlAs Boolean = document.LastSection.Body.IsValidXHTML(htmlstring, XHTMLValidationType.Transitional)
+ 'If the Html string passes validation, it is inserted to document
+ If isValidHtmlThen
+ 'Append Html string as first item of the second paragraph in the document
+ document.Sections(0).Body.InsertXHTML(htmlstring, 2, 0)
+ End If
+ 'Save and close the document
+ document.Save("Sample.docx")
+ document.Close()
+
+
+ //Load the template document
+ WordDocument document = new WordDocument("Template.docx");
+ //Html string to be inserted
+ string htmlstring = "This text is inserted as HTML string.
";
+ string exception = "The string is not valid";
+ //Validating the Html string
+ bool isValidHtml = document.LastSection.Body.IsValidXHTML(htmlstring, XHTMLValidationType.Transitional, out exception);
+ //If the Html string passes validation, it is inserted to document
+ if (isValidHtml)
+ {
+ //Append Html string as first item of the second paragraph in the document
+ document.Sections[0].Body.InsertXHTML(htmlstring, 2, 0);
+ }
+ //Save and close the document
+ document.Save("Sample.docx");
+ document.Close();
+
+
+ 'Load the template document
+ Dim document As New WordDocument("Template.docx")
+ 'Html string to be inserted
+ Dim htmlstring As String = "This text is inserted as HTML string.
"
+ Dim exception As String = "The string is not valid"
+ 'Validating the Html string
+ Dim isValidHtmlAs Boolean = document.LastSection.Body.IsValidXHTML(htmlstring, XHTMLValidationType.Transitional, exception)
+ 'If the Html string passes validation, it is inserted to document
+ If isValidHtmlThen
+ 'Append Html string as first item of the second paragraph in the document
+ document.Sections(0).Body.InsertXHTML(htmlstring, 2, 0)
+ End If
+ 'Save and close the document
+ document.Save("Sample.docx")
+ document.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create new Word document
+ WordDocument document = new WordDocument();
+ //Add new section
+ IWSection section = document.AddSection();
+ WTextBody textbody = section.Body;
+ //Add one paragraph to the section body
+ textbody.EnsureMinimum();
+ textbody.LastParagraph.AppendText("Last paragraph");
+ //Save and close the document
+ document.Save("Sample.docx");
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create new Word document
+ Dim document As New WordDocument()
+ 'Add new section
+ Dim section As IWSection = document.AddSection()
+ Dim textbody As WTextBody = section.Body
+ 'Add one paragraph to the section body
+ textbody.EnsureMinimum()
+ textbody.LastParagraph.AppendText("Last paragraph")
+ 'Save and close the document
+ document.Save("Sample.docx")
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load a template Word document
+ WordDocument document = new WordDocument("Template.docx");
+ //Get the textbody of first section
+ WTextBody textbody = document.Sections[0].Body;
+ //Get the last paragraph
+ IWParagraph paragraph = textbody.LastParagraph;
+ //Set horizontal alignment
+ paragraph.ParagraphFormat.HorizontalAlignment = HorizontalAlignment.Right;
+ //Save and close the document
+ document.Save("Sample.docx");
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load a template Word document
+ Dim document As New WordDocument("Template.docx")
+ 'Get the textbody of first section
+ Dim textbody As WTextBody = document.Sections(0).Body
+ 'Get the last paragraph
+ Dim paragraph As IWParagraph = textbody.LastParagraph
+ 'Set horizontal alignment
+ paragraph.ParagraphFormat.HorizontalAlignment = HorizontalAlignment.Right
+ 'Save and close the document
+ document.Save("Sample.docx")
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create new Word document
+ WordDocument document = new WordDocument();
+ //Add new section
+ IWSection section = document.AddSection();
+ WTextBody textbody = section.Body;
+ //Add a paragraph to the text body
+ WParagraph paragraph = textbody.AddParagraph() as WParagraph;
+ //Add text
+ paragraph.AppendText("A new paragraph is added");
+ //Save and close the document
+ document.Save("Sample.docx");
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create new Word document
+ Dim document As New WordDocument()
+ 'Add new section
+ Dim section As IWSection = document.AddSection()
+ Dim textbody As WTextBody = section.Body
+ 'Add a paragraph to the text body
+ Dim paragraph As WParagraph = TryCast(textbody.AddParagraph(), WParagraph)
+ 'Add text
+ paragraph.AppendText("A new paragraph is added")
+ 'Save and close the document
+ document.Save("Sample.docx")
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create new Word document
+ WordDocument document = new WordDocument();
+ //Add new section
+ IWSection section = document.AddSection();
+ WTextBody textbody = section.Body;
+ //Add a table to the text body
+ IWTable table = textbody.AddTable();
+ table.ResetCells(2, 2);
+ //Save and close the document
+ document.Save("Sample.docx");
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create new Word document
+ Dim document As New WordDocument()
+ 'Add new section
+ Dim section As IWSection = document.AddSection()
+ Dim textbody As WTextBody = section.Body
+ 'Add a table to the text body
+ Dim table As IWTable = textbody.AddTable()
+ table.ResetCells(2, 2)
+ 'Save and close the document
+ document.Save("Sample.docx")
+ document.Close()
+ End Sub
+
+
+ //Create new Word document
+ WordDocument document = new WordDocument();
+ //Add new section
+ IWSection section = document.AddSection();
+ WTextBody textbody = section.Body;
+ //Add a block content control to the text body
+ BlockContentControl blockControl = textbody.AddBlockContentControl(ContentControlType.RichText) as BlockContentControl;
+ //Add text to the control added
+ blockControl.TextBody.AddParagraph().AppendText("A new block control is added");
+ //Save and close the document
+ document.Save("Sample.docx");
+ document.Close();
+
+
+ 'Create new Word document
+ Dim document As New WordDocument()
+ 'Add new section
+ Dim section As IWSection = document.AddSection()
+ Dim textbody As WTextBody = section.Body
+ 'Add a block content control to the text body
+ Dim blockControl As BlockContentControl = TryCast(textbody.AddBlockContentControl(ContentControlType.RichText), BlockContentControl)
+ 'Add text to the control added
+ blockControl.TextBody.AddParagraph().AppendText("A new block control is added")
+ 'Save and close the document
+ document.Save("Sample.docx")
+ document.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load the template document
+ WordDocument document = new WordDocument("Template.docx");
+ //Html string to be inserted
+ string htmlstring = "This text is inserted as HTML string.
";
+ //Append Html string as first item of the second paragraph in the document
+ document.Sections[0].Body.InsertXHTML(htmlstring);
+ //Save and close the document
+ document.Save("Sample.docx");
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load the template document
+ Dim document As New WordDocument("Template.docx")
+ 'Html string to be inserted
+ Dim htmlstring As String = "This text is inserted as HTML string.
"
+ 'Append Html string as first item of the second paragraph in the document
+ document.Sections(0).Body.InsertXHTML(htmlstring)
+ 'Save and close the document
+ document.Save("Sample.docx")
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load the template document
+ WordDocument document = new WordDocument("Template.docx");
+ //Html string to be inserted
+ string htmlstring = "This text is inserted as HTML string.
";
+ //Append Html string as first item of the second paragraph in the document
+ document.Sections[0].Body.InsertXHTML(htmlstring, 2);
+ //Save and close the document
+ document.Save("Sample.docx");
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load the template document
+ Dim document As New WordDocument("Template.docx")
+ 'Html string to be inserted
+ Dim htmlstring As String = "This text is inserted as HTML string.
"
+ 'Append Html string as first item of the second paragraph in the document
+ document.Sections(0).Body.InsertXHTML(htmlstring, 2)
+ 'Save and close the document
+ document.Save("Sample.docx")
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load the template document
+ WordDocument document = new WordDocument("Template.docx");
+ //Html string to be inserted
+ string htmlstring = "This text is inserted as HTML string.
";
+ //Validating the Html string
+ bool isValidHtml = document.LastSection.Body.IsValidXHTML(htmlstring, XHTMLValidationType.Transitional);
+ //If the Html string passes validation, it is inserted to document
+ if (isValidHtml)
+ {
+ //Append Html string as first item of the second paragraph in the document
+ document.Sections[0].Body.InsertXHTML(htmlstring, 2, 0);
+ }
+ //Save and close the document
+ document.Save("Sample.docx");
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load the template document
+ Dim document As New WordDocument("Template.docx")
+ 'Html string to be inserted
+ Dim htmlstring As String = "This text is inserted as HTML string.
"
+ 'Validating the Html string
+ Dim isValidHtmlAs Boolean = document.LastSection.Body.IsValidXHTML(htmlstring, XHTMLValidationType.Transitional)
+ 'If the Html string passes validation, it is inserted to document
+ If isValidHtmlThen
+ 'Append Html string as first item of the second paragraph in the document
+ document.Sections(0).Body.InsertXHTML(htmlstring, 2, 0)
+ End If
+ 'Save and close the document
+ document.Save("Sample.docx")
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load the template document
+ WordDocument document = new WordDocument("Template.docx");
+ //Html string to be inserted
+ string htmlstring = "This text is inserted as HTML string.
";
+ string exception = "The string is not valid";
+ //Validating the Html string
+ bool isValidHtml = document.LastSection.Body.IsValidXHTML(htmlstring, XHTMLValidationType.Transitional, out exception);
+ //If the Html string passes validation, it is inserted to document
+ if (isValidHtml)
+ {
+ //Append Html string as first item of the second paragraph in the document
+ document.Sections[0].Body.InsertXHTML(htmlstring, 2, 0);
+ }
+ //Save and close the document
+ document.Save("Sample.docx");
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load the template document
+ Dim document As New WordDocument("Template.docx")
+ 'Html string to be inserted
+ Dim htmlstring As String = "This text is inserted as HTML string.
"
+ Dim exception As String = "The string is not valid"
+ 'Validating the Html string
+ Dim isValidHtmlAs Boolean = document.LastSection.Body.IsValidXHTML(htmlstring, XHTMLValidationType.Transitional, exception)
+ 'If the Html string passes validation, it is inserted to document
+ If isValidHtmlThen
+ 'Append Html string as first item of the second paragraph in the document
+ document.Sections(0).Body.InsertXHTML(htmlstring, 2, 0)
+ End If
+ 'Save and close the document
+ document.Save("Sample.docx")
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create new Word document
+ WordDocument document = new WordDocument();
+ //Add new section
+ IWSection section = document.AddSection();
+ WTextBody textbody = section.Body;
+ //Add one paragraph to the section body
+ textbody.EnsureMinimum();
+ textbody.LastParagraph.AppendText("Last paragraph");
+ //Save and close the document
+ document.Save("Sample.docx");
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create new Word document
+ Dim document As New WordDocument()
+ 'Add new section
+ Dim section As IWSection = document.AddSection()
+ Dim textbody As WTextBody = section.Body
+ 'Add one paragraph to the section body
+ textbody.EnsureMinimum()
+ textbody.LastParagraph.AppendText("Last paragraph")
+ 'Save and close the document
+ document.Save("Sample.docx")
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load a template Word document
+ WordDocument document = new WordDocument("Template.docx");
+ //Get the textbody of first section
+ WTextBody textbody = document.Sections[0].Body;
+ //Get the last paragraph
+ IWParagraph paragraph = textbody.LastParagraph;
+ //Set horizontal alignment
+ paragraph.ParagraphFormat.HorizontalAlignment = HorizontalAlignment.Right;
+ //Save and close the document
+ document.Save("Sample.docx");
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load a template Word document
+ Dim document As New WordDocument("Template.docx")
+ 'Get the textbody of first section
+ Dim textbody As WTextBody = document.Sections(0).Body
+ 'Get the last paragraph
+ Dim paragraph As IWParagraph = textbody.LastParagraph
+ 'Set horizontal alignment
+ paragraph.ParagraphFormat.HorizontalAlignment = HorizontalAlignment.Right
+ 'Save and close the document
+ document.Save("Sample.docx")
+ document.Close()
+ End Sub
+
+
+ //Create an new instance of WordDocument class
+ WordDocument document = new WordDocument();
+ //Add a new section into the Word document
+ IWSection section = document.AddSection();
+ //Specify the page margins
+ section.PageSetup.Margins.All = 50f;
+ //Add a new simple paragraph into the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add a text range into the paragraph
+ paragraph.AppendText("Hello World!");
+ //Save the document in the given name and format
+ document.Save("Document.docx", FormatType.Docx);
+ //Release the resources occupied by WordDocument instance
+ document.Close();
+
+
+ 'Create an instance of WordDocument class
+ Dim document As New WordDocument()
+ 'Add a new section into the Word document
+ Dim section As IWSection = document.AddSection()
+ 'Specify the page margins
+ section.PageSetup.Margins.All = 50F
+ 'Add a new simple paragraph into the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add a text range into the paragraph
+ paragraph.AppendText("Hello World!")
+ 'Save the document in the given name and format
+ document.Save("Document.docx", FormatType.Docx)
+ 'Release the resources occupied by WordDocument instance
+ document.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Creates a new Word document.
+ WordDocument document = new WordDocument();
+ //Add a section and a paragraph in the empty document
+ document.EnsureMinimal();
+ IWParagraph paragraph = document.LastParagraph;
+ //Append text to the last paragraph of the document
+ paragraph.AppendText("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua");
+ //Save and close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Creates a new Word document.
+ Dim document As New WordDocument()
+ 'Add a section and a paragraph in the empty document
+ document.EnsureMinimal()
+ Dim paragraph As IWParagraph = document.LastParagraph
+ 'Append text to the last paragraph of the document
+ paragraph.AppendText("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua")
+ 'Save and close the Word document
+ document.Save("Comment.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Append the text to the created paragraph
+ paragraph.AppendText("A new section is added to the document.");
+ //Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Append the text to the created paragraph
+ paragraph.AppendText("A new section is added to the document.")
+ 'Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+
+ //Create user defined style
+ IWParagraphStyle style = document.AddParagraphStyle("User_defined_style");
+ style.ParagraphFormat.BackColor = Color.LightGray;
+ style.ParagraphFormat.AfterSpacing = 18f;
+ style.ParagraphFormat.BeforeSpacing = 18f;
+ style.ParagraphFormat.Borders.BorderType = Syncfusion.DocIO.DLS.BorderStyle.DotDash;
+ style.ParagraphFormat.Borders.LineWidth = 0.5f;
+ style.ParagraphFormat.LineSpacing = 15f;
+ style.CharacterFormat.FontName = "Calibri";
+ style.CharacterFormat.Italic = true;
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ IWTextRange text = paragraph.AppendText("A new paragraph style is created and is applied to this paragraph.");
+ //Apply the new style to paragraph
+ paragraph.ApplyStyle("User_defined_style");
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Create user defined style
+ Dim style As IWParagraphStyle = document.AddParagraphStyle("User_defined_style")
+ style.ParagraphFormat.BackColor = Color.LightGray
+ style.ParagraphFormat.AfterSpacing = 18.0F
+ style.ParagraphFormat.BeforeSpacing = 18.0F
+ style.ParagraphFormat.Borders.BorderType = Syncfusion.DocIO.DLS.BorderStyle.DotDash
+ style.ParagraphFormat.Borders.LineWidth = 0.5F
+ style.ParagraphFormat.LineSpacing = 15.0F
+ style.CharacterFormat.FontName = "Calibri"
+ style.CharacterFormat.Italic = True
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ Dim text As IWTextRange = paragraph.AppendText("A new paragraph style is created and is applied to this paragraph.")
+ 'Apply the new style to paragraph
+ paragraph.ApplyStyle("User_defined_style")
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new list style to the document
+ ListStyle listStyle = document.AddListStyle(ListType.Numbered, "UserdefinedList");
+ WListLevel levelOne = listStyle.Levels[0];
+ //Define the follow character, prefix, suffix, start index for level 0
+ levelOne.FollowCharacter = FollowCharacterType.Tab;
+ levelOne.NumberPrefix = "(";
+ levelOne.NumberSufix = ")";
+ levelOne.PatternType = ListPatternType.LowRoman;
+ levelOne.StartAt = 1;
+ levelOne.TabSpaceAfter = 5;
+ levelOne.NumberAlignment = ListNumberAlignment.Center;
+ WListLevel levelTwo = listStyle.Levels[1];
+ //Define the follow character, suffix, pattern, start index for level 1
+ levelTwo.FollowCharacter = FollowCharacterType.Tab;
+ levelTwo.NumberSufix = "}";
+ levelTwo.PatternType = ListPatternType.LowLetter;
+ levelTwo.StartAt = 2;
+
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add text to the paragraph
+ paragraph.AppendText("User defined list - Level 0");
+ //Apply default numbered list style
+ paragraph.ListFormat.ApplyStyle("UserdefinedList");
+ //Add second paragraph
+ paragraph = section.AddParagraph();
+ paragraph.AppendText("User defined list - Level 1");
+ //Continue last defined list
+ paragraph.ListFormat.ContinueListNumbering();
+ //Increase the level indent
+ paragraph.ListFormat.IncreaseIndentLevel();
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new list style to the document
+ Dim listStyle As ListStyle = document.AddListStyle(ListType.Numbered, "UserdefinedList")
+ Dim levelOne As WListLevel = listStyle.Levels(0)
+ 'Define the follow character, prefix, suffix, start index for level 0
+ levelOne.FollowCharacter = FollowCharacterType.Tab
+ levelOne.NumberPrefix = "("
+ levelOne.NumberSufix = ")"
+ levelOne.PatternType = ListPatternType.LowRoman
+ levelOne.StartAt = 1
+ levelOne.TabSpaceAfter = 5
+ levelOne.NumberAlignment = ListNumberAlignment.Center
+ Dim levelTwo As WListLevel = listStyle.Levels(1)
+ 'Define the follow character, suffix, pattern, start index for level 1
+ levelTwo.FollowCharacter = FollowCharacterType.Tab
+ levelTwo.NumberSufix = "}"
+ levelTwo.PatternType = ListPatternType.LowLetter
+ levelTwo.StartAt = 2
+
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add text to the paragraph
+ paragraph.AppendText("User defined list - Level 0")
+ 'Apply default numbered list style
+ paragraph.ListFormat.ApplyStyle("UserdefinedList")
+ 'Add second paragraph
+ paragraph = section.AddParagraph()
+ paragraph.AppendText("User defined list - Level 1")
+ 'Continue last defined list
+ paragraph.ListFormat.ContinueListNumbering()
+ 'Increase the level indent
+ paragraph.ListFormat.IncreaseIndentLevel()
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load a template document
+ WordDocument document = new WordDocument("Template.docx");
+ //Get the document text and close the document
+ string text = document.GetText();
+ document.Close();
+ //Create new Word document
+ WordDocument newdocument = new WordDocument();
+ //Add new section
+ IWSection section = newdocument.AddSection();
+ //Add new paragraph
+ IWParagraph paragraph = section.AddParagraph();
+ //Append the text to the paragraph
+ paragraph.AppendText(text);
+ //Save and close the document
+ newdocument.Save("Sample.docx");
+ newdocument.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load a template document
+ Dim document As New WordDocument("Template.docx")
+ 'Get the document text and close the document
+ Dim text As String = document.GetText()
+ document.Close()
+ 'Create new Word document
+ Dim newdocument As New WordDocument()
+ 'Add new section
+ Dim section As IWSection = newdocument.AddSection()
+ 'Add new paragraph
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Append the text to the paragraph
+ paragraph.AppendText(text)
+ 'Save and close the document
+ newdocument.Save("Sample.docx")
+ newdocument.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Open an existing document
+ WordDocument inputTemplateDoc = new WordDocument("Template.docx");
+ //Create a clone of Input Template
+ WordDocument clonedDocument = inputTemplateDoc.Clone();
+ //Close the input template document instance
+ inputTemplateDoc.Close();
+ //Save and Close the cloned document instance
+ clonedDocument.Save("ClonedDocument.docx");
+ clonedDocument.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Open an existing document
+ Dim inputTemplateDoc As New WordDocument(fileName)
+ 'Create a clone of Input Template
+ Dim clonedDocument As WordDocument = inputTemplateDoc.Clone()
+ 'Close the input template document instance
+ inputTemplateDoc.Close()
+ 'Save and Close the cloned document instance
+ clonedDocument.Save("ClonedDocument.docx")
+ clonedDocument.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Open the source document
+ WordDocument sourceDocument = new WordDocument(sourceFileName);
+ //Open the destination document
+ WordDocument destinationDocument = new WordDocument(targetFileName);
+ //Import the last section of source document at the end of destination document
+ destinationDocument.ImportSection(sourceDocument.LastSection);
+ //Close the document instance
+ sourceDocument.Close();
+ //Save the destination document
+ destinationDocument.Save(outputFileName, FormatType.Docx);
+ //Close the document instance
+ destinationDocument.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Open the source document
+ Dim sourceDocument As New WordDocument("sourceFileName.docx")
+ 'Open the destination document
+ Dim destinationDocument As New WordDocument("targetFileName.docx")
+ 'Import the last section of source document at the end of destination document
+ destinationDocument.ImportSection(sourceDocument.LastSection)
+ 'Close the document instance
+ sourceDocument.Close()
+ 'Save the destination document
+ destinationDocument.Save("outputFileName.docx", FormatType.Docx)
+ 'Close the document instance
+ destinationDocument.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Open the source document
+ WordDocument sourceDocument = new WordDocument("sourceFileName.docx");
+ //Open the destination document
+ WordDocument destinationDocument = new WordDocument("targetFileName.docx");
+ //Import the contents of source document at the end of destination document
+ destinationDocument.ImportContent(sourceDocument);
+ //Close the document instance
+ sourceDocument.Close()
+ //Save the destination document
+ destinationDocument.Save("outputFileName.docx", FormatType.Docx);
+ //Close the document instance
+ destinationDocument.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Open the source document
+ Dim sourceDocument As New WordDocument(sourceFileName)
+ 'Open the destination document
+ Dim destinationDocument As New WordDocument(targetFileName)
+ 'Import the contents of source document at the end of destination document
+ destinationDocument.ImportContent(sourceDocument)
+ 'Close the document instance
+ sourceDocument.Close()
+ 'Save the destination document
+ destinationDocument.Save(outputFileName, FormatType.Docx)
+ 'Close the document instance
+ destinationDocument.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Open the source document
+ WordDocument sourceDocument = new WordDocument("sourceFileName.docx");
+ //Open the destination document
+ WordDocument destinationDocument = new WordDocument("targetFileName.docx");
+ //Import the contents of source document at the end of destination document
+ destinationDocument.ImportContent(sourceDocument, ImportOptions.UseDestinationStyles);
+ //Close the document instance
+ sourceDocument.Close();
+ //Save the destination document
+ destinationDocument.Save("outputFileName.docx", FormatType.Docx);
+ //Close the document instance
+ destinationDocument.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Open the source document
+ Dim sourceDocument As New WordDocument(sourceFileName)
+ 'Open the destination document
+ Dim destinationDocument As New WordDocument(targetFileName)
+ 'Import the contents of source document at the end of destination document
+ destinationDocument.ImportContent(sourceDocument, ImportOptions.UseDestinationStyles)
+ 'Close the document instance
+ sourceDocument.Close()
+ 'Save the destination document
+ destinationDocument.Save(outputFileName, FormatType.Docx)
+ 'Close the document instance
+ destinationDocument.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Open the source document
+ WordDocument sourceDocument = new WordDocument("sourceFileName.docx");
+ //Open the destination document
+ WordDocument destinationDocument = new WordDocument("targetFileName.docx");
+ //Import the contents of source document at the end of destination document
+ destinationDocument.ImportContent(sourceDocument, true);
+ //Close the document instance
+ sourceDocument.Close();
+ //Save the destination document
+ destinationDocument.Save("outputFileName.docx", FormatType.Docx);
+ //Close the document instance
+ destinationDocument.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Open the source document
+ Dim sourceDocument As New WordDocument(sourceFileName)
+ 'Open the destination document
+ Dim destinationDocument As New WordDocument(targetFileName)
+ 'Import the contents of source document at the end of destination document
+ destinationDocument.ImportContent(sourceDocument, true)
+ 'Close the document instance
+ sourceDocument.Close()
+ 'Save the destination document
+ destinationDocument.Save(outputFileName, FormatType.Docx)
+ 'Close the document instance
+ destinationDocument.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Add the built-in style to the document style collection
+ IStyle style = document.AddStyle(BuiltinStyle.Heading5);
+ //Apply the added built-in style to the last paragraph of the document
+ document.LastParagraph.ApplyStyle(style.Name);
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Add the built-in style to the document style collection
+ Dim style As IStyle = document.AddStyle(BuiltinStyle.Heading5)
+ 'Apply the added built-in style to the last paragraph of the document
+ document.LastParagraph.ApplyStyle(style.Name)
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Check whether document has tracked changes
+ if (document.HasChanges)
+ //Accept the changes made to the document
+ document.AcceptChanges();
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Check whether document has tracked changes
+ If document.HasChanges Then
+ 'Accept the changes made to the document
+ document.AcceptChanges()
+ End If
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Check whether document has tracked changes
+ if (document.HasChanges)
+ //Reject the changes made to the document
+ document.RejectChanges();
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Check whether document has tracked changes
+ If document.HasChanges Then
+ 'Reject the changes made to the document
+ document.RejectChanges()
+ End If
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Apply the protection to the document
+ document.Protect(ProtectionType.AllowOnlyComments);
+ //Save and close the document instances
+ document.Save("Sample.docx");
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Apply the protection to the document
+ document.Protect(ProtectionType.AllowOnlyComments)
+ 'Save and close the document instances
+ document.Save("Sample.docx")
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx", "password");
+ //Apply the protection to the document
+ document.Protect(ProtectionType.AllowOnlyComments);
+ //Save and close the document instances
+ document.Save("Sample.docx");
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Apply the protection to the document
+ document.Protect(ProtectionType.AllowOnlyComments, "password")
+ 'Save and close the document instances
+ document.Save("Sample.docx")
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Open an input Word document
+ WordDocument document = new WordDocument("Template.docx");
+ //Encrypt the Word document with a password
+ document.EncryptDocument("password");
+ //Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Open an input Word document
+ Dim document As New WordDocument("Template.docx")
+ 'Encrypt the Word document with a password
+ document.EncryptDocument("password")
+ 'Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Open an input Word document
+ WordDocument document = new WordDocument("Template.docx");
+ //Remove the encryption from document
+ document.RemoveEncryption();
+ //Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Open an input Word document
+ Dim document As New WordDocument("Template.docx")
+ 'Remove the encryption from document
+ document.RemoveEncryption();
+ 'Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Get the collection of bookmark start in the word document
+ List<Entity> items = document.GetCrossReferenceItems(ReferenceType.Bookmark);
+ if (items.Count > 0)
+ //Change the first cross reference items owner paragraph back color as YelloGreen
+ (items[0] as BookmarkStart).OwnerParagraph.ParagraphFormat.BackColor = Color.YellowGreen;
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Get the collection of bookmark start in the word document
+ Dim items As List(Of Entity) = document.GetCrossReferenceItems(ReferenceType.Bookmark)
+ If items.Count > 0 Then
+ 'Change the first cross reference items owner paragraph back color as YelloGreen
+ TryCast(items(0), BookmarkStart).OwnerParagraph.ParagraphFormat.BackColor = Color.YellowGreen
+ End If
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ //Save the document as Text file
+ document.SaveTxt("sample.txt", Encoding.ASCII);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ 'Save the document as Text file
+ document.SaveTxt("sample.txt", Encoding.ASCII)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create an new instance of WordDocument class
+ WordDocument document = new WordDocument();
+ //Open an existing document from file system
+ document.Open("Template.docx");
+ //Saves the specified document
+ document.Save("Sample.docx");
+ //Close the WordDocument instance
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create an new instance of WordDocument class
+ Dim document As New WordDocument()
+ 'Open an existing document from file system
+ document.Open("Template.docx")
+ 'Saves the specified document
+ document.Save("Sample.docx")
+ 'Close the WordDocument instance
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create an new instance of WordDocument class
+ WordDocument document = new WordDocument();
+ //Open an existing document from file system
+ document.Open("Template.docx", FormatType.Docx);
+ //Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the WordDocument instance
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create an new instance of WordDocument class
+ Dim document As New WordDocument()
+ 'Open an existing document from file system
+ document.Open("Template.docx", FormatType.Docx)
+ 'Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the WordDocument instance
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create an new instance of WordDocument class
+ WordDocument document = new WordDocument();
+ //Open an existing document from file system
+ document.Open("Template.docx", FormatType.Docx, XHTMLValidationType.Strict, "basePath");
+ //Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the WordDocument instance
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create an new instance of WordDocument class
+ Dim document As New WordDocument()
+ 'Open an existing document from file system
+ document.Open("Template.docx", FormatType.Docx, "password", XHTMLValidationType.Strict, basePath)
+ 'Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the WordDocument instance
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create an new instance of WordDocument class
+ WordDocument document = new WordDocument();
+ //Open an existing document from file system
+ document.Open("Template.docx", FormatType.Docx, XHTMLValidationType.Strict);
+ //Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the WordDocument instance
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create an new instance of WordDocument class
+ Dim document As New WordDocument()
+ 'Open an existing document from file system
+ document.Open("Template.docx", FormatType.Docx, "password", XHTMLValidationType.Strict)
+ 'Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the WordDocument instance
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create an new instance of WordDocument class
+ WordDocument document = new WordDocument();
+ //Open an existing document from file system
+ document.Open("Template.docx", FormatType.Docx, "password");
+ //Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the WordDocument instance
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create an new instance of WordDocument class
+ Dim document As New WordDocument()
+ 'Open an existing document from file system
+ document.Open("Template.docx", FormatType.Docx, "password")
+ 'Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the WordDocument instance
+ document.Close()
+ End Sub
+
+
+ //Create a new instance of WordDocument class
+ WordDocument document = new WordDocument();
+ //Open an existing document from file system
+ document.OpenReadOnly("Template.docx", FormatType.Docx, "password");
+ //Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the WordDocument instance
+ document.Close();
+
+
+ 'Create a new instance of WordDocument class
+ Dim document As New WordDocument()
+ 'Open an existing document from file system
+ document.OpenReadOnly("Template.docx", FormatType.Docx, "password")
+ 'Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the WordDocument instance
+ document.Close()
+
+
+ //Create a new instance of WordDocument class
+ WordDocument document = new WordDocument();
+ //Open an existing document from file system
+ document.OpenReadOnly("Template.docx", FormatType.Docx, XHTMLValidationType.Strict);
+ //Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the WordDocument instance
+ document.Close();
+
+
+ 'Create a new instance of WordDocument class
+ Dim document As New WordDocument()
+ 'Open an existing document from file system
+ document.OpenReadOnly("Template.docx", FormatType.Docx, XHTMLValidationType.Strict)
+ 'Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the WordDocument instance
+ document.Close()
+
+
+ //Create a new instance of WordDocument class
+ WordDocument document = new WordDocument();
+ //Open an existing document from file system
+ document.OpenReadOnly("Template.docx", FormatType.Docx, XHTMLValidationType.Strict, "basePath");
+ //Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the WordDocument instance
+ document.Close();
+
+
+ 'Create a new instance of WordDocument class
+ Dim document As New WordDocument()
+ 'Open an existing document from file system
+ document.OpenReadOnly("Template.docx", FormatType.Docx, XHTMLValidationType.Strict, basePath)
+ 'Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the WordDocument instance
+ document.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create an new instance of WordDocument class
+ WordDocument document = new WordDocument();
+ //Open an existing document from file system
+ document.Open("Template.docx");
+ //Saves the specified document
+ document.Save("Sample.docx");
+ //Close the WordDocument instance
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create an new instance of WordDocument class
+ Dim document As New WordDocument()
+ 'Open an existing document from file system
+ document.Open("Template.docx")
+ 'Saves the specified document
+ document.Save("Sample.docx")
+ 'Close the WordDocument instance
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create an new instance of WordDocument class
+ WordDocument document = new WordDocument();
+ //Open an existing document from file system
+ document.Open("Template.docx");
+ //Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the WordDocument instance
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create an new instance of WordDocument class
+ Dim document As New WordDocument()
+ 'Open an existing document from file system
+ document.Open("Template.docx")
+ 'Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the WordDocument instance
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ MemoryStream stream = new MemoryStream();
+ //Create the new WPicture for cover page image
+ WPicture coverImage = new WPicture(document);
+ coverImage.LoadImage(Image.FromFile("CoverImage.png"));
+ //Save the document as EPUB
+ document.SaveAsEpub("sample.epub", coverImage);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ Dim stream As New MemoryStream()
+ 'Create the new WPicture for cover page image
+ Dim coverImage As New WPicture(document)
+ coverImage.LoadImage(Image.FromFile("CoverImage.png"))
+ 'Save the document as EPUB
+ document.SaveAsEpub("sample.epub", coverImage)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create an new instance of WordDocument class
+ WordDocument document = new WordDocument();
+ //Open an existing document from file system
+ document.Open("Template.docx");
+ //Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx, HttpContext.Current.Response, HttpContentDisposition.Attachment);
+ //Close the WordDocument instance
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create an new instance of WordDocument class
+ Dim document As New WordDocument()
+ 'Open an existing document from file system
+ document.Open("Template.docx")
+ 'Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx, Response, HttpContentDisposition.Attachment)
+ 'Close the WordDocument instance
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ MemoryStream stream = new MemoryStream();
+ //Create the new WPicture for cover page image
+ WPicture coverImage = new WPicture(document);
+ coverImage.LoadImage(Image.FromFile("CoverImage.png"));
+ //Save the document as EPUB
+ document.SaveAsEpub("sample.epub", coverImage, HttpContext.Current.Response, HttpContentDisposition.Attachment);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ Dim stream As New MemoryStream()
+ 'Create the new WPicture for cover page image
+ Dim coverImage As New WPicture(document)
+ coverImage.LoadImage(Image.FromFile("CoverImage.png"))
+ 'Save the document as EPUB
+ document.SaveAsEpub("sample.epub", coverImage, Response, HttpContentDisposition.Attachment)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create an new instance of WordDocument class
+ WordDocument document = new WordDocument();
+ Stream fileStream = new FileStream("Sample.html", FileMode.Open, FileAccess.Read, FileShare.Read);
+ //Open an existing document from file system
+ document.Open(fileStream, FormatType.Docx, XHTMLValidationType.Strict, "basepath");
+ //Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the WordDocument instance
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create an new instance of WordDocument class
+ Dim document As New WordDocument()
+ Dim fileStream As Stream = New FileStream("Sample.html", FileMode.Open, FileAccess.Read, FileShare.Read)
+ 'Open an existing document from file system
+ document.Open(fileStream, FormatType.Docx, XHTMLValidationType.Strict, basepath)
+ 'Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the WordDocument instance
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create an new instance of WordDocument class
+ WordDocument document = new WordDocument();
+ Stream fileStream = new FileStream("Sample.html", FileMode.Open, FileAccess.Read, FileShare.Read);
+ //Open an existing document from file system
+ document.Open(fileStream, FormatType.Docx, XHTMLValidationType.Strict);
+ //Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the WordDocument instance
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create an new instance of WordDocument class
+ Dim document As New WordDocument()
+ Dim fileStream As Stream = New FileStream("Sample.html", FileMode.Open, FileAccess.Read, FileShare.Read)
+ 'Open an existing document from file system
+ document.Open(fileStream, FormatType.Docx, XHTMLValidationType.Strict)
+ 'Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the WordDocument instance
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create an new instance of WordDocument class
+ WordDocument document = new WordDocument();
+ Stream fileStream = new FileStream("Sample.docx", FileMode.Open, FileAccess.Read, FileShare.Read);
+ //Open an existing document from file system
+ document.Open(fileStream, FormatType.Docx);
+ //Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the WordDocument instance
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create an new instance of WordDocument class
+ Dim document As New WordDocument()
+ Dim fileStream As Stream = New FileStream("Sample.docx", FileMode.Open, FileAccess.Read, FileShare.Read)
+ 'Open an existing document from file system
+ document.Open(fileStream, FormatType.Docx)
+ 'Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the WordDocument instance
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create an new instance of WordDocument class
+ WordDocument document = new WordDocument();
+ Stream fileStream = new FileStream("Sample.docx", FileMode.Open, FileAccess.Read, FileShare.Read);
+ //Open an existing document from file system
+ document.Open(fileStream, FormatType.Docx, "password");
+ //Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the WordDocument instance
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create an new instance of WordDocument class
+ Dim document As New WordDocument()
+ Dim fileStream As Stream = New FileStream("Sample.docx", FileMode.Open, FileAccess.Read, FileShare.Read)
+ 'Open an existing document from file system
+ document.Open(fileStream, FormatType.Docx, "password")
+ 'Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the WordDocument instance
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ MemoryStream stream = new MemoryStream();
+ //Save the document to stream
+ document.Save(stream, FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ Dim stream As New MemoryStream()
+ 'Save the document to stream
+ document.Save(stream, FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument wordDocument = new WordDocument("Template.docx", FormatType.Docx);
+ //Initialize ChartToImageConverter for converting charts during Word to image conversion
+ wordDocument.ChartToImageConverter = new ChartToImageConverter();
+ //Set the scaling mode for charts (Normal mode reduces the file size)
+ wordDocument.ChartToImageConverter.ScalingMode = ScalingMode.Normal;
+ //Convert word document to image
+ Image[] images = wordDocument.RenderAsImages(ImageType.Bitmap);
+ //Close the document
+ wordDocument.Close();
+ int i = 0;
+ foreach (Image image in images)
+ {
+ //Save the images as jpeg
+ image.Save("WordToImage_" + i + ".jpeg", ImageFormat.Jpeg);
+ i++;
+ }
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim wordDocument As New WordDocument("Template.docx", FormatType.Docx)
+ 'Initialize ChartToImageConverter for converting charts during Word to image conversion
+ wordDocument.ChartToImageConverter = New ChartToImageConverter()
+ 'Set the scaling mode for charts (Normal mode reduces the file size)
+ wordDocument.ChartToImageConverter.ScalingMode = ScalingMode.Normal
+ 'Convert word document to image
+ Dim images As Image() = wordDocument.RenderAsImages(ImageType.Bitmap)
+ 'Close the document
+ wordDocument.Close()
+ Dim i As Integer = 0
+ For Each image As Image In images
+ 'Save the images as jpeg
+ image.Save("WordToImage_" & i & ".jpeg", ImageFormat.Jpeg)
+ i += 1
+ Next
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument wordDocument = new WordDocument("Template.docx", FormatType.Docx);
+ //Initialize ChartToImageConverter for converting charts during Word to image conversion
+ wordDocument.ChartToImageConverter = new ChartToImageConverter();
+ //Set the scaling mode for charts (Normal mode reduces the file size)
+ wordDocument.ChartToImageConverter.ScalingMode = ScalingMode.Normal;
+ //Convert word document to stream
+ Stream imageStream = wordDocument.RenderAsImages(2, System.Drawing.Imaging.ImageFormat.Bmp);
+ //Close the document
+ wordDocument.Close();
+ //Convert the stream to Image
+ Image image = Image.FromStream(imageStream);
+ //Save the image as jpeg
+ image.Save("WordToImage.jpeg", ImageFormat.Jpeg);
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim wordDocument As New WordDocument("Template.docx", FormatType.Docx)
+ 'Initialize ChartToImageConverter for converting charts during Word to image conversion
+ wordDocument.ChartToImageConverter = New ChartToImageConverter()
+ 'Set the scaling mode for charts (Normal mode reduces the file size)
+ wordDocument.ChartToImageConverter.ScalingMode = ScalingMode.Normal
+ 'Convert word document to stream
+ Dim imageStream As Stream = wordDocument.RenderAsImages(2, System.Drawing.Imaging.ImageFormat.Bmp)
+ 'Close the document
+ wordDocument.Close()
+ 'Convert the stream to Image
+ Dim image As Image = Image.FromStream(imageStream)
+ 'Save the image as jpeg
+ image.Save("WordToImage.jpeg", ImageFormat.Jpeg)
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument wordDocument = new WordDocument("Template.docx", FormatType.Docx);
+ //Initialize ChartToImageConverter for converting charts during Word to image conversion
+ wordDocument.ChartToImageConverter = new ChartToImageConverter();
+ //Set the scaling mode for charts (Normal mode reduces the file size)
+ wordDocument.ChartToImageConverter.ScalingMode = ScalingMode.Normal;
+ //Convert word document to image
+ Image image = wordDocument.RenderAsImages(2, ImageType.Bitmap);
+ //Close the document
+ wordDocument.Close();
+ //Save the image
+ image.Save("WordToImage.jpeg", ImageFormat.Jpeg);
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim wordDocument As New WordDocument("Template.docx", FormatType.Docx)
+ 'Initialize ChartToImageConverter for converting charts during Word to image conversion
+ wordDocument.ChartToImageConverter = New ChartToImageConverter()
+ 'Set the scaling mode for charts (Normal mode reduces the file size)
+ wordDocument.ChartToImageConverter.ScalingMode = ScalingMode.Normal
+ 'Convert word document to image
+ Dim image As Image = wordDocument.RenderAsImages(2, ImageType.Bitmap)
+ 'Close the document
+ wordDocument.Close()
+ 'Save the images as jpeg
+ image.Save("WordToImage_" & i & ".jpeg", ImageFormat.Jpeg)
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument wordDocument = new WordDocument("Template.docx", FormatType.Docx);
+ //Initialize ChartToImageConverter for converting charts during Word to image conversion
+ wordDocument.ChartToImageConverter = new ChartToImageConverter();
+ //Set the scaling mode for charts (Normal mode reduces the file size)
+ wordDocument.ChartToImageConverter.ScalingMode = ScalingMode.Normal;
+ //Convert word document to image
+ Image[] images = wordDocument.RenderAsImages(0, 2, ImageType.Bitmap);
+ //Close the document
+ wordDocument.Close();
+ int i = 0;
+ foreach (Image image in images)
+ {
+ //Save the images as jpeg
+ image.Save("WordToImage_" + i + ".jpeg", ImageFormat.Jpeg);
+ i++;
+ }
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim wordDocument As New WordDocument("Template.docx", FormatType.Docx)
+ 'Initialize ChartToImageConverter for converting charts during Word to image conversion
+ wordDocument.ChartToImageConverter = New ChartToImageConverter()
+ 'Set the scaling mode for charts (Normal mode reduces the file size)
+ wordDocument.ChartToImageConverter.ScalingMode = ScalingMode.Normal
+ 'Convert word document to image
+ Dim images As Image() = wordDocument.RenderAsImages(0, 2, ImageType.Bitmap)
+ 'Close the document
+ wordDocument.Close()
+ Dim i As Integer = 0
+ For Each image As Image In images
+ 'Save the images as jpeg
+ image.Save("WordToImage_" & i & ".jpeg", ImageFormat.Jpeg)
+ i += 1
+ Next
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Find the first occurrence of a particular text in the document
+ TextSelection textSelection = document.Find(new Regex("panda"));
+ //Get the found text as single text range
+ WTextRange textRange = textSelection.GetAsOneRange();
+ //Modify the text
+ textRange.Text = "Replaced text";
+ //Set highlight color
+ textRange.CharacterFormat.HighlightColor = Color.Yellow;
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Find the first occurrence of a particular text in the document
+ Dim textSelection As TextSelection = document.Find(New Regex("panda"))
+ 'Get the found text as single text range
+ Dim textRange As WTextRange = textSelection.GetAsOneRange()
+ 'Modify the text
+ textRange.Text = "Replaced text"
+ 'Set highlight color
+ textRange.CharacterFormat.HighlightColor = Color.Yellow
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load the template document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ //Find the first occurrence of a particular text extended to several paragraphs in the document
+ TextSelection[] textSelections = document.FindSingleLine(new Regex("First paragraph Second paragraph"));
+ WParagraph paragraph = null;
+ foreach (TextSelection textSelection in textSelections)
+ {
+ //Get the found text as single text range and set highlight color
+ WTextRange textRange = textSelection.GetAsOneRange();
+ textRange.CharacterFormat.HighlightColor = Color.YellowGreen;
+ paragraph = textRange.OwnerParagraph;
+ }
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load the template document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ 'Find the first occurrence of a particular text extended to several paragraphs in the document
+ Dim textSelections As TextSelection() = document.FindSingleLine(new Regex("First paragraph Second paragraph"))
+ Dim paragraph As WParagraph = Nothing
+ For Each textSelection As TextSelection In textSelections
+ 'Get the found text as single text range and set highlight color
+ Dim textRange As WTextRange = textSelection.GetAsOneRange()
+ textRange.CharacterFormat.HighlightColor = Color.YellowGreen
+ paragraph = textRange.OwnerParagraph
+ Next
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Find the first occurrence of a particular text in the document
+ TextSelection textSelection = document.Find("panda", true, true);
+ //Get the found text as single text range
+ WTextRange textRange = textSelection.GetAsOneRange();
+ //Modify the text
+ textRange.Text = "Replaced text";
+ //Set highlight color
+ textRange.CharacterFormat.HighlightColor = Color.Yellow;
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Find the first occurrence of a particular text in the document
+ Dim textSelection As TextSelection = document.Find("panda", true, true)
+ 'Get the found text as single text range
+ Dim textRange As WTextRange = textSelection.GetAsOneRange()
+ 'Modify the text
+ textRange.Text = "Replaced text"
+ 'Set highlight color
+ textRange.CharacterFormat.HighlightColor = Color.Yellow
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load the template document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ //Find the first occurrence of a particular text extended to several paragraphs in the document
+ TextSelection[] textSelections = document.FindSingleLine("First paragraph Second paragraph", true, false);
+ WParagraph paragraph = null;
+ foreach (TextSelection textSelection in textSelections)
+ {
+ //Get the found text as single text range and set highlight color
+ WTextRange textRange = textSelection.GetAsOneRange();
+ textRange.CharacterFormat.HighlightColor = Color.YellowGreen;
+ paragraph = textRange.OwnerParagraph;
+ }
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load the template document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ 'Find the first occurrence of a particular text extended to several paragraphs in the document
+ Dim textSelections As TextSelection() = document.FindSingleLine("First paragraph Second paragraph", True, False)
+ Dim paragraph As WParagraph = Nothing
+ For Each textSelection As TextSelection In textSelections
+ 'Get the found text as single text range and set highlight color
+ Dim textRange As WTextRange = textSelection.GetAsOneRange()
+ textRange.CharacterFormat.HighlightColor = Color.YellowGreen
+ paragraph = textRange.OwnerParagraph
+ Next
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Find the occurrence of the Word "panda" in the document
+ TextSelection[] textSelection = document.FindAll(new Regex("panda"));
+ //Iterate through each occurrence and highlight it
+ foreach (TextSelection selection in textSelection)
+ {
+ IWTextRange textRange = selection.GetAsOneRange();
+ textRange.CharacterFormat.HighlightColor = Color.Yellow;
+ }
+ //Save and Close the document
+ document.Save("Result.docx");
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Find the occurrence of the word "panda" in the document
+ Dim textSelection As TextSelection() = document.FindAll(new Regex("panda"))
+ 'Iterate through each occurrence and highlight it
+ For Each selection As TextSelection In textSelection
+ Dim textRange As IWTextRange = selection.GetAsOneRange()
+ textRange.CharacterFormat.HighlightColor = Color.Yellow
+ Next
+ document.Save("Result.docx")
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Find the occurrence of the Word "panda" in the document
+ TextSelection[] textSelection = document.FindAll("panda", false, true);
+ //Iterate through each occurrence and highlight it
+ foreach (TextSelection selection in textSelection)
+ {
+ IWTextRange textRange = selection.GetAsOneRange();
+ textRange.CharacterFormat.HighlightColor = Color.Yellow;
+ }
+ //Save and Close the document
+ document.Save("Result.docx");
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Find the occurrence of the word "panda" in the document
+ Dim textSelection As TextSelection() = document.FindAll("panda", false, true)
+ 'Iterate through each occurrence and highlight it
+ For Each selection As TextSelection In textSelection
+ Dim textRange As IWTextRange = selection.GetAsOneRange()
+ textRange.CharacterFormat.HighlightColor = Color.Yellow
+ Next
+ document.Save("Result.docx")
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx");
+ //Replace all occurrence of a particular text in the document
+ document.Replace(new Regex("Paragraph"),"paragraph");
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx")
+ 'Replace all occurrence of a particular text in the document
+ document.Replace(New Regex("Paragraph"), "paragraph")
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx");
+ //Replace all occurrence of a particular text in the document
+ document.Replace("Paragraph","paragraph", false, true);
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx")
+ 'Replace all occurrence of a particular text in the document
+ document.Replace("Paragraph", "paragraph", False, True)
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx");
+ //Find the first occurrence of the regular expression
+ TextSelection selection = document.Find(new Regex("Panda"));
+ //Replace all occurrence of a particular regular expression with the text selection in the document
+ document.Replace("Giant panda", selection, true, false);
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx")
+ 'Find the first occurrence of the regular expression
+ Dim selection As TextSelection = document.Find(New Regex("Panda"))
+ 'Replace all occurrence of a particular regular expression with the text selection in the document
+ document.Replace("Giant panda", selection, True, False)
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx");
+ //Find the first occurrence of the regular expression
+ TextSelection selection = document.Find(new Regex("Panda"));
+ //Replace all occurrence of a particular regular expression with the text selection in the document
+ document.Replace("Giant panda", selection, true, false, true);
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx")
+ 'Find the first occurrence of the regular expression
+ Dim selection As TextSelection = document.Find(New Regex("Panda"))
+ 'Replace all occurrence of a particular regular expression with the text selection in the document
+ document.Replace("Giant panda", selection, True, False, False)
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx");
+ //Find the first occurrence of the regular expression
+ TextSelection selection = document.Find(new Regex("Panda"));
+ //Replace all occurrence of a particular regular expression with the text selection in the document
+ document.Replace(new Regex("Giant panda"), selection);
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx")
+ 'Find the first occurrence of the regular expression
+ Dim selection As TextSelection = document.Find(New Regex("Panda"))
+ 'Replace all occurrence of a particular regular expression with the text selection in the document
+ document.Replace(New Regex("Giant panda"), selection)
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx");
+ //Find the first occurrence of the regular expression
+ TextSelection selection = document.Find(new Regex("Panda"));
+ //Replace all occurrence of a particular regular expression with the text selection in the document
+ document.Replace(new Regex("Giant panda"), selection, true);
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx")
+ 'Find the first occurrence of the regular expression
+ Dim selection As TextSelection = document.Find(New Regex("Panda"))
+ 'Replace all occurrence of a particular regular expression with the text selection in the document
+ document.Replace(New Regex("Giant panda"), selection, True)
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx");
+ //Find the first occurrence of the regular expression
+ TextSelection selection = document.Find(new Regex("Panda"));
+ //Initialize text body part
+ TextBodyPart bodyPart = new TextBodyPart(selection);
+ //Replace a particular text with the text body part
+ document.Replace("Giant panda", bodyPart, true, false);
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx")
+ 'Find the first occurrence of the regular expression
+ Dim selection As TextSelection = document.Find(New Regex("Panda"))
+ 'Initialize text body part
+ Dim bodyPart As New TextBodyPart(selection)
+ 'Replace a particular text with the text body part
+ document.Replace("Giant panda", bodyPart, True, False)
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx");
+ //Find the first occurrence of the regular expression
+ TextSelection selection = document.Find(new Regex("Panda"));
+ //Initialize text body part
+ TextBodyPart bodyPart = new TextBodyPart(selection);
+ //Replace a particular text with the text body part
+ document.Replace("Giant panda", bodyPart, true, false, true);
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx")
+ 'Find the first occurrence of the regular expression
+ Dim selection As TextSelection = document.Find(New Regex("Panda"))
+ 'Initialize text body part
+ Dim bodyPart As New TextBodyPart(selection)
+ 'Replace a particular text with the text body part
+ document.Replace("Giant panda", bodyPart, True, False, True)
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx");
+ //Find the first occurrence of the regular expression
+ TextSelection selection = document.Find(new Regex("Panda"));
+ //Initialize text body part
+ TextBodyPart bodyPart = new TextBodyPart(selection);
+ //Replace a particular text with the text body part
+ document.Replace(new Regex("Giant panda"), bodyPart);
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx")
+ 'Find the first occurrence of the regular expression
+ Dim selection As TextSelection = document.Find(New Regex("Panda"))
+ 'Initialize text body part
+ Dim bodyPart As New TextBodyPart(selection)
+ 'Replace a particular text with the text body part
+ document.Replace(New Regex("Giant panda"), bodyPart)
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx");
+ //Find the first occurrence of the regular expression
+ TextSelection selection = document.Find(new Regex("Panda"));
+ //Initialize text body part
+ TextBodyPart bodyPart = new TextBodyPart(selection);
+ //Replace a particular text with the text body part
+ document.Replace(new Regex("Giant panda"), bodyPart, true);
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx")
+ 'Find the first occurrence of the regular expression
+ Dim selection As TextSelection = document.Find(New Regex("Panda"))
+ 'Initialize text body part
+ Dim bodyPart As New TextBodyPart(selection)
+ 'Replace a particular text with the text body part
+ document.Replace(New Regex("Giant panda"), bodyPart, True)
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx");
+ //Load the another existing Word document to replace
+ WordDocument replaceDocument = new WordDocument("Replace.docx");
+ //Replace all occurrence of a particular regular expression with the another document and close the document
+ document.Replace("Giant panda", replaceDocument, true, false);
+ replaceDocument.Close();
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx")
+ 'Load the another existing Word document to replace
+ Dim replaceDocument As New WordDocument("Replace.docx")
+ 'Replace all occurrence of a particular regular expression with the another document and close the document
+ document.Replace("Giant panda", replaceDocument, True, False)
+ replaceDocument.Close();
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx");
+ //Load the another existing Word document to replace
+ WordDocument replaceDocument = new WordDocument("Replace.docx");
+ //Replace all occurrence of a particular regular expression with the another document and close the document
+ document.Replace("Giant panda", replaceDocument, true, false, true);
+ replaceDocument.Close();
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx")
+ 'Load the another existing Word document to replace
+ Dim replaceDocument As New WordDocument("Replace.docx")
+ 'Replace all occurrence of a particular regular expression with the another document and close the document
+ document.Replace("Giant panda", replaceDocument, True, False, True)
+ replaceDocument.Close();
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx");
+ //Load the another existing Word document to replace
+ WordDocument replaceDocument = new WordDocument("Replace.docx");
+ //Replace all occurrence of a particular regular expression with the another document and close the document
+ document.Replace(new Regex("Giant panda"), replaceDocument, true);
+ replaceDocument.Close();
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx")
+ 'Load the another existing Word document to replace
+ Dim replaceDocument As New WordDocument("Replace.docx")
+ 'Replace all occurrence of a particular regular expression with the another document and close the document
+ document.Replace(New Regex("Giant panda"), replaceDocument, True)
+ replaceDocument.Close();
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ //Open an input word template
+ IWordDocument document = new WordDocument(@"Template.docx");
+ //Update the Paragraphs count, Word count and Character count in the document
+ document.UpdateWordCount();
+ //Save and close the Word document instance.
+ document.Save("Output.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ 'Open an input word template
+ Dim document As New IWordDocument("Template.docx")
+ 'Update the Paragraphs count, Word count and Character count in the document.
+ document.UpdateWordCount()
+ �Save and close the Word document instance.
+ document.Save("Output.docx", FormatType.Docx)
+ document.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Open an input word template
+ WordDocument document = new WordDocument(@"Template.docx");
+ //Update the Page count, Paragraphs count, Word count and Character count in the document
+ document.UpdateWordCount(true);
+ //Save and close the Word document instance.
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Open an input word template
+ Dim document As New WordDocument("Template.docx")
+ 'Update the Page count, Paragraphs count, Word count and Character count in the document.
+ document.UpdateWordCount(True)
+ �Save and close the Word document instance.
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Input.docx", FormatType.Docx);
+ //Updates the fields present in a document.
+ document.UpdateDocumentFields();
+ document.Save("Result.docx", FormatType.Docx);
+ document.Close();
+
+
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Input.docx", FormatType.Docx)
+ 'Updates the fields present in a document.
+ document.UpdateDocumentFields()
+ document.Save("Result.docx", FormatType.Docx)
+ document.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Input.docx", FormatType.Docx);
+ //Updates the Alternate chunks present in a document.
+ document.UpdateAlternateChunks();
+ document.Save("Result.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Input.docx", FormatType.Docx)
+ 'Updates the Alternate chunks present in a document.
+ document.UpdateAlternateChunks()
+ document.Save("Result.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ //Open an input word template
+ WordDocument document = new WordDocument(@"Template.docx");
+ //Update the table of contents.
+ document.UpdateTableOfContents();
+ //Save and close the Word document instance.
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+
+
+ 'Open an input word template
+ Dim document As New WordDocument("Template.docx")
+ 'Update the table of contents.
+ document.UpdateTableOfContents()
+ 'Save and close the Word document instance.
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load a template document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ //Replace the text extended to two paragraphs with simple text
+ document.ReplaceSingleLine("First paragraph Second paragraph", "Replaced paragraph", true, false);
+ //Save and close the document
+ document.Save("Replace.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load a template document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ 'Replace the text extended to two paragraphs with simple text
+ document.ReplaceSingleLine("First paragraph Second paragraph", "Replaced paragraph", True, False)
+ 'Save and close the document
+ document.Save("Replace.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load a template document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ //Replace the text extended to two paragraphs with simple text
+ document.ReplaceSingleLine(new Regex("First paragraph Second paragraph"), "Replaced paragraph");
+ //Save and close the document
+ document.Save("Replace.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load a template document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ 'Replace the text extended to two paragraphs with simple text
+ document.ReplaceSingleLine(New Regex("First paragraph Second paragraph"), "Replaced paragraph")
+ 'Save and close the document
+ document.Save("Replace.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load a template document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ //Find the first occurrence of a particular text in the document
+ TextSelection selection = document.Find("contents", false, false);
+ //Replace the text extended to two paragraphs with text selection
+ document.ReplaceSingleLine("First paragraph Second paragraph", selection, true, false);
+ //Save and close the document
+ document.Save("Replace.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load a template document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ 'Find the first occurrence of a particular text in the document
+ Dim selection As TextSelection = document.Find("contents", False, False)
+ 'Replace the text extended to two paragraphs with text selection
+ document.ReplaceSingleLine("First paragraph Second paragraph", selection, True, False)
+ 'Save and close the document
+ document.Save("Replace.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load a template document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ //Find the first occurrence of a particular text in the document
+ TextSelection selection = document.Find("contents", false, false);
+ //Replace the text extended to two paragraphs with text selection
+ document.ReplaceSingleLine(new Regex("First paragraph Second paragraph"), selection);
+ //Save and close the document
+ document.Save("Replace.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load a template document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ 'Find the first occurrence of a particular text in the document
+ Dim selection As TextSelection = document.Find("contents", False, False)
+ 'Replace the text extended to two paragraphs with text selection
+ document.ReplaceSingleLine(New Regex("First paragraph Second paragraph"), selection)
+ 'Save and close the document
+ document.Save("Replace.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load a template document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ //Find the first occurrence of a particular text in the document
+ TextSelection selection = document.Find("contents", false, false);
+ //Initialize text body part
+ TextBodyPart bodyPart = new TextBodyPart(selection);
+ //Replace a particular text with the text body part
+ document.ReplaceSingleLine("First paragraph Second paragraph", bodyPart, true, false);
+ //Save and close the document
+ document.Save("Replace.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load a template document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ 'Find the first occurrence of a particular text in the document
+ Dim selection As TextSelection = document.Find("contents", False, False)
+ 'Initialize text body part
+ Dim bodyPart As New TextBodyPart(selection)
+ 'Replace a particular text with the text body part
+ document.ReplaceSingleLine("First paragraph Second paragraph", bodyPart, True, False)
+ 'Save and close the document
+ document.Save("Replace.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load a template document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ //Find the first occurrence of a particular text in the document
+ TextSelection selection = document.Find("contents", false, false);
+ //Initialize text body part
+ TextBodyPart bodyPart = new TextBodyPart(selection);
+ //Replace a particular text with the text body part
+ document.ReplaceSingleLine(new Regex("First paragraph Second paragraph"), bodyPart);
+ //Save and close the document
+ document.Save("Replace.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load a template document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ 'Find the first occurrence of a particular text in the document
+ Dim selection As TextSelection = document.Find("contents", False, False)
+ 'Initialize text body part
+ Dim bodyPart As New TextBodyPart(selection)
+ 'Replace a particular text with the text body part
+ document.ReplaceSingleLine(New Regex("First paragraph Second paragraph"), bodyPart)
+ 'Save and close the document
+ document.Save("Replace.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load the template document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ //Find the first occurrence of a particular text in the document
+ TextSelection textSelection = document.Find("as graphical contents", false, true);
+ //Get the found text as single text range
+ WTextRange textRange = textSelection.GetAsOneRange();
+ //Modify the text
+ textRange.Text = "Replaced text";
+ //Set highlight color
+ textRange.CharacterFormat.HighlightColor = Color.Yellow;
+ //Find the next occurrence of a particular text from the previous paragraph
+ textSelection = document.FindNext(textRange.OwnerParagraph, "paragraph", true, false);
+ //Get the found text as single text range
+ WTextRange range = textSelection.GetAsOneRange();
+ //Set bold formatting
+ range.CharacterFormat.Bold = true;
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load the template document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ 'Find the first occurrence of a particular text in the document
+ Dim textSelection As TextSelection = document.Find("as graphical contents", false, true)
+ 'Get the found text as single text range
+ Dim textRange As WTextRange = textSelection.GetAsOneRange()
+ 'Modify the text
+ textRange.Text = "Replaced text"
+ 'Set highlight color
+ textRange.CharacterFormat.HighlightColor = Color.Yellow
+ 'Find the next occurrence of a particular text from the previous paragraph
+ textSelection = document.FindNext(textRange.OwnerParagraph, "paragraph", true, false)
+ 'Get the found text as single text range
+ Dim range As WTextRange = textSelection.GetAsOneRange()
+ 'Set bold formatting
+ range.CharacterFormat.Bold = True
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load the template document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ //Find the first occurrence of a particular text in the document
+ TextSelection textSelection = document.Find(new Regex("as graphical contents"));
+ //Get the found text as single text range
+ WTextRange textRange = textSelection.GetAsOneRange();
+ //Modify the text
+ textRange.Text = "Replaced text";
+ //Set highlight color
+ textRange.CharacterFormat.HighlightColor = Color.Yellow;
+ //Find the next occurrence of a particular text from the previous paragraph
+ textSelection = document.FindNext(textRange.OwnerParagraph, new Regex("paragraph"));
+ //Get the found text as single text range
+ WTextRange range = textSelection.GetAsOneRange();
+ //Set bold formatting
+ range.CharacterFormat.Bold = true;
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load the template document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ 'Find the first occurrence of a particular text in the document
+ Dim textSelection As TextSelection = document.Find("as graphical contents")
+ 'Get the found text as single text range
+ Dim textRange As WTextRange = textSelection.GetAsOneRange()
+ 'Modify the text
+ textRange.Text = "Replaced text"
+ 'Set highlight color
+ textRange.CharacterFormat.HighlightColor = Color.Yellow
+ 'Find the next occurrence of a particular text from the previous paragraph
+ textSelection = document.FindNext(textRange.OwnerParagraph, "paragraph")
+ 'Get the found text as single text range
+ Dim range As WTextRange = textSelection.GetAsOneRange()
+ 'Set bold formatting
+ range.CharacterFormat.Bold = True
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load the template document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ //Find the first occurrence of a particular text extended to several paragraphs in the document
+ TextSelection[] textSelections = document.FindSingleLine("First paragraph Second paragraph", true, false);
+ WParagraph paragraph = null;
+ foreach (TextSelection textSelection in textSelections)
+ {
+ //Get the found text as single text range and set highlight color
+ WTextRange textRange = textSelection.GetAsOneRange();
+ textRange.CharacterFormat.HighlightColor = Color.YellowGreen;
+ paragraph = textRange.OwnerParagraph;
+ }
+ //Find the next occurrence of a particular text extended to several paragraphs in the document
+ textSelections = document.FindNextSingleLine(paragraph, "First paragraph Second paragraph", true, false);
+ foreach (TextSelection textSelection in textSelections)
+ {
+ //Get the found text as single text range and set italic formatting
+ WTextRange text = textSelection.GetAsOneRange();
+ text.CharacterFormat.Italic = true;
+ }
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load the template document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ 'Find the first occurrence of a particular text extended to several paragraphs in the document
+ Dim textSelections As TextSelection() = document.FindSingleLine("First paragraph Second paragraph", True, False)
+ Dim paragraph As WParagraph = Nothing
+ For Each textSelection As TextSelection In textSelections
+ 'Get the found text as single text range and set highlight color
+ Dim textRange As WTextRange = textSelection.GetAsOneRange()
+ textRange.CharacterFormat.HighlightColor = Color.YellowGreen
+ paragraph = textRange.OwnerParagraph
+ Next
+ 'Find the next occurrence of a particular text extended to several paragraphs in the document
+ textSelections = document.FindNextSingleLine(paragraph, "First paragraph Second paragraph", True, False)
+ For Each textSelection As TextSelection In textSelections
+ 'Get the found text as single text range and set italic formatting
+ Dim text As WTextRange = textSelection.GetAsOneRange()
+ text.CharacterFormat.Italic = True
+ Next
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load the template document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ //Find the first occurrence of a particular text extended to several paragraphs in the document
+ TextSelection[] textSelections = document.FindSingleLine("First paragraph Second paragraph", true, false);
+ WParagraph paragraph = null;
+ foreach (TextSelection textSelection in textSelections)
+ {
+ //Get the found text as single text range and set highlight color
+ WTextRange textRange = textSelection.GetAsOneRange();
+ textRange.CharacterFormat.HighlightColor = Color.YellowGreen;
+ paragraph = textRange.OwnerParagraph;
+ }
+ //Find the next occurrence of a particular text extended to several paragraphs in the document
+ textSelections = document.FindNextSingleLine(paragraph, new Regex("First paragraph Second paragraph"));
+ foreach (TextSelection textSelection in textSelections)
+ {
+ //Get the found text as single text range and set italic formatting
+ WTextRange text = textSelection.GetAsOneRange();
+ text.CharacterFormat.Italic = true;
+ }
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load the template document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ 'Find the first occurrence of a particular text extended to several paragraphs in the document
+ Dim textSelections As TextSelection() = document.FindSingleLine("First paragraph Second paragraph", True, False)
+ Dim paragraph As WParagraph = Nothing
+ For Each textSelection As TextSelection In textSelections
+ 'Get the found text as single text range and set highlight color
+ Dim textRange As WTextRange = textSelection.GetAsOneRange()
+ textRange.CharacterFormat.HighlightColor = Color.YellowGreen
+ paragraph = textRange.OwnerParagraph
+ Next
+ 'Find the next occurrence of a particular text extended to several paragraphs in the document
+ textSelections = document.FindNextSingleLine(paragraph, new Regex("First paragraph Second paragraph"))
+ For Each textSelection As TextSelection In textSelections
+ 'Get the found text as single text range and set italic formatting
+ Dim text As WTextRange = textSelection.GetAsOneRange()
+ text.CharacterFormat.Italic = True
+ Next
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load the document with macros
+ WordDocument document = new WordDocument("Sample.docm");
+ //Check whether the document has macros and remove them
+ if (document.HasMacros)
+ document.RemoveMacros();
+ //Save the document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load the document with macros
+ Dim document As New WordDocument("Sample.docm")
+ 'Check whether the document has macros and remove them
+ If document.HasMacros Then
+ document.RemoveMacros()
+ End If
+ 'Save the document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument wordDocument = new WordDocument("Template.docx", FormatType.Docx);
+ //Initialize ChartToImageConverter for converting charts during Word to pdf conversion
+ wordDocument.ChartToImageConverter = new ChartToImageConverter();
+ //Create an instance of DocToPDFConverter
+ DocToPDFConverter converter = new DocToPDFConverter();
+ //Convert Word document into PDF document
+ PdfDocument pdfDocument = converter.ConvertToPDF(wordDocument);
+ //Close the instance of Word document object
+ wordDocument.Close();
+ //Save the PDF file
+ pdfDocument.Save("WordtoPDF.pdf");
+ //Close the instance of PDF document object
+ pdfDocument.Close(true);
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim wordDocument As New WordDocument("Template.docx", FormatType.Docx)
+ 'Initialize ChartToImageConverter for converting charts during Word to pdf conversion
+ /// wordDocument.ChartToImageConverter = New ChartToImageConverter()
+ 'Create an instance of DocToPDFConverter
+ Dim converter As New DocToPDFConverter()
+ 'Convert Word document into PDF document
+ Dim pdfDocument As PdfDocument = converter.ConvertToPDF(wordDocument)
+ 'Close the instance of document object
+ wordDocument.Close()
+ 'Save the PDF file
+ pdfDocument.Save("WordtoPDF.pdf")
+ 'Close the instance of document object
+ pdfDocument.Close(True)
+ End Sub
+
+
+ // Loads an existing Word document.
+ WordDocument wordDocument = new WordDocument("template.docx", FormatType.Docx);
+ // Initializes the SubstituteFont event to perform font substitution during Word to PDF conversion.
+ wordDocument.FontSettings.SubstituteFont += new SubstituteFontEventHandler(SubstituteFont);
+ // Creates an instance of DocToPDFConverter.
+ DocToPDFConverter converter = new DocToPDFConverter();
+ // Converts the Word document into PDF document.
+ PdfDocument pdfDocument = converter.ConvertToPDF(wordDocument);
+ // Closes the instance of Word document object.
+ wordDocument.Close();
+ // Saves the PDF file.
+ pdfDocument.Save("WordtoPDF.pdf");
+ // Closes the instance of PDF document object.
+ pdfDocument.Close(true);
+
+ private void SubstituteFont(object sender, SubstituteFontEventArgs args)
+ {
+ // Sets the alternate font when a specified font is not installed in the production environment.
+ if (args.OrignalFontName == "Arial Unicode MS")
+ args.AlternateFontName = "Arial";
+ else
+ args.AlternateFontName = "Times New Roman";
+ }
+
+
+ ' Loads an existing Word document.
+ Dim wordDocument As New WordDocument("template.docx", FormatType.Docx)
+ ' Initializes the SubstituteFont event to perform font substitution during Word to PDF conversion.
+ AddHandler wordDocument.FontSettings.SubstituteFont, AddressOf SubstituteFont
+ ' Creates an instance of DocToPDFConverter.
+ Dim converter As New DocToPDFConverter()
+ ' Converts the Word document into PDF document.
+ Dim pdfDocument As PdfDocument = converter.ConvertToPDF(wordDocument)
+ ' Closes the instance of document object.
+ wordDocument.Close()
+ ' Saves the PDF file .
+ pdfDocument.Save("WordtoPDF.pdf")
+ ' Closes the instance of document object.
+ pdfDocument.Close(True)
+
+ Private Sub SubstituteFont(ByVal sender As Object, ByVal args As SubstituteFontEventArgs)
+ ' Sets the alternate font when a specified font is not installed in the production environment.
+ If args.OrignalFontName = "Arial Unicode MS" Then
+ args.AlternateFontName = "Arial"
+ Else
+ args.AlternateFontName = "Times New Roman"
+ End If
+ End Sub
+
+
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Retrieve the last section of the document and add new paragraph
+ document.LastSection.AddParagraph().AppendText("Adding new paragraph to the document");
+ //Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+
+
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Retrieve the last section of the document and add new paragraph
+ document.LastSection.AddParagraph().AppendText("Adding new paragraph to the document")
+ 'Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Set the last paragraph back color as Blue
+ document.LastParagraph.ParagraphFormat.BackColor = Color.Blue;
+ //Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Set the last paragraph back color as Blue
+ document.LastParagraph.ParagraphFormat.BackColor = Color.Blue
+ 'Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Set the endnote format
+ document.EndnoteNumberFormat = FootEndNoteNumberFormat.Arabic;
+ //Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Set the endnote format
+ document.EndnoteNumberFormat = FootEndNoteNumberFormat.Arabic
+ 'Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Set the footnote number format
+ document.FootnoteNumberFormat = FootEndNoteNumberFormat.UpperCaseRoman;
+ //Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Set the footnote number format
+ document.FootnoteNumberFormat = FootEndNoteNumberFormat.UpperCaseRoman
+ 'Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Set the endnote restart index number
+ document.RestartIndexForEndnote = EndnoteRestartIndex.RestartForEachSection;
+ //Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Set the endnote restart index number
+ document.RestartIndexForEndnote = EndnoteRestartIndex.RestartForEachSection
+ 'Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Set the endnote position at end of each section
+ document.EndnotePosition = EndnotePosition.DisplayEndOfSection;
+ //Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Set the endnote position at end of each section
+ document.EndnotePosition = EndnotePosition.DisplayEndOfSection
+ 'Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Set the footnote restart index number
+ document.RestartIndexForFootnotes = FootnoteRestartIndex.RestartForEachPage;
+ //Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Set the footnote restart index number
+ document.RestartIndexForFootnotes = FootnoteRestartIndex.RestartForEachPage
+ 'Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Set the footnote position at immediately beneath text
+ document.FootnotePosition = FootnotePosition.PrintImmediatelyBeneathText;
+ //Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Set the footnote position at immediately beneath text
+ document.FootnotePosition = FootnotePosition.PrintImmediatelyBeneathText
+ 'Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //protect the document from editing
+ document.ProtectionType = Syncfusion.DocIO.ProtectionType.AllowOnlyReading;
+ //Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'protect the document from editing
+ document.ProtectionType = Syncfusion.DocIO.ProtectionType.AllowOnlyReading
+ 'Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Set the footnote initial number
+ document.InitialFootnoteNumber = 3;
+ //Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Set the footnote initial number
+ document.InitialFootnoteNumber = 3
+ 'Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Set the endnote initial number
+ document.InitialEndnoteNumber = 5;
+ //Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Set the endnote initial number
+ document.InitialEndnoteNumber = 5
+ 'Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ WordDocument document = new WordDocument();
+ IWSection section = document.AddSection();
+ IWParagraph paragraph = section.AddParagraph();
+ paragraph.AppendText("First Name of the customer: ");
+ //Add the DocVariable field with Variable name and its type
+ paragraph.AppendField("FirstName", FieldType.FieldDocVariable);
+ paragraph = section.AddParagraph();
+ paragraph.AppendText("Last Name of the customer: ");
+ //Add the DocVariable field with Variable name and its type
+ paragraph.AppendField("LastName", FieldType.FieldDocVariable);
+ //Add the value for variable in WordDocument.Variable collection
+ document.Variables.Add("FirstName", "Jeff");
+ document.Variables.Add("LastName", "Smith");
+ //Update the document fields
+ document.UpdateDocumentFields();
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ Dim document As New WordDocument()
+ Dim section As IWSection = document.AddSection()
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ paragraph.AppendText("First Name of the customer: ")
+ 'Add the DocVariable field with Variable name and its type
+ paragraph.AppendField("FirstName", FieldType.FieldDocVariable)
+ paragraph = section.AddParagraph()
+ paragraph.AppendText("Last Name of the customer: ")
+ 'Add the DocVariable field with Variable name and its type
+ paragraph.AppendField("LastName", FieldType.FieldDocVariable)
+ 'Add the value for variable in WordDocument.Variable collection
+ document.Variables.Add("FirstName", "Jeff")
+ document.Variables.Add("LastName", "Smith")
+ 'Update the document fields
+ document.UpdateDocumentFields()
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Enable the TrackChanges to track the edits as revision
+ document.TrackChanges = true;
+ //Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Enable the TrackChanges to track the edits as revision
+ document.TrackChanges = True
+ 'Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load a template document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ //Set to replace only the first occurrence of a particular text
+ document.ReplaceFirst = true;
+ //Find the first occurrence of a particular text in the document
+ TextSelection selection = document.Find("contents", false, false);
+ //Initialize text body part
+ TextBodyPart bodyPart = new TextBodyPart(selection);
+ //Replace a particular text with the text body part
+ document.Replace("paragraph", bodyPart, false, true, true);
+ //Save and close the document
+ document.Save("Replace.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load a template document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ 'Set to replace only the first occurrence of a particular text
+ document.ReplaceFirst = True
+ 'Find the first occurrence of a particular text in the document
+ Dim selection As TextSelection = document.Find("contents", False, False)
+ 'Initialize text body part
+ Dim bodyPart As New TextBodyPart(selection)
+ 'Replace a particular text with the text body part
+ document.Replace("paragraph", bodyPart, False, True, True)
+ 'Save and close the document
+ document.Save("Replace.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ //Creates an new instance of WordDocument class.
+ WordDocument srcDocument = new WordDocument("SourceTemplate.docx");
+ // Creates an new instance of WordDocument class.
+ WordDocument destDocument = new WordDocument("DestinationTemplate.docx");
+ //Import the contents of source document at the end of destination document with destination styles.
+ destDocument.ImportOptions = ImportOptions.UseDestinationStyles;
+ destDocument.Sections.Add(srcDocument.LastSection.Clone());
+ // Releases the resources occupied by WordDocument instance.
+ srcDocument.Close();
+ // Saves the document in the given name and format.
+ destDocument.Save("Document.docx", FormatType.Docx);
+ // Releases the resources occupied by WordDocument instance.
+ destDocument.Close();
+
+
+ 'Creates an new instance of WordDocument class.
+ Dim srcDocument As New WordDocument("SourceTemplate.docx")
+ ' Creates an new instance of WordDocument class.
+ Dim destDocument As New WordDocument("DestinationTemplate.docx")
+ 'Import the contents of source document at the end of destination document with destination styles.
+ destDocument.ImportOptions = ImportOptions.UseDestinationStyles
+ destDocument.Sections.Add(srcDocument.LastSection.Clone())
+ ' Releases the resources occupied by WordDocument instance.
+ srcDocument.Close()
+ ' Saves the document in the given name and format.
+ destDocument.Save("Document.docx", FormatType.Docx)
+ ' Releases the resources occupied by WordDocument instance.
+ destDocument.Close()
+
+
+ // Creates an new instance of WordDocument class.
+ WordDocument srcDocument = new WordDocument();
+ // Adds a section and a paragraph in the empty document.
+ srcDocument.EnsureMinimal();
+ // Sets bold to character format of "Normal" style to differentiate source and destination document.
+ (srcDocument.Styles.FindByName("Normal") as WParagraphStyle).CharacterFormat.Bold = true;
+ // Creates an new instance of WordDocument class.
+ WordDocument destDocument = new WordDocument();
+ // Adds a section and a paragraph in the empty document.
+ destDocument.EnsureMinimal();
+ // Sets false value to exclude importing duplicate styles to destination document.
+ destDocument.ImportStyles = false;
+ destDocument.Sections.Add(srcDocument.LastSection.Clone());
+ // Releases the resources occupied by WordDocument instance.
+ srcDocument.Close();
+ // Saves the document in the given name and format.
+ destDocument.Save("Document.docx", FormatType.Docx);
+ // Releases the resources occupied by WordDocument instance.
+ destDocument.Close();
+
+
+ ' Creates an new instance of WordDocument class.
+ Dim srcDocument As New WordDocument()
+ ' Adds a section and a paragraph in the empty document.
+ srcDocument.EnsureMinimal()
+ ' Sets bold to character format of "Normal" style to differentiate source and destination document.
+ TryCast(srcDocument.Styles.FindByName("Normal"), WParagraphStyle).CharacterFormat.Bold = True
+ ' Creates an new instance of WordDocument class.
+ Dim destDocument As New WordDocument()
+ ' Adds a section and a paragraph in the empty document.
+ destDocument.EnsureMinimal()
+ ' Sets false value to exclude importing duplicate styles to destination document.
+ destDocument.ImportStyles = False
+ destDocument.Sections.Add(srcDocument.LastSection.Clone())
+ ' Releases the resources occupied by WordDocument instance.
+ srcDocument.Close()
+ ' Saves the document in the given name and format.
+ destDocument.Save("Document.docx", FormatType.Docx)
+ ' Releases the resources occupied by WordDocument instance.
+ destDocument.Close()
+
+
+ // Creates an new instance of WordDocument class.
+ WordDocument srcDocument = new WordDocument();
+ // Adds a section and a paragraph in the empty document.
+ srcDocument.EnsureMinimal();
+ // Creates a paragraph style (with name "Test") and adds into source document.
+ WParagraphStyle paragraphStyle = new WParagraphStyle(srcDocument);
+ paragraphStyle.Name = "Test";
+ srcDocument.Styles.Add(paragraphStyle);
+ // Creates an new instance of WordDocument class.
+ WordDocument destDocument = new WordDocument();
+ // Adds a section and a paragraph in the empty document.
+ destDocument.EnsureMinimal();
+ // Creates a character style (with same paragraph styel name in source) and adds into destination document.
+ WCharacterStyle characterStyle = new WCharacterStyle(destDocument);
+ characterStyle.Name = "Test";
+ destDocument.Styles.Add(characterStyle);
+ // Sets true value to include importing duplicate styles (mismatched with types) to destination document.
+ destDocument.ImportStylesOnTypeMismatch = true;
+ destDocument.Sections.Add(srcDocument.LastSection.Clone());
+ // Releases the resources occupied by WordDocument instance.
+ srcDocument.Close();
+ // Saves the document in the given name and format.
+ destDocument.Save("Document.docx", FormatType.Docx);
+ // Releases the resources occupied by WordDocument instance.
+ destDocument.Close();
+
+
+ ' Creates an new instance of WordDocument class.
+ Dim srcDocument As New WordDocument()
+ ' Adds a section and a paragraph in the empty document.
+ srcDocument.EnsureMinimal()
+ ' Creates a paragraph style (with name "Test") and adds into source document.
+ Dim paragraphStyle As New WParagraphStyle(srcDocument)
+ paragraphStyle.Name = "Test"
+ srcDocument.Styles.Add(paragraphStyle)
+ ' Creates an new instance of WordDocument class.
+ Dim destDocument As New WordDocument()
+ ' Adds a section and a paragraph in the empty document.
+ destDocument.EnsureMinimal()
+ ' Creates a character style (with same paragraph styel name in source) and adds into destination document.
+ Dim characterStyle As New WCharacterStyle(destDocument)
+ characterStyle.Name = "Test"
+ destDocument.Styles.Add(characterStyle)
+ ' Sets true value to include importing duplicate styles (mismatched with types) to destination document.
+ destDocument.ImportStylesOnTypeMismatch = True
+ destDocument.Sections.Add(srcDocument.LastSection.Clone())
+ ' Releases the resources occupied by WordDocument instance.
+ srcDocument.Close()
+ ' Saves the document in the given name and format.
+ destDocument.Save("Document.docx", FormatType.Docx)
+ ' Releases the resources occupied by WordDocument instance.
+ destDocument.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Apply the Arial font instead of the Arabic font, if the system does not contains Arabic font
+ document.FontSubstitutionTable.Add("Arabic", "Arial");
+ //Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Apply the Arial font instead of the Arabic font, if the system does not contains Arabic font
+ document.FontSubstitutionTable.Add("Arabic", "Arial");
+ 'Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ //Loads an existing Word document
+ WordDocument wordDocument = new WordDocument("Template.docx", FormatType.Docx);
+ //Sets revision types to preserve track changes in PDF conversion.
+ wordDocument.RevisionOptions.ShowMarkup = RevisionType.Insertions | RevisionType.Formatting | RevisionType.Deletions;
+ //Instantiation of DocToPDFConverter for Word to PDF conversion
+ DocToPDFConverter converter = new DocToPDFConverter();
+ //Converts Word document into PDF document
+ PdfDocument pdfDocument = converter.ConvertToPDF(wordDocument);
+ //Saves the PDF file
+ pdfDocument.Save("WordtoPDF.pdf");
+ //Releases all resources used by the object
+ converter.Dispose();
+ //Closes the instance of document objects
+ wordDocument.Close();
+ pdfDocument.Close(true);
+
+
+ 'Loads an existing Word document
+ Dim wordDocument As WordDocument = New WordDocument("Template.docx", FormatType.Docx)
+ 'Sets revision types to preserve track changes in PDF conversion.
+ wordDocument.RevisionOptions.ShowMarkup = RevisionType.Insertions Or RevisionType.Formatting Or RevisionType.Deletions
+ 'Instantiation of DocToPDFConverter for Word to PDF conversion
+ Dim converter As DocToPDFConverter = New DocToPDFConverter
+ 'Converts Word document into PDF document
+ Dim pdfDocument As PdfDocument = converter.ConvertToPDF(wordDocument)
+ 'Saves the PDF file
+ pdfDocument.Save("WordtoPDF.pdf")
+ 'Releases all resources used by the object
+ converter.Dispose()
+ 'Closes the instance of document objects
+ wordDocument.Close()
+ pdfDocument.Close(True)
+
+
+ //Load an existing Word document into WordDocument instance
+ WordDocument document = new WordDocument("Sample.docx");
+ //Add a new simple paragraph into the last section of the document
+ IWParagraph paragraph = document.LastSection.AddParagraph();
+ //Add a text range into the paragraph
+ paragraph.AppendText("Hello World!");
+ //Save the document in the given name and format
+ document.Save("Document.docx", FormatType.Docx);
+ //Release the resources occupied by WordDocument instance
+ document.Close();
+
+
+ 'Load an existing Word document into WordDocument instance
+ Dim document As New WordDocument("Sample.docx")
+ 'Add a new simple paragraph into the last section of the document
+ Dim paragraph As IWParagraph = document.LastSection.AddParagraph()
+ 'Add a text range into the paragraph
+ paragraph.AppendText("Hello World!")
+ 'Save the document in the given name and format
+ document.Save("Document.docx", FormatType.Docx)
+ 'Release the resources occupied by WordDocument instance
+ document.Close()
+
+
+ //Load an existing Word document into WordDocument instance
+ WordDocument document = new WordDocument("Sample.docx", "password");
+ //Add a new simple paragraph into the last section of the document
+ IWParagraph paragraph = document.LastSection.AddParagraph();
+ //Add a text range into the paragraph
+ paragraph.AppendText("Hello World!");
+ //Save the document in the given name and format
+ document.Save("Document.docx", FormatType.Docx);
+ //Release the resources occupied by WordDocument instance
+ document.Close();
+
+
+ 'Load an existing Word document into WordDocument instance
+ Dim document As New WordDocument("Sample.docx", "password")
+ 'Add a new simple paragraph into the last section of the document
+ Dim paragraph As IWParagraph = document.LastSection.AddParagraph()
+ 'Add a text range into the paragraph
+ paragraph.AppendText("Hello World!")
+ 'Save the document in the given name and format
+ document.Save("Document.docx", FormatType.Docx)
+ 'Release the resources occupied by WordDocument instance
+ document.Close()
+
+
+ //Load an existing Word document into WordDocument instance
+ WordDocument document = new WordDocument("Sample.docx", FormatType.Docx);
+ //Add a new simple paragraph into the last section of the document
+ IWParagraph paragraph = document.LastSection.AddParagraph();
+ //Add a text range into the paragraph
+ paragraph.AppendText("Hello World!");
+ //Save the document in the given name and format
+ document.Save("Document.docx", FormatType.Docx);
+ //Release the resources occupied by WordDocument instance
+ document.Close();
+
+
+ 'Load an existing Word document into WordDocument instance
+ Dim document As New WordDocument("Sample.docx", FormatType.Docx)
+ 'Add a new simple paragraph into the last section of the document
+ Dim paragraph As IWParagraph = document.LastSection.AddParagraph()
+ 'Add a text range into the paragraph
+ paragraph.AppendText("Hello World!")
+ 'Save the document in the given name and format
+ document.Save("Document.docx", FormatType.Docx)
+ 'Release the resources occupied by WordDocument instance
+ document.Close()
+
+
+ //Load an existing HTML file into WordDocument instance with Strict validation type
+ WordDocument document = new WordDocument("Sample.html", FormatType.Html, XHTMLValidationType.Strict);
+ //Save the document in the given name and format
+ document.Save("Document.docx", FormatType.Docx);
+ //Release the resources occupied by WordDocument instance
+ document.Close();
+
+
+ 'Load an existing HTML file into WordDocument instance with Strict validation type
+ Dim document As New WordDocument("Sample.html", FormatType.Html, XHTMLValidationType.[Strict])
+ 'Save the document in the given name and format
+ document.Save("Document.docx", FormatType.Docx)
+ 'Release the resources occupied by WordDocument instance
+ document.Close()
+
+
+ //Load an existing Word document into WordDocument instance
+ WordDocument document = new WordDocument("Sample.docx", FormatType.Docx, "password");
+ //Add a new simple paragraph into the last section of the document
+ IWParagraph paragraph = document.LastSection.AddParagraph();
+ //Add a text range into the paragraph
+ paragraph.AppendText("Hello World!");
+ //Save the document in the given name and format
+ document.Save("Document.docx", FormatType.Docx);
+ //Release the resources occupied by WordDocument instance
+ document.Close();
+
+
+ 'Load an existing Word document into WordDocument instance
+ Dim document As New WordDocument("Sample.docx", FormatType.Docx, "password")
+ 'Add a new simple paragraph into the last section of the document
+ Dim paragraph As IWParagraph = document.LastSection.AddParagraph()
+ 'Add a text range into the paragraph
+ paragraph.AppendText("Hello World!")
+ 'Save the document in the given name and format
+ document.Save("Document.docx", FormatType.Docx)
+ 'Release the resources occupied by WordDocument instance
+ document.Close()
+
+
+ Stream htmlFile = new FileStream("Sample.html", FileMode.Open, FileAccess.Read, FileShare.Read);
+ //Load an existing Stream into WordDocument instance with Strict validation type
+ WordDocument document = new WordDocument(htmlFile, FormatType.Html, XHTMLValidationType.Strict);
+ //Save the document in the given name and format
+ document.Save("Document.docx", FormatType.Docx);
+ //Release the resources occupied by WordDocument instance
+ document.Close();
+
+
+ Dim htmlFile As Stream = New FileStream("Sample.html", FileMode.Open, FileAccess.Read, FileShare.Read)
+ 'Load an existing Stream into WordDocument instance with Strict validation type
+ Dim document As New WordDocument(htmlFile, FormatType.Html, XHTMLValidationType.[Strict])
+ 'Save the document in the given name and format
+ document.Save("Document.docx", FormatType.Docx)
+ 'Release the resources occupied by WordDocument instance
+ document.Close()
+
+
+ //Create an instance of WordDocument class
+ WordDocument document = new WordDocument();
+ //Add a new section into the Word document
+ IWSection section = document.AddSection();
+ //Specify the page margins
+ section.PageSetup.Margins.All = 50f;
+ //Add a new simple paragraph into the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add a text range into the paragraph
+ paragraph.AppendText("Hello World!");
+ //Save the document in the given name and format
+ document.Save("Document.docx", FormatType.Docx);
+ //Release the resources occupied by WordDocument instance
+ document.Close();
+
+
+ 'Create an instance of WordDocument class
+ Dim document As New WordDocument()
+ 'Add a new section into the Word document
+ Dim section As IWSection = document.AddSection()
+ 'Specify the page margins
+ section.PageSetup.Margins.All = 50F
+ 'Add a new simple paragraph into the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add a text range into the paragraph
+ paragraph.AppendText("Hello World!")
+ 'Save the document in the given name and format
+ document.Save("Document.docx", FormatType.Docx)
+ 'Release the resources occupied by WordDocument instance
+ document.Close()
+
+
+ Stream fileStream = new FileStream("Sample.docx", FileMode.Open, FileAccess.Read, FileShare.Read);
+ //Load an existing Stream into WordDocument instance
+ WordDocument document = new WordDocument(fileStream);
+ //Save the document in the given name and format
+ document.Save("Document.docx", FormatType.Docx);
+ //Release the resources occupied by WordDocument instance
+ document.Close();
+
+
+ Dim fileStream As Stream = New FileStream("Sample.docx", FileMode.Open, FileAccess.Read, FileShare.Read)
+ 'Load an existing Stream into WordDocument instance
+ Dim document As New WordDocument(fileStream)
+ 'Save the document in the given name and format
+ document.Save("Document.docx", FormatType.Docx)
+ 'Release the resources occupied by WordDocument instance
+ document.Close()
+
+
+ Stream fileStream = new FileStream("Sample.docx", FileMode.Open, FileAccess.Read, FileShare.Read);
+ //Load an existing Stream into WordDocument instance
+ WordDocument document = new WordDocument(fileStream, FormatType.Docx);
+ //Add a new simple paragraph into the last section of the document
+ IWParagraph paragraph = document.LastSection.AddParagraph();
+ //Add a text range into the paragraph
+ paragraph.AppendText("Hello World!");
+ //Save the document in the given name and format
+ document.Save("Document.docx", FormatType.Docx);
+ //Release the resources occupied by WordDocument instance
+ document.Close();
+
+
+ Dim fileStream As Stream = New FileStream("Sample.docx", FileMode.Open, FileAccess.Read, FileShare.Read)
+ 'Load an existing Stream into WordDocument instance
+ Dim document As New WordDocument(fileStream, FormatType.Docx)
+ 'Add a new simple paragraph into the last section of the document
+ Dim paragraph As IWParagraph = document.LastSection.AddParagraph()
+ 'Add a text range into the paragraph
+ paragraph.AppendText("Hello World!")
+ 'Save the document in the given name and format
+ document.Save("Document.docx", FormatType.Docx)
+ 'Release the resources occupied by WordDocument instance
+ document.Close()
+
+
+ Stream fileStream = new FileStream("Sample.docx", FileMode.Open, FileAccess.Read, FileShare.Read);
+ //Load an existing Stream into WordDocument instance
+ WordDocument document = new WordDocument(fileStream, "password");
+ //Add a new simple paragraph into the last section of the document
+ IWParagraph paragraph = document.LastSection.AddParagraph();
+ //Add a text range into the paragraph
+ paragraph.AppendText("Hello World!");
+ //Save the document in the given name and format
+ document.Save("Document.docx", FormatType.Docx);
+ //Release the resources occupied by WordDocument instance
+ document.Close();
+
+
+ Dim fileStream As Stream = New FileStream("Sample.docx", FileMode.Open, FileAccess.Read, FileShare.Read)
+ 'Load an existing Stream into WordDocument instance
+ Dim document As New WordDocument(fileStream, "password")
+ 'Add a new simple paragraph into the last section of the document
+ Dim paragraph As IWParagraph = document.LastSection.AddParagraph()
+ 'Add a text range into the paragraph
+ paragraph.AppendText("Hello World!")
+ 'Save the document in the given name and format
+ document.Save("Document.docx", FormatType.Docx)
+ 'Release the resources occupied by WordDocument instance
+ document.Close()
+
+
+ Stream fileStream = new FileStream("Sample.docx", FileMode.Open, FileAccess.Read, FileShare.Read);
+ //Load an existing Stream into WordDocument instance
+ WordDocument document = new WordDocument(fileStream, FormatType.Docx, "password");
+ //Add a new simple paragraph into the last section of the document
+ IWParagraph paragraph = document.LastSection.AddParagraph();
+ //Add a text range into the paragraph
+ paragraph.AppendText("Hello World!");
+ //Save the document in the given name and format
+ document.Save("Document.docx", FormatType.Docx);
+ //Release the resources occupied by WordDocument instance
+ document.Close();
+
+
+ Dim fileStream As Stream = New FileStream("Sample.docx", FileMode.Open, FileAccess.Read, FileShare.Read)
+ 'Load an existing Stream into WordDocument instance
+ Dim document As New WordDocument(fileStream, FormatType.Docx, "password")
+ 'Add a new simple paragraph into the last section of the document
+ Dim paragraph As IWParagraph = document.LastSection.AddParagraph()
+ 'Add a text range into the paragraph
+ paragraph.AppendText("Hello World!")
+ 'Save the document in the given name and format
+ document.Save("Document.docx", FormatType.Docx)
+ 'Release the resources occupied by WordDocument instance
+ document.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Creates a new Word document.
+ WordDocument document = new WordDocument();
+ //Add a section and a paragraph in the empty document
+ document.EnsureMinimal();
+ IWParagraph paragraph = document.LastParagraph;
+ //Append text to the last paragraph of the document
+ paragraph.AppendText("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua");
+ //Save and close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Creates a new Word document.
+ Dim document As New WordDocument()
+ 'Add a section and a paragraph in the empty document
+ document.EnsureMinimal()
+ Dim paragraph As IWParagraph = document.LastParagraph
+ 'Append text to the last paragraph of the document
+ paragraph.AppendText("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua")
+ 'Save and close the Word document
+ document.Save("Comment.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Append the text to the created paragraph
+ paragraph.AppendText("A new section is added to the document.");
+ //Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Append the text to the created paragraph
+ paragraph.AppendText("A new section is added to the document.")
+ 'Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+
+ //Create user defined style
+ IWParagraphStyle style = document.AddParagraphStyle("User_defined_style");
+ style.ParagraphFormat.BackColor = Color.LightGray;
+ style.ParagraphFormat.AfterSpacing = 18f;
+ style.ParagraphFormat.BeforeSpacing = 18f;
+ style.ParagraphFormat.Borders.BorderType = Syncfusion.DocIO.DLS.BorderStyle.DotDash;
+ style.ParagraphFormat.Borders.LineWidth = 0.5f;
+ style.ParagraphFormat.LineSpacing = 15f;
+ style.CharacterFormat.FontName = "Calibri";
+ style.CharacterFormat.Italic = true;
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ IWTextRange text = paragraph.AppendText("A new paragraph style is created and is applied to this paragraph.");
+ //Apply the new style to paragraph
+ paragraph.ApplyStyle("User_defined_style");
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Create user defined style
+ Dim style As IWParagraphStyle = document.AddParagraphStyle("User_defined_style")
+ style.ParagraphFormat.BackColor = Color.LightGray
+ style.ParagraphFormat.AfterSpacing = 18.0F
+ style.ParagraphFormat.BeforeSpacing = 18.0F
+ style.ParagraphFormat.Borders.BorderType = Syncfusion.DocIO.DLS.BorderStyle.DotDash
+ style.ParagraphFormat.Borders.LineWidth = 0.5F
+ style.ParagraphFormat.LineSpacing = 15.0F
+ style.CharacterFormat.FontName = "Calibri"
+ style.CharacterFormat.Italic = True
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ Dim text As IWTextRange = paragraph.AppendText("A new paragraph style is created and is applied to this paragraph.")
+ 'Apply the new style to paragraph
+ paragraph.ApplyStyle("User_defined_style")
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new list style to the document
+ ListStyle listStyle = document.AddListStyle(ListType.Numbered, "UserdefinedList");
+ WListLevel levelOne = listStyle.Levels[0];
+ //Define the follow character, prefix, suffix, start index for level 0
+ levelOne.FollowCharacter = FollowCharacterType.Tab;
+ levelOne.NumberPrefix = "(";
+ levelOne.NumberSufix = ")";
+ levelOne.PatternType = ListPatternType.LowRoman;
+ levelOne.StartAt = 1;
+ levelOne.TabSpaceAfter = 5;
+ levelOne.NumberAlignment = ListNumberAlignment.Center;
+ WListLevel levelTwo = listStyle.Levels[1];
+ //Define the follow character, suffix, pattern, start index for level 1
+ levelTwo.FollowCharacter = FollowCharacterType.Tab;
+ levelTwo.NumberSufix = "}";
+ levelTwo.PatternType = ListPatternType.LowLetter;
+ levelTwo.StartAt = 2;
+
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add text to the paragraph
+ paragraph.AppendText("User defined list - Level 0");
+ //Apply default numbered list style
+ paragraph.ListFormat.ApplyStyle("UserdefinedList");
+ //Add second paragraph
+ paragraph = section.AddParagraph();
+ paragraph.AppendText("User defined list - Level 1");
+ //Continue last defined list
+ paragraph.ListFormat.ContinueListNumbering();
+ //Increase the level indent
+ paragraph.ListFormat.IncreaseIndentLevel();
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new list style to the document
+ Dim listStyle As ListStyle = document.AddListStyle(ListType.Numbered, "UserdefinedList")
+ Dim levelOne As WListLevel = listStyle.Levels(0)
+ 'Define the follow character, prefix, suffix, start index for level 0
+ levelOne.FollowCharacter = FollowCharacterType.Tab
+ levelOne.NumberPrefix = "("
+ levelOne.NumberSufix = ")"
+ levelOne.PatternType = ListPatternType.LowRoman
+ levelOne.StartAt = 1
+ levelOne.TabSpaceAfter = 5
+ levelOne.NumberAlignment = ListNumberAlignment.Center
+ Dim levelTwo As WListLevel = listStyle.Levels(1)
+ 'Define the follow character, suffix, pattern, start index for level 1
+ levelTwo.FollowCharacter = FollowCharacterType.Tab
+ levelTwo.NumberSufix = "}"
+ levelTwo.PatternType = ListPatternType.LowLetter
+ levelTwo.StartAt = 2
+
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add text to the paragraph
+ paragraph.AppendText("User defined list - Level 0")
+ 'Apply default numbered list style
+ paragraph.ListFormat.ApplyStyle("UserdefinedList")
+ 'Add second paragraph
+ paragraph = section.AddParagraph()
+ paragraph.AppendText("User defined list - Level 1")
+ 'Continue last defined list
+ paragraph.ListFormat.ContinueListNumbering()
+ 'Increase the level indent
+ paragraph.ListFormat.IncreaseIndentLevel()
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load a template document
+ WordDocument document = new WordDocument("Template.docx");
+ //Get the document text and close the document
+ string text = document.GetText();
+ document.Close();
+ //Create new Word document
+ WordDocument newdocument = new WordDocument();
+ //Add new section
+ IWSection section = newdocument.AddSection();
+ //Add new paragraph
+ IWParagraph paragraph = section.AddParagraph();
+ //Append the text to the paragraph
+ paragraph.AppendText(text);
+ //Save and close the document
+ newdocument.Save("Sample.docx");
+ newdocument.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load a template document
+ Dim document As New WordDocument("Template.docx")
+ 'Get the document text and close the document
+ Dim text As String = document.GetText()
+ document.Close()
+ 'Create new Word document
+ Dim newdocument As New WordDocument()
+ 'Add new section
+ Dim section As IWSection = newdocument.AddSection()
+ 'Add new paragraph
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Append the text to the paragraph
+ paragraph.AppendText(text)
+ 'Save and close the document
+ newdocument.Save("Sample.docx")
+ newdocument.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Open an existing document
+ WordDocument inputTemplateDoc = new WordDocument("Template.docx");
+ //Create a clone of Input Template
+ WordDocument clonedDocument = inputTemplateDoc.Clone();
+ //Close the input template document instance
+ inputTemplateDoc.Close();
+ //Save and Close the cloned document instance
+ clonedDocument.Save("ClonedDocument.docx");
+ clonedDocument.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Open an existing document
+ Dim inputTemplateDoc As New WordDocument(fileName)
+ 'Create a clone of Input Template
+ Dim clonedDocument As WordDocument = inputTemplateDoc.Clone()
+ 'Close the input template document instance
+ inputTemplateDoc.Close()
+ 'Save and Close the cloned document instance
+ clonedDocument.Save("ClonedDocument.docx")
+ clonedDocument.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Open the source document
+ WordDocument sourceDocument = new WordDocument("sourceFileName.docx");
+ //Open the destination document
+ WordDocument destinationDocument = new WordDocument("targetFileName.docx");
+ //Import the last section of source document at the end of destination document
+ destinationDocument.ImportSection(sourceDocument.LastSection);
+ //Close the document instance
+ sourceDocument.Close();
+ //Save the destination document
+ destinationDocument.Save("outputFileName.docx", FormatType.Docx);
+ //Close the document instance
+ destinationDocument.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Open the source document
+ Dim sourceDocument As New WordDocument(sourceFileName)
+ 'Open the destination document
+ Dim destinationDocument As New WordDocument(targetFileName)
+ 'Import the last section of source document at the end of destination document
+ destinationDocument.ImportSection(sourceDocument.LastSection)
+ 'Close the document instance
+ sourceDocument.Close()
+ 'Save the destination document
+ destinationDocument.Save(outputFileName, FormatType.Docx)
+ 'Close the document instance
+ destinationDocument.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Open the source document
+ WordDocument sourceDocument = new WordDocument("sourceFileName.docx");
+ //Open the destination document
+ WordDocument destinationDocument = new WordDocument("targetFileName.docx");
+ //Import the contents of source document at the end of destination document
+ destinationDocument.ImportContent(sourceDocument);
+ //Close the document instance
+ sourceDocument.Close();
+ //Save the destination document
+ destinationDocument.Save("outputFileName.docx", FormatType.Docx);
+ //Close the document instance
+ destinationDocument.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Open the source document
+ Dim sourceDocument As New WordDocument(sourceFileName)
+ 'Open the destination document
+ Dim destinationDocument As New WordDocument(targetFileName)
+ 'Import the contents of source document at the end of destination document
+ destinationDocument.ImportContent(sourceDocument)
+ 'Close the document instance
+ sourceDocument.Close()
+ 'Save the destination document
+ destinationDocument.Save(outputFileName, FormatType.Docx)
+ 'Close the document instance
+ destinationDocument.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Open the source document
+ WordDocument sourceDocument = new WordDocument("sourceFileName.docx");
+ //Open the destination document
+ WordDocument destinationDocument = new WordDocument("targetFileName.docx");
+ //Import the contents of source document at the end of destination document
+ destinationDocument.ImportContent(sourceDocument, ImportOptions.UseDestinationStyles);
+ //Close the document instance
+ sourceDocument.Close();
+ //Save the destination document
+ destinationDocument.Save("outputFileName.docx", FormatType.Docx);
+ //Close the document instance
+ destinationDocument.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Open the source document
+ Dim sourceDocument As New WordDocument(sourceFileName)
+ 'Open the destination document
+ Dim destinationDocument As New WordDocument(targetFileName)
+ 'Import the contents of source document at the end of destination document
+ destinationDocument.ImportContent(sourceDocument, ImportOptions.UseDestinationStyles)
+ 'Close the document instance
+ sourceDocument.Close()
+ 'Save the destination document
+ destinationDocument.Save(outputFileName, FormatType.Docx)
+ 'Close the document instance
+ destinationDocument.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Open the source document
+ WordDocument sourceDocument = new WordDocument("sourceFileName.docx");
+ //Open the destination document
+ WordDocument destinationDocument = new WordDocument("targetFileName.docx");
+ //Import the contents of source document at the end of destination document
+ destinationDocument.ImportContent(sourceDocument, true);
+ //Close the document instance
+ sourceDocument.Close();
+ //Save the destination document
+ destinationDocument.Save("outputFileName.docx", FormatType.Docx);
+ //Close the document instance
+ destinationDocument.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Open the source document
+ Dim sourceDocument As New WordDocument(sourceFileName)
+ 'Open the destination document
+ Dim destinationDocument As New WordDocument(targetFileName)
+ 'Import the contents of source document at the end of destination document
+ destinationDocument.ImportContent(sourceDocument, true)
+ 'Close the document instance
+ sourceDocument.Close()
+ 'Save the destination document
+ destinationDocument.Save(outputFileName, FormatType.Docx)
+ 'Close the document instance
+ destinationDocument.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Add the built-in style to the document style collection
+ IStyle style = document.AddStyle(BuiltinStyle.Heading5);
+ //Apply the added built-in style to the last paragraph of the document
+ document.LastParagraph.ApplyStyle(style.Name);
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Add the built-in style to the document style collection
+ Dim style As IStyle = document.AddStyle(BuiltinStyle.Heading5)
+ 'Apply the added built-in style to the last paragraph of the document
+ document.LastParagraph.ApplyStyle(style.Name)
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Check whether document has tracked changes
+ if (document.HasChanges)
+ //Accept the changes made to the document
+ document.AcceptChanges();
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Check whether document has tracked changes
+ If document.HasChanges Then
+ 'Accept the changes made to the document
+ document.AcceptChanges()
+ End If
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Check whether document has tracked changes
+ if (document.HasChanges)
+ //Reject the changes made to the document
+ document.RejectChanges();
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Check whether document has tracked changes
+ If document.HasChanges Then
+ 'Reject the changes made to the document
+ document.RejectChanges()
+ End If
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Apply the protection to the document
+ document.Protect(ProtectionType.AllowOnlyComments);
+ //Save and close the document instances
+ document.Save("Sample.docx");
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Apply the protection to the document
+ document.Protect(ProtectionType.AllowOnlyComments)
+ 'Save and close the document instances
+ document.Save("Sample.docx")
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx", "password");
+ //Apply the protection to the document
+ document.Protect(ProtectionType.AllowOnlyComments);
+ //Save and close the document instances
+ document.Save("Sample.docx");
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Apply the protection to the document
+ document.Protect(ProtectionType.AllowOnlyComments, "password")
+ 'Save and close the document instances
+ document.Save("Sample.docx")
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Open an input Word document
+ WordDocument document = new WordDocument("Template.docx");
+ //Encrypt the Word document with a password
+ document.EncryptDocument("password");
+ //Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Open an input Word document
+ Dim document As New WordDocument("Template.docx")
+ 'Encrypt the Word document with a password
+ document.EncryptDocument("password")
+ 'Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Open an input Word document
+ WordDocument document = new WordDocument("Template.docx");
+ //Remove the encryption from document
+ document.RemoveEncryption();
+ //Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Open an input Word document
+ Dim document As New WordDocument("Template.docx")
+ 'Remove the encryption from document
+ document.RemoveEncryption();
+ 'Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Get the collection of bookmark start in the word document
+ List< Entity > items = document.GetCrossReferenceItems(ReferenceType.Bookmark);
+ if (items.Count > 0)
+ //Change the first cross reference items owner paragraph back color as YelloGreen
+ (items[0] as BookmarkStart).OwnerParagraph.ParagraphFormat.BackColor = Color.YellowGreen;
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Get the collection of bookmark start in the word document
+ Dim items As List(Of Entity) = document.GetCrossReferenceItems(ReferenceType.Bookmark)
+ If items.Count > 0 Then
+ 'Change the first cross reference items owner paragraph back color as YelloGreen
+ TryCast(items(0), BookmarkStart).OwnerParagraph.ParagraphFormat.BackColor = Color.YellowGreen
+ End If
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ //Save the document as Text file
+ document.SaveTxt("sample.txt", Encoding.ASCII);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ 'Save the document as Text file
+ document.SaveTxt("sample.txt", Encoding.ASCII)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ MemoryStream stream = new MemoryStream();
+ //Save the document as Text file
+ document.SaveTxt(stream, Encoding.ASCII);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ Dim stream As New MemoryStream()
+ 'Save the document as Text file
+ document.SaveTxt(stream, Encoding.ASCII)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create an new instance of WordDocument class
+ WordDocument document = new WordDocument();
+ //Open an existing document from file system
+ document.Open("Template.docx");
+ //Saves the specified document
+ document.Save("Sample.docx");
+ //Close the WordDocument instance
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create an new instance of WordDocument class
+ Dim document As New WordDocument()
+ 'Open an existing document from file system
+ document.Open("Template.docx")
+ 'Saves the specified document
+ document.Save("Sample.docx")
+ 'Close the WordDocument instance
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create an new instance of WordDocument class
+ WordDocument document = new WordDocument();
+ //Open an existing document from file system
+ document.Open("Template.docx", FormatType.Docx);
+ //Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the WordDocument instance
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create an new instance of WordDocument class
+ Dim document As New WordDocument()
+ 'Open an existing document from file system
+ document.Open("Template.docx", FormatType.Docx)
+ 'Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the WordDocument instance
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create an new instance of WordDocument class
+ WordDocument document = new WordDocument();
+ //Open an existing document from file system
+ document.Open("Template.docx", FormatType.Docx, XHTMLValidationType.Strict, "basePath");
+ //Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the WordDocument instance
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create an new instance of WordDocument class
+ Dim document As New WordDocument()
+ 'Open an existing document from file system
+ document.Open("Template.docx", FormatType.Docx, "password", XHTMLValidationType.Strict, basePath)
+ 'Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the WordDocument instance
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create an new instance of WordDocument class
+ WordDocument document = new WordDocument();
+ //Open an existing document from file system
+ document.Open("Template.docx", FormatType.Docx, XHTMLValidationType.Strict);
+ //Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the WordDocument instance
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create an new instance of WordDocument class
+ Dim document As New WordDocument()
+ 'Open an existing document from file system
+ document.Open("Template.docx", FormatType.Docx, "password", XHTMLValidationType.Strict)
+ 'Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the WordDocument instance
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create an new instance of WordDocument class
+ WordDocument document = new WordDocument();
+ //Open an existing document from file system
+ document.Open("Template.docx", FormatType.Docx, "password");
+ //Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the WordDocument instance
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create an new instance of WordDocument class
+ Dim document As New WordDocument()
+ 'Open an existing document from file system
+ document.Open("Template.docx", FormatType.Docx, "password")
+ 'Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the WordDocument instance
+ document.Close()
+ End Sub
+
+
+ //Create a new instance of WordDocument class
+ WordDocument document = new WordDocument();
+ //Open an existing document from file system
+ document.OpenReadOnly("Template.docx", FormatType.Docx, "password");
+ //Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the WordDocument instance
+ document.Close();
+
+
+ 'Create a new instance of WordDocument class
+ Dim document As New WordDocument()
+ 'Open an existing document from file system
+ document.OpenReadOnly("Template.docx", FormatType.Docx, "password")
+ 'Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the WordDocument instance
+ document.Close()
+
+
+ //Create a new instance of WordDocument class
+ WordDocument document = new WordDocument();
+ //Open an existing document from file system
+ document.OpenReadOnly("Template.docx", FormatType.Docx, XHTMLValidationType.Strict);
+ //Saves the specified document
+ document.Save("Sample.Docx", FormatType.Docx);
+ //Close the WordDocument instance
+ document.Close();
+
+
+ 'Create a new instance of WordDocument class
+ Dim document As New WordDocument()
+ 'Open an existing document from file system
+ document.OpenReadOnly("Template.docx", FormatType.Docx, XHTMLValidationType.Strict)
+ 'Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the WordDocument instance
+ document.Close()
+
+
+ //Create a new instance of WordDocument class
+ WordDocument document = new WordDocument();
+ //Open an existing document from file system
+ document.OpenReadOnly("Template.docx", FormatType.Docx, XHTMLValidationType.Strict, "basePath");
+ //Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the WordDocument instance
+ document.Close();
+
+
+ 'Create a new instance of WordDocument class
+ Dim document As New WordDocument()
+ 'Open an existing document from file system
+ document.OpenReadOnly("Template.docx", FormatType.Docx, XHTMLValidationType.Strict, basePath)
+ 'Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the WordDocument instance
+ document.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create an new instance of WordDocument class
+ WordDocument document = new WordDocument();
+ //Open an existing document from file system
+ document.Open("Template.docx");
+ //Saves the specified document
+ document.Save("Sample.docx");
+ //Close the WordDocument instance
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create an new instance of WordDocument class
+ Dim document As New WordDocument()
+ 'Open an existing document from file system
+ document.Open("Template.docx")
+ 'Saves the specified document
+ document.Save("Sample.docx")
+ 'Close the WordDocument instance
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create an new instance of WordDocument class
+ WordDocument document = new WordDocument();
+ //Open an existing document from file system
+ document.Open("Template.docx");
+ //Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the WordDocument instance
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create an new instance of WordDocument class
+ Dim document As New WordDocument()
+ 'Open an existing document from file system
+ document.Open("Template.docx")
+ 'Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the WordDocument instance
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ MemoryStream stream = new MemoryStream();
+ //Create the new WPicture for cover page image
+ WPicture coverImage = new WPicture(document);
+ coverImage.LoadImage(Image.FromFile("CoverImage.png"));
+ //Save the document as EPUB
+ document.SaveAsEpub("sample.epub", coverImage);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ Dim stream As New MemoryStream()
+ 'Create the new WPicture for cover page image
+ Dim coverImage As New WPicture(document)
+ coverImage.LoadImage(Image.FromFile("CoverImage.png"))
+ 'Save the document as EPUB
+ document.SaveAsEpub("sample.epub", coverImage)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create an new instance of WordDocument class
+ WordDocument document = new WordDocument();
+ //Open an existing document from file system
+ document.Open("Template.docx");
+ //Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx,HttpContext.Current.Response, HttpContentDisposition.Attachment);
+ //Close the WordDocument instance
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create an new instance of WordDocument class
+ Dim document As New WordDocument()
+ 'Open an existing document from file system
+ document.Open("Template.docx")
+ 'Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx, Response, HttpContentDisposition.Attachment)
+ 'Close the WordDocument instance
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ MemoryStream stream = new MemoryStream();
+ //Create the new WPicture for cover page image
+ WPicture coverImage = new WPicture(document);
+ coverImage.LoadImage(Image.FromFile("CoverImage.png"));
+ //Save the document as EPUB
+ document.SaveAsEpub("sample.epub", coverImage, HttpContext.Current.Response, HttpContentDisposition.Attachment);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ Dim stream As New MemoryStream()
+ 'Create the new WPicture for cover page image
+ Dim coverImage As New WPicture(document)
+ coverImage.LoadImage(Image.FromFile("CoverImage.png"))
+ 'Save the document as EPUB
+ document.SaveAsEpub("sample.epub", coverImage, Response, HttpContentDisposition.Attachment)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create an new instance of WordDocument class
+ WordDocument document = new WordDocument();
+ Stream fileStream = new FileStream("Sample.html", FileMode.Open, FileAccess.Read, FileShare.Read);
+ //Open an existing document from file system
+ document.Open(fileStream, FormatType.Docx, XHTMLValidationType.Strict, "basepath");
+ //Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the WordDocument instance
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create an new instance of WordDocument class
+ Dim document As New WordDocument()
+ Dim fileStream As Stream = New FileStream("Sample.html", FileMode.Open, FileAccess.Read, FileShare.Read)
+ 'Open an existing document from file system
+ document.Open(fileStream, FormatType.Docx, XHTMLValidationType.Strict, basepath)
+ 'Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the WordDocument instance
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create an new instance of WordDocument class
+ WordDocument document = new WordDocument();
+ Stream fileStream = new FileStream("Sample.html", FileMode.Open, FileAccess.Read, FileShare.Read);
+ //Open an existing document from file system
+ document.Open(fileStream, FormatType.Docx, XHTMLValidationType.Strict);
+ //Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the WordDocument instance
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create an new instance of WordDocument class
+ Dim document As New WordDocument()
+ Dim fileStream As Stream = New FileStream("Sample.html", FileMode.Open, FileAccess.Read, FileShare.Read)
+ 'Open an existing document from file system
+ document.Open(fileStream, FormatType.Docx, XHTMLValidationType.Strict)
+ 'Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the WordDocument instance
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create an new instance of WordDocument class
+ WordDocument document = new WordDocument();
+ Stream fileStream = new FileStream("Sample.docx", FileMode.Open, FileAccess.Read, FileShare.Read);
+ //Open an existing document from file system
+ document.Open(fileStream, FormatType.Docx);
+ //Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the WordDocument instance
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create an new instance of WordDocument class
+ Dim document As New WordDocument()
+ Dim fileStream As Stream = New FileStream("Sample.docx", FileMode.Open, FileAccess.Read, FileShare.Read)
+ 'Open an existing document from file system
+ document.Open(fileStream, FormatType.Docx)
+ 'Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the WordDocument instance
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create an new instance of WordDocument class
+ WordDocument document = new WordDocument();
+ Stream fileStream = new FileStream("Sample.docx", FileMode.Open, FileAccess.Read, FileShare.Read);
+ //Open an existing document from file system
+ document.Open(fileStream, FormatType.Docx, "password");
+ //Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the WordDocument instance
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create an new instance of WordDocument class
+ Dim document As New WordDocument()
+ Dim fileStream As Stream = New FileStream("Sample.docx", FileMode.Open, FileAccess.Read, FileShare.Read)
+ 'Open an existing document from file system
+ document.Open(fileStream, FormatType.Docx, "password")
+ 'Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the WordDocument instance
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ MemoryStream stream = new MemoryStream();
+ //Save the document to stream
+ document.Save(stream, FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ Dim stream As New MemoryStream()
+ 'Save the document to stream
+ document.Save(stream, FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument wordDocument = new WordDocument("Template.docx", FormatType.Docx);
+ //Initialize ChartToImageConverter for converting charts during Word to image conversion
+ wordDocument.ChartToImageConverter = new ChartToImageConverter();
+ //Set the scaling mode for charts (Normal mode reduces the file size)
+ wordDocument.ChartToImageConverter.ScalingMode = ScalingMode.Normal;
+ //Convert word document to image
+ Image[] images = wordDocument.RenderAsImages(ImageType.Bitmap);
+ //Close the document
+ wordDocument.Close();
+ int i = 0;
+ foreach (Image image in images)
+ {
+ //Save the images as jpeg
+ image.Save("WordToImage_" + i + ".jpeg", ImageFormat.Jpeg);
+ i++;
+ }
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim wordDocument As New WordDocument("Template.docx", FormatType.Docx)
+ 'Initialize ChartToImageConverter for converting charts during Word to image conversion
+ wordDocument.ChartToImageConverter = New ChartToImageConverter()
+ 'Set the scaling mode for charts (Normal mode reduces the file size)
+ wordDocument.ChartToImageConverter.ScalingMode = ScalingMode.Normal
+ 'Convert word document to image
+ Dim images As Image() = wordDocument.RenderAsImages(ImageType.Bitmap)
+ 'Close the document
+ wordDocument.Close()
+ Dim i As Integer = 0
+ For Each image As Image In images
+ 'Save the images as jpeg
+ image.Save("WordToImage_" & i & ".jpeg", ImageFormat.Jpeg)
+ i += 1
+ Next
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument wordDocument = new WordDocument("Template.docx", FormatType.Docx);
+ //Initialize ChartToImageConverter for converting charts during Word to image conversion
+ wordDocument.ChartToImageConverter = new ChartToImageConverter();
+ //Set the scaling mode for charts (Normal mode reduces the file size)
+ wordDocument.ChartToImageConverter.ScalingMode = ScalingMode.Normal;
+ //Convert word document to stream
+ Stream imageStream = wordDocument.RenderAsImages(2, System.Drawing.Imaging.ImageFormat.Bmp);
+ //Close the document
+ wordDocument.Close();
+ //Convert the stream to Image
+ Image image = Image.FromStream(imageStream);
+ //Save the image as jpeg
+ image.Save("WordToImage.jpeg", ImageFormat.Jpeg);
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim wordDocument As New WordDocument("Template.docx", FormatType.Docx)
+ 'Initialize ChartToImageConverter for converting charts during Word to image conversion
+ wordDocument.ChartToImageConverter = New ChartToImageConverter()
+ 'Set the scaling mode for charts (Normal mode reduces the file size)
+ wordDocument.ChartToImageConverter.ScalingMode = ScalingMode.Normal
+ 'Convert word document to stream
+ Dim imageStream As Stream = wordDocument.RenderAsImages(2, System.Drawing.Imaging.ImageFormat.Bmp)
+ 'Close the document
+ wordDocument.Close()
+ 'Convert the stream to Image
+ Dim image As Image = Image.FromStream(imageStream)
+ 'Save the image as jpeg
+ image.Save("WordToImage.jpeg", ImageFormat.Jpeg)
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument wordDocument = new WordDocument("Template.docx", FormatType.Docx);
+ //Initialize ChartToImageConverter for converting charts during Word to image conversion
+ wordDocument.ChartToImageConverter = new ChartToImageConverter();
+ //Set the scaling mode for charts (Normal mode reduces the file size)
+ wordDocument.ChartToImageConverter.ScalingMode = ScalingMode.Normal;
+ //Convert word document to image
+ Image image = wordDocument.RenderAsImages(2, ImageType.Bitmap);
+ //Close the document
+ wordDocument.Close();
+ //Save the image
+ image.Save("WordToImage.jpeg", ImageFormat.Jpeg);
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim wordDocument As New WordDocument("Template.docx", FormatType.Docx)
+ 'Initialize ChartToImageConverter for converting charts during Word to image conversion
+ wordDocument.ChartToImageConverter = New ChartToImageConverter()
+ 'Set the scaling mode for charts (Normal mode reduces the file size)
+ wordDocument.ChartToImageConverter.ScalingMode = ScalingMode.Normal
+ 'Convert word document to image
+ Dim image As Image = wordDocument.RenderAsImages(2, ImageType.Bitmap)
+ 'Close the document
+ wordDocument.Close()
+ 'Save the images as jpeg
+ image.Save("WordToImage_" & i & ".jpeg", ImageFormat.Jpeg)
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument wordDocument = new WordDocument("Template.docx", FormatType.Docx);
+ //Initialize ChartToImageConverter for converting charts during Word to image conversion
+ wordDocument.ChartToImageConverter = new ChartToImageConverter();
+ //Set the scaling mode for charts (Normal mode reduces the file size)
+ wordDocument.ChartToImageConverter.ScalingMode = ScalingMode.Normal;
+ //Convert word document to image
+ Image[] images = wordDocument.RenderAsImages(0, 2, ImageType.Bitmap);
+ //Close the document
+ wordDocument.Close();
+ int i = 0;
+ foreach (Image image in images)
+ {
+ //Save the images as jpeg
+ image.Save("WordToImage_" + i + ".jpeg", ImageFormat.Jpeg);
+ i++;
+ }
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim wordDocument As New WordDocument("Template.docx", FormatType.Docx)
+ 'Initialize ChartToImageConverter for converting charts during Word to image conversion
+ wordDocument.ChartToImageConverter = New ChartToImageConverter()
+ 'Set the scaling mode for charts (Normal mode reduces the file size)
+ wordDocument.ChartToImageConverter.ScalingMode = ScalingMode.Normal
+ 'Convert word document to image
+ Dim images As Image() = wordDocument.RenderAsImages(0, 2, ImageType.Bitmap)
+ 'Close the document
+ wordDocument.Close()
+ Dim i As Integer = 0
+ For Each image As Image In images
+ 'Save the images as jpeg
+ image.Save("WordToImage_" & i & ".jpeg", ImageFormat.Jpeg)
+ i += 1
+ Next
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Find the first occurrence of a particular text in the document
+ TextSelection textSelection = document.Find(new Regex("panda"));
+ //Get the found text as single text range
+ WTextRange textRange = textSelection.GetAsOneRange();
+ //Modify the text
+ textRange.Text = "Replaced text";
+ //Set highlight color
+ textRange.CharacterFormat.HighlightColor = Color.Yellow;
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Find the first occurrence of a particular text in the document
+ Dim textSelection As TextSelection = document.Find(New Regex("panda"))
+ 'Get the found text as single text range
+ Dim textRange As WTextRange = textSelection.GetAsOneRange()
+ 'Modify the text
+ textRange.Text = "Replaced text"
+ 'Set highlight color
+ textRange.CharacterFormat.HighlightColor = Color.Yellow
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load the template document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ //Find the first occurrence of a particular text extended to several paragraphs in the document
+ TextSelection[] textSelections = document.FindSingleLine(new Regex("First paragraph Second paragraph"));
+ WParagraph paragraph = null;
+ foreach (TextSelection textSelection in textSelections)
+ {
+ //Get the found text as single text range and set highlight color
+ WTextRange textRange = textSelection.GetAsOneRange();
+ textRange.CharacterFormat.HighlightColor = Color.YellowGreen;
+ paragraph = textRange.OwnerParagraph;
+ }
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load the template document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ 'Find the first occurrence of a particular text extended to several paragraphs in the document
+ Dim textSelections As TextSelection() = document.FindSingleLine(new Regex("First paragraph Second paragraph"))
+ Dim paragraph As WParagraph = Nothing
+ For Each textSelection As TextSelection In textSelections
+ 'Get the found text as single text range and set highlight color
+ Dim textRange As WTextRange = textSelection.GetAsOneRange()
+ textRange.CharacterFormat.HighlightColor = Color.YellowGreen
+ paragraph = textRange.OwnerParagraph
+ Next
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Find the first occurrence of a particular text in the document
+ TextSelection textSelection = document.Find("panda", true, true);
+ //Get the found text as single text range
+ WTextRange textRange = textSelection.GetAsOneRange();
+ //Modify the text
+ textRange.Text = "Replaced text";
+ //Set highlight color
+ textRange.CharacterFormat.HighlightColor = Color.Yellow;
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Find the first occurrence of a particular text in the document
+ Dim textSelection As TextSelection = document.Find("panda", true, true)
+ 'Get the found text as single text range
+ Dim textRange As WTextRange = textSelection.GetAsOneRange()
+ 'Modify the text
+ textRange.Text = "Replaced text"
+ 'Set highlight color
+ textRange.CharacterFormat.HighlightColor = Color.Yellow
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load the template document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ //Find the first occurrence of a particular text extended to several paragraphs in the document
+ TextSelection[] textSelections = document.FindSingleLine("First paragraph Second paragraph", true, false);
+ WParagraph paragraph = null;
+ foreach (TextSelection textSelection in textSelections)
+ {
+ //Get the found text as single text range and set highlight color
+ WTextRange textRange = textSelection.GetAsOneRange();
+ textRange.CharacterFormat.HighlightColor = Color.YellowGreen;
+ paragraph = textRange.OwnerParagraph;
+ }
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load the template document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ 'Find the first occurrence of a particular text extended to several paragraphs in the document
+ Dim textSelections As TextSelection() = document.FindSingleLine("First paragraph Second paragraph", True, False)
+ Dim paragraph As WParagraph = Nothing
+ For Each textSelection As TextSelection In textSelections
+ 'Get the found text as single text range and set highlight color
+ Dim textRange As WTextRange = textSelection.GetAsOneRange()
+ textRange.CharacterFormat.HighlightColor = Color.YellowGreen
+ paragraph = textRange.OwnerParagraph
+ Next
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Find the occurrence of the Word "panda" in the document
+ TextSelection[] textSelection = document.FindAll(new Regex("panda"));
+ //Iterate through each occurrence and highlight it
+ foreach (TextSelection selection in textSelection)
+ {
+ IWTextRange textRange = selection.GetAsOneRange();
+ textRange.CharacterFormat.HighlightColor = Color.Yellow;
+ }
+ //Save and Close the document
+ document.Save("Result.docx");
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Find the occurrence of the word "panda" in the document
+ Dim textSelection As TextSelection() = document.FindAll(new Regex("panda"))
+ 'Iterate through each occurrence and highlight it
+ For Each selection As TextSelection In textSelection
+ Dim textRange As IWTextRange = selection.GetAsOneRange()
+ textRange.CharacterFormat.HighlightColor = Color.Yellow
+ Next
+ document.Save("Result.docx")
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Find the occurrence of the Word "panda" in the document
+ TextSelection[] textSelection = document.FindAll("panda", false, true);
+ //Iterate through each occurrence and highlight it
+ foreach (TextSelection selection in textSelection)
+ {
+ IWTextRange textRange = selection.GetAsOneRange();
+ textRange.CharacterFormat.HighlightColor = Color.Yellow;
+ }
+ //Save and Close the document
+ document.Save("Result.docx");
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Find the occurrence of the word "panda" in the document
+ Dim textSelection As TextSelection() = document.FindAll("panda", false, true)
+ 'Iterate through each occurrence and highlight it
+ For Each selection As TextSelection In textSelection
+ Dim textRange As IWTextRange = selection.GetAsOneRange()
+ textRange.CharacterFormat.HighlightColor = Color.Yellow
+ Next
+ document.Save("Result.docx")
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx");
+ //Replace all occurrence of a particular text in the document
+ document.Replace(new Regex("Paragraph"),"paragraph");
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx")
+ 'Replace all occurrence of a particular text in the document
+ document.Replace(New Regex("Paragraph"), "paragraph")
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx");
+ //Replace all occurrence of a particular text in the document
+ document.Replace("Paragraph","paragraph", false, true);
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx")
+ 'Replace all occurrence of a particular text in the document
+ document.Replace("Paragraph", "paragraph", False, True)
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx");
+ //Find the first occurrence of the regular expression
+ TextSelection selection = document.Find(new Regex("Panda"));
+ //Replace all occurrence of a particular regular expression with the text selection in the document
+ document.Replace("Giant panda", selection, true, false);
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx")
+ 'Find the first occurrence of the regular expression
+ Dim selection As TextSelection = document.Find(New Regex("Panda"))
+ 'Replace all occurrence of a particular regular expression with the text selection in the document
+ document.Replace("Giant panda", selection, True, False)
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx");
+ //Find the first occurrence of the regular expression
+ TextSelection selection = document.Find(new Regex("Panda"));
+ //Replace all occurrence of a particular regular expression with the text selection in the document
+ document.Replace("Giant panda", selection, true, false, true);
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx")
+ 'Find the first occurrence of the regular expression
+ Dim selection As TextSelection = document.Find(New Regex("Panda"))
+ 'Replace all occurrence of a particular regular expression with the text selection in the document
+ document.Replace("Giant panda", selection, True, False, False)
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx");
+ //Find the first occurrence of the regular expression
+ TextSelection selection = document.Find(new Regex("Panda"));
+ //Replace all occurrence of a particular regular expression with the text selection in the document
+ document.Replace(new Regex("Giant panda"), selection);
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx")
+ 'Find the first occurrence of the regular expression
+ Dim selection As TextSelection = document.Find(New Regex("Panda"))
+ 'Replace all occurrence of a particular regular expression with the text selection in the document
+ document.Replace(New Regex("Giant panda"), selection)
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx");
+ //Find the first occurrence of the regular expression
+ TextSelection selection = document.Find(new Regex("Panda"));
+ //Replace all occurrence of a particular regular expression with the text selection in the document
+ document.Replace(new Regex("Giant panda"), selection, true);
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx")
+ 'Find the first occurrence of the regular expression
+ Dim selection As TextSelection = document.Find(New Regex("Panda"))
+ 'Replace all occurrence of a particular regular expression with the text selection in the document
+ document.Replace(New Regex("Giant panda"), selection, True)
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx");
+ //Find the first occurrence of the regular expression
+ TextSelection selection = document.Find(new Regex("Panda"));
+ //Initialize text body part
+ TextBodyPart bodyPart = new TextBodyPart(selection);
+ //Replace a particular text with the text body part
+ document.Replace("Giant panda", bodyPart, true, false);
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx")
+ 'Find the first occurrence of the regular expression
+ Dim selection As TextSelection = document.Find(New Regex("Panda"))
+ 'Initialize text body part
+ Dim bodyPart As New TextBodyPart(selection)
+ 'Replace a particular text with the text body part
+ document.Replace("Giant panda", bodyPart, True, False)
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx");
+ //Find the first occurrence of the regular expression
+ TextSelection selection = document.Find(new Regex("Panda"));
+ //Initialize text body part
+ TextBodyPart bodyPart = new TextBodyPart(selection);
+ //Replace a particular text with the text body part
+ document.Replace("Giant panda", bodyPart, true, false, true);
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx")
+ 'Find the first occurrence of the regular expression
+ Dim selection As TextSelection = document.Find(New Regex("Panda"))
+ 'Initialize text body part
+ Dim bodyPart As New TextBodyPart(selection)
+ 'Replace a particular text with the text body part
+ document.Replace("Giant panda", bodyPart, True, False, True)
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx");
+ //Find the first occurrence of the regular expression
+ TextSelection selection = document.Find(new Regex("Panda"));
+ //Initialize text body part
+ TextBodyPart bodyPart = new TextBodyPart(selection);
+ //Replace a particular text with the text body part
+ document.Replace(new Regex("Giant panda"), bodyPart);
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx")
+ 'Find the first occurrence of the regular expression
+ Dim selection As TextSelection = document.Find(New Regex("Panda"))
+ 'Initialize text body part
+ Dim bodyPart As New TextBodyPart(selection)
+ 'Replace a particular text with the text body part
+ document.Replace(New Regex("Giant panda"), bodyPart)
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx");
+ //Find the first occurrence of the regular expression
+ TextSelection selection = document.Find(new Regex("Panda"));
+ //Initialize text body part
+ TextBodyPart bodyPart = new TextBodyPart(selection);
+ //Replace a particular text with the text body part
+ document.Replace(new Regex("Giant panda"), bodyPart, true);
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx")
+ 'Find the first occurrence of the regular expression
+ Dim selection As TextSelection = document.Find(New Regex("Panda"))
+ 'Initialize text body part
+ Dim bodyPart As New TextBodyPart(selection)
+ 'Replace a particular text with the text body part
+ document.Replace(New Regex("Giant panda"), bodyPart, True)
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx");
+ //Load the another existing Word document to replace
+ WordDocument replaceDocument = new WordDocument("Replace.docx");
+ //Replace all occurrence of a particular regular expression with the another document and close the document
+ document.Replace("Giant panda", replaceDocument, true, false);
+ replaceDocument.Close();
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx")
+ 'Load the another existing Word document to replace
+ Dim replaceDocument As New WordDocument("Replace.docx")
+ 'Replace all occurrence of a particular regular expression with the another document and close the document
+ document.Replace("Giant panda", replaceDocument, True, False)
+ replaceDocument.Close();
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx");
+ //Load the another existing Word document to replace
+ WordDocument replaceDocument = new WordDocument("Replace.docx");
+ //Replace all occurrence of a particular regular expression with the another document and close the document
+ document.Replace("Giant panda", replaceDocument, true, false, true);
+ replaceDocument.Close();
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx")
+ 'Load the another existing Word document to replace
+ Dim replaceDocument As New WordDocument("Replace.docx")
+ 'Replace all occurrence of a particular regular expression with the another document and close the document
+ document.Replace("Giant panda", replaceDocument, True, False, True)
+ replaceDocument.Close();
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx");
+ //Load the another existing Word document to replace
+ WordDocument replaceDocument = new WordDocument("Replace.docx");
+ //Replace all occurrence of a particular regular expression with the another document and close the document
+ document.Replace(new Regex("Giant panda"), replaceDocument, true);
+ replaceDocument.Close();
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx")
+ 'Load the another existing Word document to replace
+ Dim replaceDocument As New WordDocument("Replace.docx")
+ 'Replace all occurrence of a particular regular expression with the another document and close the document
+ document.Replace(New Regex("Giant panda"), replaceDocument, True)
+ replaceDocument.Close();
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ //Open an input word template
+ WordDocument document = new WordDocument(@"Template.docx", FormatType.Automatic);
+ //Update the Paragraphs count, Word count and Character count in the document
+ document.UpdateWordCount();
+ //Save and close the Word document instance.
+ document.Save("Output.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ 'Open an input word template
+ Dim document As New WordDocument("Template.docx", FormatType.Automatic)
+ 'Update the Paragraphs count, Word count and Character count in the document.
+ document.UpdateWordCount()
+ 'Save and close the Word document instance.
+ document.Save("Output.docx", FormatType.Docx)
+ document.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Open an input word template
+ WordDocument document = new WordDocument(@"Template.docx");
+ //Update the Page count, Paragraphs count, Word count and Character count in the document
+ document.UpdateWordCount(true);
+ //Save and close the Word document instance.
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Open an input word template
+ Dim document As New WordDocument("Template.docx")
+ 'Update the Page count, Paragraphs count, Word count and Character count in the document.
+ document.UpdateWordCount(True)
+ 'Save and close the Word document instance.
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Input.docx", FormatType.Docx);
+ //Updates the fields present in a document.
+ document.UpdateDocumentFields();
+ document.Save("Result.docx", FormatType.Docx);
+ document.Close();
+
+
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Input.docx", FormatType.Docx)
+ 'Updates the fields present in a document.
+ document.UpdateDocumentFields()
+ document.Save("Result.docx", FormatType.Docx)
+ document.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Input.docx", FormatType.Docx);
+ //Updates the Alternate chunks present in a document.
+ document.UpdateAlternateChunks();
+ document.Save("Result.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Input.docx", FormatType.Docx)
+ 'Updates the Alternate chunks present in a document.
+ document.UpdateAlternateChunks()
+ document.Save("Result.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ //Open an input word template
+ WordDocument document = new WordDocument(@"Template.docx");
+ //Update the table of contents.
+ document.UpdateTableOfContents();
+ //Save and close the Word document instance.
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+
+
+ 'Open an input word template
+ Dim document As New WordDocument("Template.docx")
+ 'Update the table of contents.
+ document.UpdateTableOfContents()
+ 'Save and close the Word document instance.
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load a template document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ //Replace the text extended to two paragraphs with simple text
+ document.ReplaceSingleLine("First paragraph Second paragraph", "Replaced paragraph", true, false);
+ //Save and close the document
+ document.Save("Replace.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load a template document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ 'Replace the text extended to two paragraphs with simple text
+ document.ReplaceSingleLine("First paragraph Second paragraph", "Replaced paragraph", True, False)
+ 'Save and close the document
+ document.Save("Replace.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load a template document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ //Replace the text extended to two paragraphs with simple text
+ document.ReplaceSingleLine(new Regex("First paragraph Second paragraph"), "Replaced paragraph");
+ //Save and close the document
+ document.Save("Replace.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load a template document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ 'Replace the text extended to two paragraphs with simple text
+ document.ReplaceSingleLine(New Regex("First paragraph Second paragraph"), "Replaced paragraph")
+ 'Save and close the document
+ document.Save("Replace.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load a template document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ //Find the first occurrence of a particular text in the document
+ TextSelection selection = document.Find("contents", false, false);
+ //Replace the text extended to two paragraphs with text selection
+ document.ReplaceSingleLine("First paragraph Second paragraph", selection, true, false);
+ //Save and close the document
+ document.Save("Replace.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load a template document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ 'Find the first occurrence of a particular text in the document
+ Dim selection As TextSelection = document.Find("contents", False, False)
+ 'Replace the text extended to two paragraphs with text selection
+ document.ReplaceSingleLine("First paragraph Second paragraph", selection, True, False)
+ 'Save and close the document
+ document.Save("Replace.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load a template document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ //Find the first occurrence of a particular text in the document
+ TextSelection selection = document.Find("contents", false, false);
+ //Replace the text extended to two paragraphs with text selection
+ document.ReplaceSingleLine(new Regex("First paragraph Second paragraph"), selection);
+ //Save and close the document
+ document.Save("Replace.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load a template document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ 'Find the first occurrence of a particular text in the document
+ Dim selection As TextSelection = document.Find("contents", False, False)
+ 'Replace the text extended to two paragraphs with text selection
+ document.ReplaceSingleLine(New Regex("First paragraph Second paragraph"), selection)
+ 'Save and close the document
+ document.Save("Replace.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load a template document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ //Find the first occurrence of a particular text in the document
+ TextSelection selection = document.Find("contents", false, false);
+ //Initialize text body part
+ TextBodyPart bodyPart = new TextBodyPart(selection);
+ //Replace a particular text with the text body part
+ document.ReplaceSingleLine("First paragraph Second paragraph", bodyPart, true, false);
+ //Save and close the document
+ document.Save("Replace.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load a template document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ 'Find the first occurrence of a particular text in the document
+ Dim selection As TextSelection = document.Find("contents", False, False)
+ 'Initialize text body part
+ Dim bodyPart As New TextBodyPart(selection)
+ 'Replace a particular text with the text body part
+ document.ReplaceSingleLine("First paragraph Second paragraph", bodyPart, True, False)
+ 'Save and close the document
+ document.Save("Replace.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load a template document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ //Find the first occurrence of a particular text in the document
+ TextSelection selection = document.Find("contents", false, false);
+ //Initialize text body part
+ TextBodyPart bodyPart = new TextBodyPart(selection);
+ //Replace a particular text with the text body part
+ document.ReplaceSingleLine(new Regex("First paragraph Second paragraph"), bodyPart);
+ //Save and close the document
+ document.Save("Replace.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load a template document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ 'Find the first occurrence of a particular text in the document
+ Dim selection As TextSelection = document.Find("contents", False, False)
+ 'Initialize text body part
+ Dim bodyPart As New TextBodyPart(selection)
+ 'Replace a particular text with the text body part
+ document.ReplaceSingleLine(New Regex("First paragraph Second paragraph"), bodyPart)
+ 'Save and close the document
+ document.Save("Replace.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load the template document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ //Find the first occurrence of a particular text in the document
+ TextSelection textSelection = document.Find("as graphical contents", false, true);
+ //Get the found text as single text range
+ WTextRange textRange = textSelection.GetAsOneRange();
+ //Modify the text
+ textRange.Text = "Replaced text";
+ //Set highlight color
+ textRange.CharacterFormat.HighlightColor = Color.Yellow;
+ //Find the next occurrence of a particular text from the previous paragraph
+ textSelection = document.FindNext(textRange.OwnerParagraph, "paragraph", true, false);
+ //Get the found text as single text range
+ WTextRange range = textSelection.GetAsOneRange();
+ //Set bold formatting
+ range.CharacterFormat.Bold = true;
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load the template document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ 'Find the first occurrence of a particular text in the document
+ Dim textSelection As TextSelection = document.Find("as graphical contents", false, true)
+ 'Get the found text as single text range
+ Dim textRange As WTextRange = textSelection.GetAsOneRange()
+ 'Modify the text
+ textRange.Text = "Replaced text"
+ 'Set highlight color
+ textRange.CharacterFormat.HighlightColor = Color.Yellow
+ 'Find the next occurrence of a particular text from the previous paragraph
+ textSelection = document.FindNext(textRange.OwnerParagraph, "paragraph", true, false)
+ 'Get the found text as single text range
+ Dim range As WTextRange = textSelection.GetAsOneRange()
+ 'Set bold formatting
+ range.CharacterFormat.Bold = True
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load the template document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ //Find the first occurrence of a particular text in the document
+ TextSelection textSelection = document.Find(new Regex("as graphical contents"));
+ //Get the found text as single text range
+ WTextRange textRange = textSelection.GetAsOneRange();
+ //Modify the text
+ textRange.Text = "Replaced text";
+ //Set highlight color
+ textRange.CharacterFormat.HighlightColor = Color.Yellow;
+ //Find the next occurrence of a particular text from the previous paragraph
+ textSelection = document.FindNext(textRange.OwnerParagraph, new Regex("paragraph"));
+ //Get the found text as single text range
+ WTextRange range = textSelection.GetAsOneRange();
+ //Set bold formatting
+ range.CharacterFormat.Bold = true;
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load the template document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ 'Find the first occurrence of a particular text in the document
+ Dim textSelection As TextSelection = document.Find("as graphical contents")
+ 'Get the found text as single text range
+ Dim textRange As WTextRange = textSelection.GetAsOneRange()
+ 'Modify the text
+ textRange.Text = "Replaced text"
+ 'Set highlight color
+ textRange.CharacterFormat.HighlightColor = Color.Yellow
+ 'Find the next occurrence of a particular text from the previous paragraph
+ textSelection = document.FindNext(textRange.OwnerParagraph, "paragraph")
+ 'Get the found text as single text range
+ Dim range As WTextRange = textSelection.GetAsOneRange()
+ 'Set bold formatting
+ range.CharacterFormat.Bold = True
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load the template document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ //Find the first occurrence of a particular text extended to several paragraphs in the document
+ TextSelection[] textSelections = document.FindSingleLine("First paragraph Second paragraph", true, false);
+ WParagraph paragraph = null;
+ foreach (TextSelection textSelection in textSelections)
+ {
+ //Get the found text as single text range and set highlight color
+ WTextRange textRange = textSelection.GetAsOneRange();
+ textRange.CharacterFormat.HighlightColor = Color.YellowGreen;
+ paragraph = textRange.OwnerParagraph;
+ }
+ //Find the next occurrence of a particular text extended to several paragraphs in the document
+ textSelections = document.FindNextSingleLine(paragraph, "First paragraph Second paragraph", true, false);
+ foreach (TextSelection textSelection in textSelections)
+ {
+ //Get the found text as single text range and set italic formatting
+ WTextRange text = textSelection.GetAsOneRange();
+ text.CharacterFormat.Italic = true;
+ }
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load the template document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ 'Find the first occurrence of a particular text extended to several paragraphs in the document
+ Dim textSelections As TextSelection() = document.FindSingleLine("First paragraph Second paragraph", True, False)
+ Dim paragraph As WParagraph = Nothing
+ For Each textSelection As TextSelection In textSelections
+ 'Get the found text as single text range and set highlight color
+ Dim textRange As WTextRange = textSelection.GetAsOneRange()
+ textRange.CharacterFormat.HighlightColor = Color.YellowGreen
+ paragraph = textRange.OwnerParagraph
+ Next
+ 'Find the next occurrence of a particular text extended to several paragraphs in the document
+ textSelections = document.FindNextSingleLine(paragraph, "First paragraph Second paragraph", True, False)
+ For Each textSelection As TextSelection In textSelections
+ 'Get the found text as single text range and set italic formatting
+ Dim text As WTextRange = textSelection.GetAsOneRange()
+ text.CharacterFormat.Italic = True
+ Next
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load the template document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ //Find the first occurrence of a particular text extended to several paragraphs in the document
+ TextSelection[] textSelections = document.FindSingleLine("First paragraph Second paragraph", true, false);
+ WParagraph paragraph = null;
+ foreach (TextSelection textSelection in textSelections)
+ {
+ //Get the found text as single text range and set highlight color
+ WTextRange textRange = textSelection.GetAsOneRange();
+ textRange.CharacterFormat.HighlightColor = Color.YellowGreen;
+ paragraph = textRange.OwnerParagraph;
+ }
+ //Find the next occurrence of a particular text extended to several paragraphs in the document
+ textSelections = document.FindNextSingleLine(paragraph, new Regex("First paragraph Second paragraph"));
+ foreach (TextSelection textSelection in textSelections)
+ {
+ //Get the found text as single text range and set italic formatting
+ WTextRange text = textSelection.GetAsOneRange();
+ text.CharacterFormat.Italic = true;
+ }
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load the template document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ 'Find the first occurrence of a particular text extended to several paragraphs in the document
+ Dim textSelections As TextSelection() = document.FindSingleLine("First paragraph Second paragraph", True, False)
+ Dim paragraph As WParagraph = Nothing
+ For Each textSelection As TextSelection In textSelections
+ 'Get the found text as single text range and set highlight color
+ Dim textRange As WTextRange = textSelection.GetAsOneRange()
+ textRange.CharacterFormat.HighlightColor = Color.YellowGreen
+ paragraph = textRange.OwnerParagraph
+ Next
+ 'Find the next occurrence of a particular text extended to several paragraphs in the document
+ textSelections = document.FindNextSingleLine(paragraph, new Regex("First paragraph Second paragraph"))
+ For Each textSelection As TextSelection In textSelections
+ 'Get the found text as single text range and set italic formatting
+ Dim text As WTextRange = textSelection.GetAsOneRange()
+ text.CharacterFormat.Italic = True
+ Next
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load the document with macros
+ WordDocument document = new WordDocument("Sample.docm");
+ //Check whether the document has macros and remove them
+ if (document.HasMacros)
+ document.RemoveMacros();
+ //Save the document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load the document with macros
+ Dim document As New WordDocument("Sample.docm")
+ 'Check whether the document has macros and remove them
+ If document.HasMacros Then
+ document.RemoveMacros()
+ End If
+ 'Save the document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ //Open an existing Word document.
+ using(WordDocument document = new WordDocument("Template.docx"))
+ {
+ //Find picture by alternative text.
+ WPicture picture = document.FindItemByProperty(EntityType.Picture, "AlternativeText", "Logo") as WPicture;
+ //Resize the picture.
+ if (picture != null)
+ {
+ picture.Height = 50;
+ picture.Width = 75;
+ }
+ //Save and close the Word document.
+ document.Save("Sample.docx");
+ }
+
+
+ 'Open an existing Word document.
+ Dim document As WordDocument = New WordDocument("Template.docx")
+ 'Find picture by alternative text.
+ Dim picture As WPicture = TryCast(document.FindItemByProperty(EntityType.Picture, "AlternativeText", "Logo"), WPicture)
+ 'Resize the picture.
+ If picture IsNot Nothing Then
+ picture.Height = 50
+ picture.Width = 75
+ End If
+ 'Save and close the Word document.
+ document.Save("Sample.docx")
+ document.Close()
+
+
+ //Open an existing Word document.
+ using(WordDocument document = new WordDocument("Template.docx"))
+ {
+ //Find picture by height and width.
+ WPicture picture = document.FindItemByProperties(EntityType.Picture, new string[] { "Height", "Width" }, new string[] { "100", "50" }) as WPicture;
+ //Resize the picture.
+ if (picture != null)
+ {
+ picture.Height = 50;
+ picture.Width = 75;
+ }
+ //Save and close the Word document.
+ document.Save("Sample.docx");
+ }
+
+
+ 'Open an existing Word document.
+ Dim document As WordDocument = New WordDocument("Template.docx")
+ 'Find pictures by height and width.
+ Dim picture As WPicture = TryCast(document.FindItemByProperties(EntityType.Picture, New String() {"Height", "Width"}, New String() {"100", "50"}), WPicture)
+ 'Resize the pictures.
+ If picture IsNot Nothing Then
+ picture.Height = 50
+ picture.Width = 75
+ End If
+ 'Save and close the Word document.
+ document.Save("Sample.docx")
+ document.Close()
+
+
+ //Load an existing Word document into DocIO instance
+ WordDocument originalDocument = new WordDocument("OriginalDocument.docx", FormatType.Docx);
+ WordDocument revisedDocument = new WordDocument("RevisedDocument.docx", FormatType.Docx);
+ //Compares the original document with revised document
+ originalDocument.Compare(revisedDocument, "Nancy Davolio", DateTime.Now.AddDays(-1));
+ originalDocument.Save("Result.docx", FormatType.Docx);
+ revisedDocument.Close();
+ originalDocument.Close();
+
+
+ 'Load an existing Word document into DocIO instance
+ Dim originalDocument As New WordDocument("OriginalDocument.docx", FormatType.Docx)
+ Dim revisedDocument As New WordDocument("RevisedDocument.docx", FormatType.Docx)
+ 'Compares the original document with revised document
+ originalDocument.Compare(revisedDocument, "Nancy Davolio", DateTime.Now.AddDays(-1));
+ originalDocument.Save("Result.docx", FormatType.Docx)
+ revisedDocument.Close();
+ originalDocument.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument wordDocument = new WordDocument("Template.docx", FormatType.Docx);
+ //Initialize ChartToImageConverter for converting charts during Word to pdf conversion
+ wordDocument.ChartToImageConverter = new ChartToImageConverter();
+ //Create an instance of DocToPDFConverter
+ DocToPDFConverter converter = new DocToPDFConverter();
+ //Convert Word document into PDF document
+ PdfDocument pdfDocument = converter.ConvertToPDF(wordDocument);
+ //Close the instance of Word document object
+ wordDocument.Close();
+ //Save the PDF file
+ pdfDocument.Save("WordtoPDF.pdf");
+ //Close the instance of PDF document object
+ pdfDocument.Close(true);
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim wordDocument As New WordDocument("Template.docx", FormatType.Docx)
+ 'Initialize ChartToImageConverter for converting charts during Word to pdf conversion
+ /// wordDocument.ChartToImageConverter = New ChartToImageConverter()
+ 'Create an instance of DocToPDFConverter
+ Dim converter As New DocToPDFConverter()
+ 'Convert Word document into PDF document
+ Dim pdfDocument As PdfDocument = converter.ConvertToPDF(wordDocument)
+ 'Close the instance of Word document object
+ wordDocument.Close();
+ 'Save the PDF file
+ pdfDocument.Save("WordtoPDF.pdf")
+ 'Close the instance of document object
+ pdfDocument.Close(True)
+ End Sub
+
+
+ // Loads an existing Word document.
+ WordDocument wordDocument = new WordDocument("template.docx", FormatType.Docx);
+ // Initializes the SubstituteFont event to perform font substitution during Word to PDF conversion.
+ wordDocument.FontSettings.SubstituteFont += new SubstituteFontEventHandler(SubstituteFont);
+ // Creates an instance of DocToPDFConverter.
+ DocToPDFConverter converter = new DocToPDFConverter();
+ // Converts the Word document into PDF document.
+ PdfDocument pdfDocument = converter.ConvertToPDF(wordDocument);
+ // Closes the instance of Word document object.
+ wordDocument.Close();
+ // Saves the PDF file.
+ pdfDocument.Save("WordtoPDF.pdf");
+ // Closes the instance of PDF document object.
+ pdfDocument.Close(true);
+
+ private void SubstituteFont(object sender, SubstituteFontEventArgs args)
+ {
+ // Sets the alternate font when a specified font is not installed in the production environment.
+ if (args.OrignalFontName == "Arial Unicode MS")
+ args.AlternateFontName = "Arial";
+ else
+ args.AlternateFontName = "Times New Roman";
+ }
+
+
+ ' Loads an existing Word document.
+ Dim wordDocument As New WordDocument("template.docx", FormatType.Docx)
+ ' Initializes the SubstituteFont event to perform font substitution during Word to PDF conversion.
+ AddHandler wordDocument.FontSettings.SubstituteFont, AddressOf SubstituteFont
+ ' Creates an instance of DocToPDFConverter.
+ Dim converter As New DocToPDFConverter()
+ ' Converts the Word document into PDF document.
+ Dim pdfDocument As PdfDocument = converter.ConvertToPDF(wordDocument)
+ ' Closes the instance of document object.
+ wordDocument.Close()
+ ' Saves the PDF file .
+ pdfDocument.Save("WordtoPDF.pdf")
+ ' Closes the instance of document object.
+ pdfDocument.Close(True)
+
+ Private Sub SubstituteFont(ByVal sender As Object, ByVal args As SubstituteFontEventArgs)
+ ' Sets the alternate font when a specified font is not installed in the production environment.
+ If args.OrignalFontName = "Arial Unicode MS" Then
+ args.AlternateFontName = "Arial"
+ Else
+ args.AlternateFontName = "Times New Roman"
+ End If
+ End Sub
+
+
+ //Creates an new instance of WordDocument class.
+ WordDocument srcDocument = new WordDocument("SourceTemplate.docx");
+ // Creates an new instance of WordDocument class.
+ WordDocument destDocument = new WordDocument("DestinationTemplate.docx");
+ //Import the contents of source document at the end of destination document with destination styles.
+ destDocument.ImportOptions = ImportOptions.UseDestinationStyles;
+ destDocument.Sections.Add(srcDocument.LastSection.Clone());
+ // Releases the resources occupied by WordDocument instance.
+ srcDocument.Close();
+ // Saves the document in the given name and format.
+ destDocument.Save("Document.docx", FormatType.Docx);
+ // Releases the resources occupied by WordDocument instance.
+ destDocument.Close();
+
+
+ 'Creates an new instance of WordDocument class.
+ Dim srcDocument As New WordDocument("SourceTemplate.docx")
+ ' Creates an new instance of WordDocument class.
+ Dim destDocument As New WordDocument("DestinationTemplate.docx")
+ 'Import the contents of source document at the end of destination document with destination styles.
+ destDocument.ImportOptions = ImportOptions.UseDestinationStyles
+ destDocument.Sections.Add(srcDocument.LastSection.Clone())
+ ' Releases the resources occupied by WordDocument instance.
+ srcDocument.Close()
+ ' Saves the document in the given name and format.
+ destDocument.Save("Document.docx", FormatType.Docx)
+ ' Releases the resources occupied by WordDocument instance.
+ destDocument.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Retrieve the last section of the document and add new paragraph
+ document.LastSection.AddParagraph().AppendText("Adding new paragraph to the document");
+ //Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Retrieve the last section of the document and add new paragraph
+ document.LastSection.AddParagraph().AppendText("Adding new paragraph to the document")
+ 'Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Set the last paragraph back color as Blue
+ document.LastParagraph.ParagraphFormat.BackColor = Color.Blue;
+ //Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Set the last paragraph back color as Blue
+ document.LastParagraph.ParagraphFormat.BackColor = Color.Blue
+ 'Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Set the endnote format
+ document.EndnoteNumberFormat = FootEndNoteNumberFormat.Arabic;
+ //Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Set the endnote format
+ document.EndnoteNumberFormat = FootEndNoteNumberFormat.Arabic
+ 'Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Set the footnote number format
+ document.FootnoteNumberFormat = FootEndNoteNumberFormat.UpperCaseRoman;
+ //Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Set the footnote number format
+ document.FootnoteNumberFormat = FootEndNoteNumberFormat.UpperCaseRoman
+ 'Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Set the endnote restart index number
+ document.RestartIndexForEndnote = EndnoteRestartIndex.RestartForEachSection;
+ //Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Set the endnote restart index number
+ document.RestartIndexForEndnote = EndnoteRestartIndex.RestartForEachSection
+ 'Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Set the endnote position at end of each section
+ document.EndnotePosition = EndnotePosition.DisplayEndOfSection;
+ //Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Set the endnote position at end of each section
+ document.EndnotePosition = EndnotePosition.DisplayEndOfSection
+ 'Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Set the footnote restart index number
+ document.RestartIndexForFootnotes = FootnoteRestartIndex.RestartForEachPage;
+ //Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Set the footnote restart index number
+ document.RestartIndexForFootnotes = FootnoteRestartIndex.RestartForEachPage
+ 'Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Set the footnote position at immediately beneath text
+ document.FootnotePosition = FootnotePosition.PrintImmediatelyBeneathText;
+ //Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Set the footnote position at immediately beneath text
+ document.FootnotePosition = FootnotePosition.PrintImmediatelyBeneathText
+ 'Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //protect the document from editing
+ document.ProtectionType = Syncfusion.DocIO.ProtectionType.AllowOnlyReading;
+ //Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'protect the document from editing
+ document.ProtectionType = Syncfusion.DocIO.ProtectionType.AllowOnlyReading
+ 'Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Set the footnote initial number
+ document.InitialFootnoteNumber = 3;
+ //Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Set the footnote initial number
+ document.InitialFootnoteNumber = 3
+ 'Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Set the endnote initial number
+ document.InitialEndnoteNumber = 5;
+ //Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Set the endnote initial number
+ document.InitialEndnoteNumber = 5
+ 'Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ WordDocument document = new WordDocument();
+ IWSection section = document.AddSection();
+ IWParagraph paragraph = section.AddParagraph();
+ paragraph.AppendText("First Name of the customer: ");
+ //Add the DocVariable field with Variable name and its type
+ paragraph.AppendField("FirstName", FieldType.FieldDocVariable);
+ paragraph = section.AddParagraph();
+ paragraph.AppendText("Last Name of the customer: ");
+ //Add the DocVariable field with Variable name and its type
+ paragraph.AppendField("LastName", FieldType.FieldDocVariable);
+ //Add the value for variable in WordDocument.Variable collection
+ document.Variables.Add("FirstName", "Jeff");
+ document.Variables.Add("LastName", "Smith");
+ //Update the document fields
+ document.UpdateDocumentFields();
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ Dim document As New WordDocument()
+ Dim section As IWSection = document.AddSection()
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ paragraph.AppendText("First Name of the customer: ")
+ 'Add the DocVariable field with Variable name and its type
+ paragraph.AppendField("FirstName", FieldType.FieldDocVariable)
+ paragraph = section.AddParagraph()
+ paragraph.AppendText("Last Name of the customer: ")
+ 'Add the DocVariable field with Variable name and its type
+ paragraph.AppendField("LastName", FieldType.FieldDocVariable)
+ 'Add the value for variable in WordDocument.Variable collection
+ document.Variables.Add("FirstName", "Jeff")
+ document.Variables.Add("LastName", "Smith")
+ 'Update the document fields
+ document.UpdateDocumentFields()
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Enable the TrackChanges to track the edits as revision
+ document.TrackChanges = true;
+ //Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Enable the TrackChanges to track the edits as revision
+ document.TrackChanges = True
+ 'Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load a template document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ //Set to replace only the first occurrence of a particular text
+ document.ReplaceFirst = true;
+ //Find the first occurrence of a particular text in the document
+ TextSelection selection = document.Find("contents", false, false);
+ //Initialize text body part
+ TextBodyPart bodyPart = new TextBodyPart(selection);
+ //Replace a particular text with the text body part
+ document.Replace("paragraph", bodyPart, false, true, true);
+ //Save and close the document
+ document.Save("Replace.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load a template document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ 'Set to replace only the first occurrence of a particular text
+ document.ReplaceFirst = True
+ 'Find the first occurrence of a particular text in the document
+ Dim selection As TextSelection = document.Find("contents", False, False)
+ 'Initialize text body part
+ Dim bodyPart As New TextBodyPart(selection)
+ 'Replace a particular text with the text body part
+ document.Replace("paragraph", bodyPart, False, True, True)
+ 'Save and close the document
+ document.Save("Replace.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ //Loads an existing Word document
+ WordDocument wordDocument = new WordDocument("Template.docx", FormatType.Docx);
+ //Sets revision types to preserve track changes in PDF conversion.
+ wordDocument.RevisionOptions.ShowMarkup = RevisionType.Insertions | RevisionType.Formatting | RevisionType.Deletions;
+ //Instantiation of DocToPDFConverter for Word to PDF conversion
+ DocToPDFConverter converter = new DocToPDFConverter();
+ //Converts Word document into PDF document
+ PdfDocument pdfDocument = converter.ConvertToPDF(wordDocument);
+ //Saves the PDF file
+ pdfDocument.Save("WordtoPDF.pdf");
+ //Releases all resources used by the object
+ converter.Dispose();
+ //Closes the instance of document objects
+ wordDocument.Close();
+ pdfDocument.Close(true);
+
+
+ 'Loads an existing Word document
+ Dim wordDocument As WordDocument = New WordDocument("Template.docx", FormatType.Docx)
+ 'Sets revision types to preserve track changes in PDF conversion.
+ wordDocument.RevisionOptions.ShowMarkup = RevisionType.Insertions Or RevisionType.Formatting Or RevisionType.Deletions
+ 'Instantiation of DocToPDFConverter for Word to PDF conversion
+ Dim converter As DocToPDFConverter = New DocToPDFConverter
+ 'Converts Word document into PDF document
+ Dim pdfDocument As PdfDocument = converter.ConvertToPDF(wordDocument)
+ 'Saves the PDF file
+ pdfDocument.Save("WordtoPDF.pdf")
+ 'Releases all resources used by the object
+ converter.Dispose()
+ 'Closes the instance of document objects
+ wordDocument.Close()
+ pdfDocument.Close(True)
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Apply the Arial font instead of the Arabic font, if the system does not contains Arabic font
+ document.FontSubstitutionTable.Add("Arabic", "Arial");
+ //Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Apply the Arial font instead of the Arabic font, if the system does not contains Arabic font
+ document.FontSubstitutionTable.Add("Arabic", "Arial");
+ 'Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ // Creates an new instance of WordDocument class.
+ WordDocument srcDocument = new WordDocument();
+ // Adds a section and a paragraph in the empty document.
+ srcDocument.EnsureMinimal();
+ // Sets bold to character format of "Normal" style to differentiate source and destination document.
+ (srcDocument.Styles.FindByName("Normal") as WParagraphStyle).CharacterFormat.Bold = true;
+ // Creates an new instance of WordDocument class.
+ WordDocument destDocument = new WordDocument();
+ // Adds a section and a paragraph in the empty document.
+ destDocument.EnsureMinimal();
+ // Sets false value to exclude importing duplicate styles to destination document.
+ destDocument.ImportStyles = false;
+ destDocument.Sections.Add(srcDocument.LastSection.Clone());
+ // Releases the resources occupied by WordDocument instance.
+ srcDocument.Close();
+ // Saves the document in the given name and format.
+ destDocument.Save("Document.docx", FormatType.Docx);
+ // Releases the resources occupied by WordDocument instance.
+ destDocument.Close();
+
+
+ ' Creates an new instance of WordDocument class.
+ Dim srcDocument As New WordDocument()
+ ' Adds a section and a paragraph in the empty document.
+ srcDocument.EnsureMinimal()
+ ' Sets bold to character format of "Normal" style to differentiate source and destination document.
+ TryCast(srcDocument.Styles.FindByName("Normal"), WParagraphStyle).CharacterFormat.Bold = True
+ ' Creates an new instance of WordDocument class.
+ Dim destDocument As New WordDocument()
+ ' Adds a section and a paragraph in the empty document.
+ destDocument.EnsureMinimal()
+ ' Sets false value to exclude importing duplicate styles to destination document.
+ destDocument.ImportStyles = False
+ destDocument.Sections.Add(srcDocument.LastSection.Clone())
+ ' Releases the resources occupied by WordDocument instance.
+ srcDocument.Close()
+ ' Saves the document in the given name and format.
+ destDocument.Save("Document.docx", FormatType.Docx)
+ ' Releases the resources occupied by WordDocument instance.
+ destDocument.Close()
+
+
+ // Creates an new instance of WordDocument class.
+ WordDocument srcDocument = new WordDocument();
+ // Adds a section and a paragraph in the empty document.
+ srcDocument.EnsureMinimal();
+ // Creates a paragraph style (with name "Test") and adds into source document.
+ WParagraphStyle paragraphStyle = new WParagraphStyle(srcDocument);
+ paragraphStyle.Name = "Test";
+ srcDocument.Styles.Add(paragraphStyle);
+ // Creates an new instance of WordDocument class.
+ WordDocument destDocument = new WordDocument();
+ // Adds a section and a paragraph in the empty document.
+ destDocument.EnsureMinimal();
+ // Creates a character style (with same paragraph styel name in source) and adds into destination document.
+ WCharacterStyle characterStyle = new WCharacterStyle(destDocument);
+ characterStyle.Name = "Test";
+ destDocument.Styles.Add(characterStyle);
+ // Sets true value to include importing duplicate styles (mismatched with types) to destination document.
+ destDocument.ImportStylesOnTypeMismatch = true;
+ destDocument.Sections.Add(srcDocument.LastSection.Clone());
+ // Releases the resources occupied by WordDocument instance.
+ srcDocument.Close();
+ // Saves the document in the given name and format.
+ destDocument.Save("Document.docx", FormatType.Docx);
+ // Releases the resources occupied by WordDocument instance.
+ destDocument.Close();
+
+
+ ' Creates an new instance of WordDocument class.
+ Dim srcDocument As New WordDocument()
+ ' Adds a section and a paragraph in the empty document.
+ srcDocument.EnsureMinimal()
+ ' Creates a paragraph style (with name "Test") and adds into source document.
+ Dim paragraphStyle As New WParagraphStyle(srcDocument)
+ paragraphStyle.Name = "Test"
+ srcDocument.Styles.Add(paragraphStyle)
+ ' Creates an new instance of WordDocument class.
+ Dim destDocument As New WordDocument()
+ ' Adds a section and a paragraph in the empty document.
+ destDocument.EnsureMinimal()
+ ' Creates a character style (with same paragraph styel name in source) and adds into destination document.
+ Dim characterStyle As New WCharacterStyle(destDocument)
+ characterStyle.Name = "Test"
+ destDocument.Styles.Add(characterStyle)
+ ' Sets true value to include importing duplicate styles (mismatched with types) to destination document.
+ destDocument.ImportStylesOnTypeMismatch = True
+ destDocument.Sections.Add(srcDocument.LastSection.Clone())
+ ' Releases the resources occupied by WordDocument instance.
+ srcDocument.Close()
+ ' Saves the document in the given name and format.
+ destDocument.Save("Document.docx", FormatType.Docx)
+ ' Releases the resources occupied by WordDocument instance.
+ destDocument.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument("Template.docx");
+ //Set the path for the attached template document
+ document.AttachedTemplate.Path = "../Data/Attachedtemplate.dotm";
+ //Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument("Template.docx")
+ 'Set the path for the attached template document
+ document.AttachedTemplate.Path = "../Data/Attachedtemplate.dotm"
+ 'Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Sets the maintain formatting option to the fields of the Word document
+ document.Settings.MaintainFormattingOnFieldUpdate = true;
+ //Updates the document fields
+ document.UpdateDocumentFields();
+ //Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+
+
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Sets the maintain formatting option to the fields of the Word document
+ document.Settings.MaintainFormattingOnFieldUpdate = True
+ 'Updates the document fields
+ document.UpdateDocumentFields()
+ 'Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ //Sets whether result code must be updated when field code is modified.
+ document.Settings.UpdateResultOnFieldCodeChange = true;
+ //Modifies the merge field code.
+ (document.LastParagraph.ChildEntities[0] as WMergeField).FieldCode = "MERGEFIELD Employee_ID \\*MERGEFORMAT";
+ //Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+
+
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ 'Sets whether result code must be updated when field code is modified.
+ document.Settings.UpdateResultOnFieldCodeChange = True
+ 'Modifies the merge field code.
+ (document.LastParagraph.ChildEntities[0] as WMergeField).FieldCode = "MERGEFIELD Employee_ID \\*MERGEFORMAT"
+ 'Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ //Load an existing Word document into DocIO instance.
+ WordDocument document = new WordDocument("Template.docx");
+ //Set the background type of the document.
+ document.Background.Type = BackgroundType.Color;
+ //Set the background color of the document.
+ document.Background.Color = Color.Red;
+ //Sets whether background colors and images are shown when a document is displayed in print layout view.
+ document.Settings.DisplayBackgrounds = false;
+ //Save and Close the Word document.
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+
+
+ 'Load an existing Word document into DocIO instance.
+ Dim document As New WordDocument("Template.docx")
+ 'Set the background type of the document.
+ document.Background.Type = BackgroundType.Color
+ 'Set the background color of the document.
+ document.Background.Color = Color.Red
+ 'Sets whether background colors and images are shown when a document is displayed in print layout view.
+ document.Settings.DisplayBackgrounds = False
+ 'Save and Close the Word document.
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ //Opens the source document
+ WordDocument sourceDocument = new WordDocument("sourceFileName.docx");
+ //Opens the destination document
+ WordDocument destinationDocument = new WordDocument("targetFileName.docx");
+ //Sets true value to maintain imported list style cache to destination document
+ destinationDocument.Settings.MaintainImportedListCache = true;
+ //Processes the body contents for each section in the Word document
+ foreach (WSection section in sourceDocument.Sections)
+ {
+ //Accesses the body of section where all the contents in document are apart
+ foreach (TextBodyItem bodyItem in section.Body.ChildEntities)
+ {
+ destinationDocument.LastSection.Body.ChildEntities.Add(bodyItem.Clone());
+ }
+ }
+ //Closes the source document
+ sourceDocument.Close();
+ //Sets false value to exclude imported list style cache to destination document
+ destinationDocument.Settings.MaintainImportedListCache = false;
+ //Saves the destination document
+ destinationDocument.Save("outputFileName.docx", FormatType.Docx);
+ //Closes the destination document
+ destinationDocument.Close();
+
+
+ 'Opens the source document
+ Dim sourceDocument As New WordDocument(sourceFileName)
+ 'Opens the destination document
+ Dim destinationDocument As New WordDocument(targetFileName)
+ 'Sets true value to maintain imported list style cache to destination document
+ destinationDocument.Settings.MaintainImportedListCache = True
+ 'Processes the body contents for each section in the Word document
+ For Each section As WSection In sourceDocument.Sections
+ 'Accesses the body of section where all the contents in document are apart
+ For Each bodyItem As TextBodyItem In section.Body.ChildEntities
+ destinationDocument.LastSection.Body.ChildEntities.Add(bodyItem.Clone())
+ Next
+ Next
+ 'Closes the source document
+ sourceDocument.Close()
+ 'Sets false value to exclude imported list style cache to destination document
+ destinationDocument.Settings.MaintainImportedListCache = False
+ 'Saves the destination document
+ destinationDocument.Save(outputFileName, FormatType.Docx)
+ 'Closes the destination document
+ destinationDocument.Close()
+
+
+ //Creates new instance of WordDocument class.
+ WordDocument document = new WordDocument();
+ //Sets flag to skip old file format exception while opening document.
+ document.Settings.SkipIncrementalSaveValidation = true;
+ //Opens an existing document from file system through.
+ document.Open("Template.docx", FormatType.Automatic);
+ //Save and Close the Word document.
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+
+
+ 'Creates new instance of WordDocument class.
+ Dim document As New WordDocument()
+ 'Sets flag to skip old file format exception while opening document.
+ document.Settings.SkipIncrementalSaveValidation = True
+ 'Opens an existing document from file system through.
+ document.Open(fileName, FormatType.Automatic)
+ 'Save and Close the Word document.
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ //Creates an empty Word document instance
+ WordDocument document = new WordDocument();
+ //Sets flag to preserve embedded Ole images as normal image while opening document
+ document.Settings.PreserveOleImageAsImage = true;
+ //Loads or opens an existing Word document
+ document.Open(fileName, FormatType.Automatic);
+ //Saves the resultant Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Closes the Word document
+ document.Close();
+
+
+ 'Creates an empty Word document instance
+ Dim document As New WordDocument()
+ 'Sets flag to preserve embedded Ole images as normal image while opening document
+ document.Settings.PreserveOleImageAsImage = True
+ 'Loads or opens an existing Word document
+ document.Open("Template.docx", FormatType.Automatic)
+ 'Saves the resultant Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Closes the Word document
+ document.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Create a section
+ IWSection section = document.AddSection();
+ //Add a paragraph to a section
+ IWParagraph paragraph = section.AddParagraph();
+ //Append the text to paragraph
+ paragraph.AppendText("Working with footnotes");
+ //Formatting the text
+ paragraph.ApplyStyle(BuiltinStyle.Heading1);
+ //Add a paragraph to a section
+ paragraph = section.AddParagraph();
+ //Append the footnotes
+ WFootnote footnote = (WFootnote)paragraph.AppendFootnote(Syncfusion.DocIO.FootnoteType.Footnote);
+ WTextBody separator = document.Footnotes.Separator;
+ //Replace the default foot note separate by text
+ separator.Paragraphs[0].Text = "Footnote separator";
+ //Set the footnote character format
+ footnote.MarkerCharacterFormat.SubSuperScript = SubSuperScript.SuperScript;
+ //Inserts the text into the paragraph
+ paragraph.AppendText("Sample content for footnotes").CharacterFormat.Bold = true;
+ //Add footnote text
+ paragraph = footnote.TextBody.AddParagraph();
+ paragraph.AppendText("Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula");
+ //Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Create a section
+ IWSection section = document.AddSection();
+ //Add a paragraph to a section
+ IWParagraph paragraph = section.AddParagraph();
+ //Append the text to paragraph
+ paragraph.AppendText("Working with footnotes");
+ //Formatting the text
+ paragraph.ApplyStyle(BuiltinStyle.Heading1);
+ //Add a paragraph to section
+ paragraph = section.AddParagraph();
+ //Append the endnote
+ WFootnote endnote = (WFootnote)paragraph.AppendFootnote(Syncfusion.DocIO.FootnoteType.Endnote);
+ WTextBody separator = document.Endnotes.Separator;
+ //Replace the default foot note separate by text
+ separator.Paragraphs[0].Text = "Endnote separator";
+ //Set the endnote character format
+ endnote.MarkerCharacterFormat.SubSuperScript = SubSuperScript.SuperScript;
+ //Insert the text into the paragraph
+ paragraph.AppendText("Sample content for endnotes").CharacterFormat.Bold = true;
+ //Add the footnote text
+ paragraph = endnote.TextBody.AddParagraph();
+ paragraph.AppendText("Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula");
+ //Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Create a section
+ Dim section As IWSection = document.AddSection()
+ 'Add a paragraph to a section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Append the text to paragraph
+ paragraph.AppendText("Working with footnotes")
+ 'Formatting the text
+ paragraph.ApplyStyle(BuiltinStyle.Heading1)
+ 'Add a paragraph to section
+ paragraph = section.AddParagraph()
+ 'Append the endnote
+ Dim endnote As WFootnote = DirectCast(paragraph.AppendFootnote(Syncfusion.DocIO.FootnoteType.Endnote), WFootnote)
+ Dim separator As WTextBody = document.Endnotes.Separator
+ 'Replace the default foot note separate by text
+ separator.Paragraphs(0).Text = "Endnote separator"
+ 'Set the endnote character format
+ endnote.MarkerCharacterFormat.SubSuperScript = SubSuperScript.SuperScript
+ 'Insert the text into the paragraph
+ paragraph.AppendText("Sample content for endnotes").CharacterFormat.Bold = True
+ 'Add the footnote text
+ paragraph = endnote.TextBody.AddParagraph()
+ paragraph.AppendText("Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula")
+ 'Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Creates instance for HTML import settings.
+ HTMLImportSettings hTMLImport = new HTMLImportSettings();
+ //Enable the IsConsiderListStyleAttribute to consider the list style type.
+ hTMLImport.IsConsiderListStyleAttribute = true;
+ //Creates instance for Word document.
+ WordDocument wordDocument = new WordDocument();
+ //Sets the HTML import settings for HTML to Word conversion.
+ wordDocument.HTMLImportSettings = hTMLImport;
+ //Opens the existing HTML document.
+ wordDocument.Open(@"InputHTML.html");
+ //Save the document as Word document.
+ wordDocument.Save("sample.docx");
+ //Close the document.
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Creates instance for HTML import settings.
+ Dim hTMLImport As New HTMLImportSettings()
+ 'Enable the IsConsiderNoneListStyle to consider the list style type.
+ hTMLImport.IsConsiderListStyleAttribute = True
+ 'Creates instance for Word document.
+ Dim wordDocument As New WordDocument()
+ 'Sets the HTML import settings for HTML to Word conversion.
+ WordDocument.HTMLImportSettings = hTMLImport
+ 'Opens the existing HTML document.
+ WordDocument.Open("InputHTML.html")
+ 'Save the document as Word document.
+ WordDocument.Save("sample.docx")
+ 'Close the document.
+ WordDocument.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ WordDocument document = new WordDocument();
+ IWSection section = document.AddSection();
+ //Set page setup options
+ section.PageSetup.Orientation = PageOrientation.Landscape;
+ section.PageSetup.Margins.All = 72;
+ section.PageSetup.Borders.LineWidth = 2;
+ section.PageSetup.DifferentFirstPage = true;
+ section.PageSetup.DifferentOddAndEvenPages = true;
+ section.PageSetup.FooterDistance = 42;
+ section.PageSetup.HeaderDistance = 52;
+ section.PageSetup.LineNumberingDistanceFromText = 10;
+ section.PageSetup.LineNumberingMode = LineNumberingMode.Continuous;
+ section.PageSetup.LineNumberingStartValue = 5;
+ section.PageSetup.LineNumberingStep = 2;
+ section.PageSetup.PageBorderOffsetFrom = PageBorderOffsetFrom.Text;
+ section.PageSetup.PageBordersApplyType = PageBordersApplyType.AllPages;
+ section.PageSetup.PageNumberStyle = PageNumberStyle.RomanUpper;
+ section.PageSetup.PageSize = new SizeF(612, 792);
+ section.PageSetup.PageStartingNumber = 1;
+ section.PageSetup.VerticalAlignment = PageAlignment.Top;
+ //Add the page number field to even footer of the document
+ IWParagraph paragraph = section.HeadersFooters.EvenFooter.AddParagraph();
+ paragraph.AppendText("PageNumber_EvenPageFooter ");
+ paragraph.AppendField("Page", FieldType.FieldPage);
+ //Add the page number field to odd footer of the document
+ paragraph = section.HeadersFooters.OddFooter.AddParagraph();
+ paragraph.AppendText("PageNumber_OddPageFooter ");
+ paragraph.AppendField("Page", FieldType.FieldPage);
+ //Add the page number field to first footer of the document
+ paragraph = section.HeadersFooters.FirstPageFooter.AddParagraph();
+ //Add page number field to the document
+ paragraph.AppendText("PageNumber_FirstPageFooter ");
+ paragraph.AppendField("Page", FieldType.FieldPage);
+ //Add a paragraph to section
+ paragraph = section.AddParagraph();
+ //Append the text to the created paragraph
+ paragraph.AppendText("Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula");
+ paragraph = section.AddParagraph();
+ //Append the text to the created paragraph
+ paragraph.AppendText("Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula");
+ paragraph.AppendBreak(Syncfusion.DocIO.DLS.BreakType.PageBreak);
+ paragraph = section.AddParagraph();
+ //Append the text to the created paragraph
+ paragraph.AppendText("Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula");
+ paragraph = section.AddParagraph();
+ //Append the text to the created paragraph
+ paragraph.AppendText("Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula");
+ paragraph.AppendBreak(Syncfusion.DocIO.DLS.BreakType.PageBreak);
+ paragraph = section.AddParagraph();
+ //Append the text to the created paragraph
+ paragraph.AppendText("Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula");
+ paragraph = section.AddParagraph();
+ //Append the text to the created paragraph
+ paragraph.AppendText("Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula");
+ //Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ Dim document As New WordDocument()
+ Dim section As IWSection = document.AddSection()
+ 'Set page setup options
+ section.PageSetup.Orientation = PageOrientation.Landscape
+ section.PageSetup.Margins.All = 72
+ section.PageSetup.Borders.LineWidth = 2
+ section.PageSetup.DifferentFirstPage = True
+ section.PageSetup.DifferentOddAndEvenPages = True
+ section.PageSetup.FooterDistance = 42
+ section.PageSetup.HeaderDistance = 52
+ section.PageSetup.LineNumberingDistanceFromText = 10
+ section.PageSetup.LineNumberingMode = LineNumberingMode.Continuous
+ section.PageSetup.LineNumberingStartValue = 5
+ section.PageSetup.LineNumberingStep = 2
+ section.PageSetup.PageBorderOffsetFrom = PageBorderOffsetFrom.Text
+ section.PageSetup.PageBordersApplyType = PageBordersApplyType.AllPages
+ section.PageSetup.PageNumberStyle = PageNumberStyle.RomanUpper
+ section.PageSetup.PageSize = New SizeF(612, 792)
+ section.PageSetup.PageStartingNumber = 1
+ section.PageSetup.VerticalAlignment = PageAlignment.Top
+ 'Add the page number field to even footer of the document
+ Dim paragraph As IWParagraph = section.HeadersFooters.EvenFooter.AddParagraph()
+ paragraph.AppendText("PageNumber_EvenPageFooter ")
+ paragraph.AppendField("Page", FieldType.FieldPage)
+ 'Add the page number field to odd footer of the document
+ paragraph = section.HeadersFooters.OddFooter.AddParagraph()
+ paragraph.AppendText("PageNumber_OddPageFooter ")
+ paragraph.AppendField("Page", FieldType.FieldPage)
+ 'Add the page number field to first footer of the document
+ paragraph = section.HeadersFooters.FirstPageFooter.AddParagraph()
+ 'Add page number field to the document
+ paragraph.AppendText("PageNumber_FirstPageFooter ")
+ paragraph.AppendField("Page", FieldType.FieldPage)
+ 'Add a paragraph to section
+ paragraph = section.AddParagraph()
+ 'Append the text to the created paragraph
+ paragraph.AppendText("Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula")
+ paragraph = section.AddParagraph()
+ 'Append the text to the created paragraph
+ paragraph.AppendText("Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula")
+ paragraph.AppendBreak(Syncfusion.DocIO.DLS.BreakType.PageBreak)
+ paragraph = section.AddParagraph()
+ 'Append the text to the created paragraph
+ paragraph.AppendText("Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula")
+ paragraph = section.AddParagraph()
+ 'Append the text to the created paragraph
+ paragraph.AppendText("Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula")
+ paragraph.AppendBreak(Syncfusion.DocIO.DLS.BreakType.PageBreak)
+ paragraph = section.AddParagraph()
+ 'Append the text to the created paragraph
+ paragraph.AppendText("Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula")
+ paragraph = section.AddParagraph()
+ 'Append the text to the created paragraph
+ paragraph.AppendText("Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula")
+ 'Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add the section into Word document
+ IWSection section = document.AddSection();
+ section.PageSetup.PageStartingNumber = 1;
+ section.PageSetup.RestartPageNumbering = true;
+ section.PageSetup.PageNumberStyle = PageNumberStyle.Arabic;
+ section.PageSetup.InsertPageNumbers(false, PageNumberAlignment.Center);
+ //Add the paragraph
+ IWParagraph paragraph = section.AddParagraph();
+ //Append the text to the created paragraph
+ paragraph.AppendText("Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula");
+ //Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add the section into Word document
+ Dim section As IWSection = document.AddSection()
+ section.PageSetup.PageStartingNumber = 1
+ section.PageSetup.RestartPageNumbering = True
+ section.PageSetup.PageNumberStyle = PageNumberStyle.Arabic
+ section.PageSetup.InsertPageNumbers(False, PageNumberAlignment.Center)
+ 'Add the paragraph
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Append the text to the created paragraph
+ paragraph.AppendText("Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula")
+ 'Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ //Open existing Word document.
+ WordDocument document = new WordDocument("Sample.docx");
+ //Iterate each section
+ foreach (WSection section in document.Sections)
+ {
+ //Set the Line numbering mode for the Particular Section.
+ section.PageSetup.LineNumberingMode = LineNumberingMode.Continuous;
+ }
+ //Save the resultant Word document.
+ document.Save("Sample.docx");
+ //Close the document instance.
+ document.Close();
+
+
+ //Open existing Word document.
+ Dim document As New WordDocument("Sample.docx")
+ //Iterate each section
+ For Each section As WSection In document.Sections
+ //Set the Line Numbering Mode for the Particular Section.
+ section.PageSetup.LineNumberingMode = LineNumberingMode.Continuous
+ Next
+ //Save the resultant Word document.
+ document.Save("Sample.docx")
+ //Close the document instance.
+ document.Close()
+
+
+ //Open existing Word document.
+ WordDocument document = new WordDocument("Sample.docx");
+ //Iterate each section
+ foreach (WSection section in document.Sections)
+ {
+ //Set the line numbering mode for the Particular section.
+ section.PageSetup.LineNumberingMode = LineNumberingMode.Continuous;
+ //Set the Step value for the LineNumberingMode.
+ section.PageSetup.LineNumberingStep=2;
+ }
+ //Save the resultant Word document.
+ document.Save("Sample.docx");
+ //Close the document instance.
+ document.Close();
+
+
+ //Open existing Word document.
+ Dim document As New WordDocument("Sample.docx")
+ //Iterate each section
+ For Each section As WSection In document.Sections
+ //Set the line numbering mode for the Particular section.
+ section.PageSetup.LineNumberingMode = LineNumberingMode.Continuous
+ //Set the Step value for the LineNumberingMode.
+ section.PageSetup.LineNumberingStep = 2
+ Next
+ //Save the resultant Word document.
+ document.Save("Sample.docx")
+ //Close the document instance.
+ document.Close()
+
+
+ //Open existing Word document.
+ WordDocument document = new WordDocument("Sample.docx");
+ //Iterate each section
+ foreach (WSection section in document.Sections)
+ {
+ //Set the line numbering mode for the Particular Section.
+ section.PageSetup.LineNumberingMode = LineNumberingMode.Continuous;
+ //Set the Starting value for the LineNumberingMode.
+ section.PageSetup.LineNumberingStartValue = 100;
+ }
+ //Save the resultant Word document.
+ document.Save("Sample.docx");
+ //Close the document instance.
+ document.Close();
+
+
+ //Open existing Word document.
+ Dim document As New WordDocument("Sample.docx")
+ //Iterate each section
+ For Each section As WSection In document.Sections
+ //Set the line numbering mode for the Particular Section.
+ section.PageSetup.LineNumberingMode = LineNumberingMode.Continuous
+ //Set the Starting Value for the LineNumbering Mode.
+ section.PageSetup.LineNumberingStartValue = 100
+ Next
+ //Save the resultant Word document.
+ document.Save("Sample.docx")
+ //Close the document instance.
+ document.Close()
+
+
+ //Open existing Word document.
+ WordDocument document = new WordDocument("Sample.docx");
+ //Iterate each section
+ foreach (WSection section in document.Sections)
+ {
+ //Set the line numbering mode for the particular section.
+ section.PageSetup.LineNumberingMode = LineNumberingMode.Continuous;
+ //Set the Distance value for the LineNumbering Mode.
+ section.PageSetup.LineNumberingDistanceFromText = 55.7f;
+ }
+ //Save the resultant Word document.
+ document.Save("Sample.docx");
+ //Close the document instance.
+ document.Close();
+
+
+ //Open existing Word document.
+ Dim document As New WordDocument("Sample.docx")
+ //Iterate each section
+ For Each section As WSection In document.Sections
+ //Set the line numbering mode for the particular section.
+ section.PageSetup.LineNumberingMode = LineNumberingMode.Continuous
+ //Set the Distance value for the LineNumbering Mode.
+ section.PageSetup.LineNumberingDistanceFromText = 55.7F
+ Next
+ //Save the resultant Word document.
+ document.Save("Sample.docx")
+ //Close the document instance.
+ document.Close()
+
+
+ //Creates an instance of WordDocument.
+ WordDocument document = new WordDocument();
+ //Adds a new section into the Word document.
+ IWSection section= document.AddSection();
+ //Sets the PrinterPaperTray value for FirstPageTray in pagesetup options.
+ section.PageSetup.FirstPageTray = PrinterPaperTray.EnvelopeFeed;
+ //Adds a new simple paragraph into the section.
+ IWParagraph paragraph = section.AddParagraph();
+ //Adds new text to the paragraph.
+ paragraph.AppendText("Added paper source");
+ //Saves the resultant Word document.
+ document.Save("Sample.docx");
+ //Closes the document.
+ document.Close();
+
+
+ //Creates an instance of WordDocument.
+ Dim document As WordDocument = New WordDocument()
+ //Adds a new section into the Word document.
+ Dim section As IWSection = document.AddSection()
+ //Sets the PrinterPaperTray value for FirstPageTray in pagesetup options.
+ section.PageSetup.FirstPageTray = PrinterPaperTray.EnvelopeFeed
+ //Adds a new simple paragraph into the section.
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ //Adds new text to the paragraph.
+ paragraph.AppendText("Added paper source")
+ //Saves the resultant Word document.
+ document.Save("Sample.docx")
+ //Closes the document.
+ document.Close()
+
+
+ //Creates an instance of WordDocument.
+ WordDocument document = new WordDocument();
+ //Adds a new section into the Word document.
+ IWSection section= document.AddSection();
+ //Sets the PrinterPaperTray value for OtherPagesTray in pagesetup options.
+ section.PageSetup.OtherPagesTray = PrinterPaperTray.MiddleBin;
+ //Adds a new simple paragraph into the section.
+ IWParagraph paragraph = section.AddParagraph();
+ //Adds new text to the paragraph.
+ paragraph.AppendText("Added paper source");
+ //Saves the resultant Word document.
+ document.Save("Sample.docx");
+ //Closes the document.
+ document.Close();
+
+
+ //Creates an instance of WordDocument.
+ Dim document As WordDocument = New WordDocument()
+ //Adds a new section into the Word document.
+ Dim section As IWSection = document.AddSection()
+ //Sets the PrinterPaperTray value for OtherPagesTray in pagesetup options.
+ section.PageSetup.OtherPagesTray = PrinterPaperTray.MiddleBin
+ //Adds a new simple paragraph into the section.
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ //Adds new text to the paragraph.
+ paragraph.AppendText("Added paper source")
+ //Saves the resultant Word document.
+ document.Save("Sample.docx")
+ //Closes the document.
+ document.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add the section into Word document
+ IWSection section = document.AddSection();
+ //Add the page number to document
+ section.PageSetup.PageStartingNumber = 1;
+ section.PageSetup.RestartPageNumbering = true;
+ section.PageSetup.PageNumberStyle = PageNumberStyle.Arabic;
+ //Specify the chapter number for heading 1
+ section.PageSetup.PageNumbers.HeadingLevelForChapter = HeadingLevel.Heading1;
+ //SPecify t he chapter number and page number separator
+ section.PageSetup.PageNumbers.ChapterPageSeparator = ChapterPageSeparatorType.Colon;
+ //Add a footer paragraph text to the document
+ IWParagraph paragraph = section.HeadersFooters.Footer.AddParagraph();
+ paragraph.ParagraphFormat.Tabs.AddTab(523f, TabJustification.Right, Syncfusion.DocIO.DLS.TabLeader.NoLeader);
+ //Add text for the footer paragraph
+ paragraph.AppendText("Copyright Northwind Inc. 2001 - 2024");
+ //Add page number field to the document
+ paragraph.AppendText("\tPage ");
+ paragraph.AppendField("Page", FieldType.FieldPage);
+ //Add the paragraph to the text body of the section
+ paragraph = section.AddParagraph();
+ paragraph.AppendText("First Title with Heading 1 Style");
+ //Apply Heading 1 built-in style
+ paragraph.ApplyStyle(BuiltinStyle.Heading1);
+ WParagraphStyle paraStyle = document.Styles.FindByName("Heading 1") as WParagraphStyle;
+ //Add the number format list for the Heading 1 style
+ paraStyle.ListFormat.ApplyDefNumberedStyle();
+ paraStyle.ListFormat.CurrentListLevel.PatternType = ListPatternType.UpLetter;
+ //Add the paragraph
+ paragraph = section.AddParagraph();
+ //Append the text to the created paragraph
+ paragraph.AppendText("Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula");
+ //Add the page break
+ paragraph.AppendBreak(Syncfusion.DocIO.DLS.BreakType.PageBreak);
+ //Add the another paragraph to section
+ paragraph = section.AddParagraph();
+ paragraph.AppendText("Second Title with Heading 1 Style");
+ //Apply Heading 1 built-in style
+ paragraph.ApplyStyle(BuiltinStyle.Heading1);
+ //Add the paragraph
+ paragraph = section.AddParagraph();
+ //Append the text to the created paragraph
+ paragraph.AppendText("Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula");
+ //Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add the section into Word document
+ Dim section As IWSection = document.AddSection()
+ 'Add the page number to document
+ section.PageSetup.PageStartingNumber = 1
+ section.PageSetup.RestartPageNumbering = True
+ section.PageSetup.PageNumberStyle = PageNumberStyle.Arabic
+ 'Specify the chapter number for heading 1
+ section.PageSetup.PageNumbers.HeadingLevelForChapter = HeadingLevel.Heading1
+ 'SPecify t he chapter number and page number separator
+ section.PageSetup.PageNumbers.ChapterPageSeparator = ChapterPageSeparatorType.Colon
+ 'Add a footer paragraph text to the document
+ Dim paragraph As IWParagraph = section.HeadersFooters.Footer.AddParagraph()
+ paragraph.ParagraphFormat.Tabs.AddTab(523F, TabJustification.Right, Syncfusion.DocIO.DLS.TabLeader.NoLeader)
+ 'Add text for the footer paragraph
+ paragraph.AppendText("Copyright Northwind Inc. 2001 - 2024")
+ 'Add page number field to the document
+ paragraph.AppendText(vbTab & "Page ")
+ paragraph.AppendField("Page", FieldType.FieldPage)
+ 'Add the paragraph to the text body of the section
+ paragraph = section.AddParagraph()
+ paragraph.AppendText("First Title with Heading 1 Style")
+ 'Apply Heading 1 built-in style
+ paragraph.ApplyStyle(BuiltinStyle.Heading1)
+ Dim paraStyle As WParagraphStyle = TryCast(document.Styles.FindByName("Heading 1"), WParagraphStyle)
+ 'Add the number format list for the Heading 1 style
+ paraStyle.ListFormat.ApplyDefNumberedStyle()
+ paraStyle.ListFormat.CurrentListLevel.PatternType = ListPatternType.UpLetter
+ 'Add the paragraph
+ paragraph = section.AddParagraph()
+ 'Append the text to the created paragraph
+ paragraph.AppendText("Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula")
+ 'Add the page break
+ paragraph.AppendBreak(Syncfusion.DocIO.DLS.BreakType.PageBreak)
+ 'Add the another paragraph to section
+ paragraph = section.AddParagraph()
+ paragraph.AppendText("Second Title with Heading 1 Style")
+ 'Apply Heading 1 built-in style
+ paragraph.ApplyStyle(BuiltinStyle.Heading1)
+ 'Add the paragraph
+ paragraph = section.AddParagraph()
+ 'Append the text to the created paragraph
+ paragraph.AppendText("Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula")
+ 'Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add new text to the paragraph
+ IWTextRange text = paragraph.AppendText("A new text is added to the paragraph.");
+ text.CharacterFormat.FontSize = 14;
+ text.CharacterFormat.Bold = true;
+ text.CharacterFormat.TextColor = Color.Green;
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add new text to the paragraph
+ Dim text As IWTextRange = paragraph.AppendText("A new text is added to the paragraph.")
+ text.CharacterFormat.FontSize = 14
+ text.CharacterFormat.Bold = True
+ text.CharacterFormat.TextColor = Color.Green
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add new inline control to the paragraph
+ IInlineContentControl inlineControl = paragraph.AppendInlineContentControl(ContentControlType.RichText);
+ WTextRange controlText = new WTextRange(document);
+ controlText.CharacterFormat.Bold = true;
+ controlText.CharacterFormat.TextColor = Color.Green;
+ controlText.Text = "Inline content control inserted.";
+ //Add text range to the control added
+ inlineControl.ParagraphItems.Add(controlText);
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add new inline control to the paragraph
+ Dim inlineControl As IInlineContentControl = paragraph.AppendInlineContentControl(ContentControlType.RichText)
+ Dim textRange As New WTextRange(document)
+ textRange.CharacterFormat.Bold = True
+ textRange.CharacterFormat.TextColor = Color.Green
+ textRange.Text = "Inline content control inserted."
+ 'Add text range to the control added
+ inlineControl.ParagraphItems.Add(textRange)
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add image to the paragraph
+ IWPicture picture = paragraph.AppendPicture(Image.FromFile("Image.png"));
+ //Set height and width for the image
+ picture.Height = 100;
+ picture.Width = 100;
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add image to the paragraph
+ Dim picture As IWPicture = paragraph.AppendPicture(Image.FromFile("Image.png"))
+ 'Set height and width for the image
+ picture.Height = 100
+ picture.Width = 100
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph firstParagraph = section.AddParagraph();
+ //Get the image and convert to byte array.
+ Image image = Image.FromFile("Image.png");
+ MemoryStream stream = new MemoryStream();
+ image.Save(stream, System.Drawing.Imaging.ImageFormat.Png);
+ byte[] imageBytes = stream.ToArray();
+ //Add image to the paragraph
+ IWPicture picture = firstParagraph.AppendPicture(imageBytes);
+ //Set height and width for the image
+ picture.Height = 100;
+ picture.Width = 100;
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim firstParagraph As IWParagraph = section.AddParagraph()
+ 'Get the image and convert to byte array.
+ Dim image__1 As Image = Image.FromFile("Image.png")
+ Dim stream As New MemoryStream()
+ image__1.Save(stream, System.Drawing.Imaging.ImageFormat.Png)
+ Dim imageBytes As Byte() = stream.ToArray()
+ 'Add image to the paragraph
+ Dim picture As IWPicture = firstParagraph.AppendPicture(imageBytes)
+ 'Set height and width for the image
+ picture.Height = 100
+ picture.Width = 100
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph firstParagraph = section.AddParagraph();
+ //Get the image as byte array.
+ byte[] imageBytes = File.ReadAllBytes("Image.png");
+ //Get the SVG image as byte array.
+ byte[] svgData = File.ReadAllBytes("Image.svg");
+ //Add SVG image to the paragraph
+ IWPicture picture = firstParagraph.AppendPicture(svgData, imageBytes);
+ //Set height and width for the image
+ picture.Height = 100;
+ picture.Width = 100;
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim firstParagraph As IWParagraph = section.AddParagraph()
+ 'Get the png image as byte array.
+ Dim imageBytes As Byte() = File.ReadAllBytes("Image.png")
+ 'Get the SVG image as byte array.
+ Dim svgData As Byte() = File.ReadAllBytes("Image.svg")
+ 'Add SVG image to the paragraph
+ Dim picture As IWPicture = firstParagraph.AppendPicture(svgData, imageBytes);
+ 'Set height and width for the image
+ picture.Height = 100
+ picture.Width = 100
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add section to the document
+ IWSection sec = document.AddSection();
+ //Add paragraph to the section
+ IWParagraph paragraph = sec.AddParagraph();
+ //Input data for chart
+ object[][] data = new object[6][];
+ for (int i = 0; i < 6; i++)
+ data[i] = new object[3];
+ data[0][0] = "";
+ data[1][0] = "Gravad lax";
+ data[2][0] = "Louisiana Hot spiced Okara";
+ data[3][0] = "Mascarpone Fabioli";
+ data[4][0] = "Wimmers gute SemmelKnodel";
+ data[5][0] = "Maxilaku";
+ data[0][1] = "Sum of Purchases";
+ data[1][1] = 286;
+ data[2][1] = 680;
+ data[3][1] = 288;
+ data[4][1] = 200;
+ data[5][1] = 731;
+ data[0][2] = "Sum of Future Expenses";
+ data[1][2] = 1300;
+ data[2][2] = 700;
+ data[3][2] = 1280;
+ data[4][2] = 1200;
+ data[5][2] = 2660; ///
+ //Create and Append chart to the paragraph
+ WChart chart = paragraph.AppendChart(data, 470, 300);
+ //Set chart type and title
+ chart.ChartTitle = "Purchase Details";
+ chart.ChartTitleArea.FontName = "Calibri";
+ chart.ChartTitleArea.Size = 14;
+ chart.ChartArea.Border.LinePattern = OfficeChartLinePattern.None;
+ //Set series type
+ chart.Series[0].SerieType = OfficeChartType.Line_Markers;
+ chart.Series[1].SerieType = OfficeChartType.Bar_Clustered;
+ chart.PrimaryCategoryAxis.Title = "Products";
+ chart.PrimaryValueAxis.Title = "In Dollars";
+ //Set position of legend
+ chart.Legend.Position = OfficeLegendPosition.Bottom;
+ //Save the document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add section to the document
+ Dim sec As IWSection = document.AddSection()
+ 'Add paragraph to the section
+ Dim paragraph As IWParagraph = sec.AddParagraph()
+ 'Input data for chart
+ Dim data As Object()() = New Object(5)() {}
+ For i As Integer = 0 To 5
+ data(i) = New Object(2) {}
+ Next
+ data(0)(0) = ""
+ data(1)(0) = "Gravad lax"
+ data(2)(0) = "Louisiana Hot spiced Okara"
+ data(3)(0) = "Mascarpone Fabioli"
+ data(4)(0) = "Wimmers gute SemmelKnodel"
+ data(5)(0) = "Maxilaku"
+ data(0)(1) = "Sum of Purchases"
+ data(1)(1) = 286
+ data(2)(1) = 680
+ data(3)(1) = 288
+ data(4)(1) = 200
+ data(5)(1) = 731
+ data(0)(2) = "Sum of Future Expenses"
+ data(1)(2) = 1300
+ data(2)(2) = 700
+ data(3)(2) = 1280
+ data(4)(2) = 1200
+ data(5)(2) = 2660
+ 'Create and Append chart to the paragraph
+ Dim chart As WChart = paragraph.AppendChart(data, 470, 300)
+ 'Set chart type and title
+ chart.ChartTitle = "Purchase Details"
+ chart.ChartTitleArea.FontName = "Calibri"
+ chart.ChartTitleArea.Size = 14
+ chart.ChartArea.Border.LinePattern = OfficeChartLinePattern.None
+ 'Set series type
+ chart.Series(0).SerieType = OfficeChartType.Line_Markers
+ chart.Series(1).SerieType = OfficeChartType.Bar_Clustered
+ chart.PrimaryCategoryAxis.Title = "Products"
+ chart.PrimaryValueAxis.Title = "In Dollars"
+ 'Set position of legend
+ chart.Legend.Position = OfficeLegendPosition.Bottom
+ 'Save the document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add section to the document
+ IWSection sec = document.AddSection();
+ //Add paragraph to the section
+ IWParagraph paragraph = sec.AddParagraph();
+ //Create and Append chart to the paragraph
+ WChart chart = paragraph.AppendChart(446, 270);
+ //Set chart type
+ chart.ChartType = OfficeChartType.Pie;
+ //Set chart title
+ chart.ChartTitle = "Best Selling Products";
+ chart.ChartTitleArea.FontName = "Calibri";
+ chart.ChartTitleArea.Size = 14;
+ //Set data for chart
+ chart.ChartData.SetValue(1, 1, "");
+ chart.ChartData.SetValue(1, 2, "Sales");
+ chart.ChartData.SetValue(2, 1, "Cote de Blaye");
+ chart.ChartData.SetValue(2, 2, 141.396);
+ chart.ChartData.SetValue(3, 1, "Thuringer Rostbratwurst");
+ chart.ChartData.SetValue(3, 2, 80.368);
+ chart.ChartData.SetValue(4, 1, "Raclette Courdavault");
+ chart.ChartData.SetValue(4, 2, 71.155);
+ chart.ChartData.SetValue(5, 1, "Tarte au sucre");
+ chart.ChartData.SetValue(5, 2, 47.234);
+ chart.ChartData.SetValue(6, 1, "Camembert Pierrot");
+ chart.ChartData.SetValue(6, 2, 46.825);
+ chart.ChartData.SetValue(7, 1, "Gnocchi di nonna Alice");
+ chart.ChartData.SetValue(7, 2, 42.593);
+ chart.ChartData.SetValue(8, 1, "Manjimup Dried Apples");
+ chart.ChartData.SetValue(8, 2, 41.819);
+ chart.ChartData.SetValue(9, 1, "Alice Mutton");
+ chart.ChartData.SetValue(9, 2, 32.698);
+ chart.ChartData.SetValue(10, 1, "Carnarvon Tigers");
+ chart.ChartData.SetValue(10, 2, 29.171);
+ chart.ChartData.SetValue(11, 1, "R�ssle Sauerkraut.");
+ chart.ChartData.SetValue(11, 2, 25.696);
+ //Create a new chart series with the name �Sales�
+ IOfficeChartSerie pieSeries = chart.Series.Add("Sales");
+ pieSeries.Values = chart.ChartData[2, 2, 11, 2];
+ //Set data label
+ pieSeries.DataPoints.DefaultDataPoint.DataLabels.IsValue = true;
+ pieSeries.DataPoints.DefaultDataPoint.DataLabels.Position = OfficeDataLabelPosition.Outside;
+ //Set background color
+ chart.ChartArea.Fill.ForeColor = Color.FromArgb(242, 242, 242);
+ chart.PlotArea.Fill.ForeColor = Color.FromArgb(242, 242, 242);
+ chart.ChartArea.Border.LinePattern = OfficeChartLinePattern.None;
+ //Set category labels
+ chart.PrimaryCategoryAxis.CategoryLabels = chart.ChartData[2, 1, 11, 1];
+ //Save the document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add section to the document
+ Dim sec As IWSection = document.AddSection()
+ 'Add paragraph to the section
+ Dim paragraph As IWParagraph = sec.AddParagraph()
+ 'Create and Append chart to the paragraph
+ Dim chart As WChart = paragraph.AppendChart(446, 270)
+ 'Set chart type
+ chart.ChartType = OfficeChartType.Pie
+ 'Set chart title
+ chart.ChartTitle = "Best Selling Products"
+ chart.ChartTitleArea.FontName = "Calibri"
+ chart.ChartTitleArea.Size = 14
+ 'Set data for chart
+ chart.ChartData.SetValue(1, 1, "")
+ chart.ChartData.SetValue(1, 2, "Sales")
+ chart.ChartData.SetValue(2, 1, "Cote de Blaye")
+ chart.ChartData.SetValue(2, 2, 141.396)
+ chart.ChartData.SetValue(3, 1, "Thuringer Rostbratwurst")
+ chart.ChartData.SetValue(3, 2, 80.368)
+ chart.ChartData.SetValue(4, 1, "Raclette Courdavault")
+ chart.ChartData.SetValue(4, 2, 71.155)
+ chart.ChartData.SetValue(5, 1, "Tarte au sucre")
+ chart.ChartData.SetValue(5, 2, 47.234)
+ chart.ChartData.SetValue(6, 1, "Camembert Pierrot")
+ chart.ChartData.SetValue(6, 2, 46.825)
+ chart.ChartData.SetValue(7, 1, "Gnocchi di nonna Alice")
+ chart.ChartData.SetValue(7, 2, 42.593)
+ chart.ChartData.SetValue(8, 1, "Manjimup Dried Apples")
+ chart.ChartData.SetValue(8, 2, 41.819)
+ chart.ChartData.SetValue(9, 1, "Alice Mutton")
+ chart.ChartData.SetValue(9, 2, 32.698)
+ chart.ChartData.SetValue(10, 1, "Carnarvon Tigers")
+ chart.ChartData.SetValue(10, 2, 29.171)
+ chart.ChartData.SetValue(11, 1, "R�ssle Sauerkraut.")
+ 'Create a new chart series with the name �Sales�
+ Dim pieSeries As IOfficeChartSerie = chart.Series.Add("Sales")
+ pieSeries.Values = chart.ChartData(2, 2, 11, 2)
+ 'Set data label
+ pieSeries.DataPoints.DefaultDataPoint.DataLabels.IsValue = True
+ pieSeries.DataPoints.DefaultDataPoint.DataLabels.Position = OfficeDataLabelPosition.Outside
+ 'Set background color
+ chart.ChartArea.Fill.ForeColor = Color.FromArgb(242, 242, 242)
+ chart.PlotArea.Fill.ForeColor = Color.FromArgb(242, 242, 242)
+ chart.ChartArea.Border.LinePattern = OfficeChartLinePattern.None
+ 'Set category labels
+ chart.PrimaryCategoryAxis.CategoryLabels = chart.ChartData(2, 1, 11, 1)
+ 'Save the document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add section to the document
+ IWSection sec = document.AddSection();
+ //Add paragraph to the section
+ IWParagraph paragraph = sec.AddParagraph();
+ //Load the excel file as stream
+ Stream excelStream = File.OpenRead("Excel_Template.xlsx");
+ //Create and Append chart to the paragraph with excel stream as parameter
+ WChart chart = paragraph.AppendChart(excelStream, 1, "B2:C6", 470, 300);
+ //Set chart type and title
+ chart.ChartType = OfficeChartType.Column_Clustered;
+ chart.ChartTitle = "Purchase Details";
+ chart.ChartTitleArea.FontName = "Calibri";
+ chart.ChartTitleArea.Size = 14;
+ chart.ChartArea.Border.LinePattern = OfficeChartLinePattern.None;
+ //Set name to chart series
+ chart.Series[0].Name = "Sum of Purchases";
+ chart.Series[1].Name = "Sum of Future Expenses";
+ chart.PrimaryCategoryAxis.Title = "Products";
+ chart.PrimaryValueAxis.Title = "In Dollars";
+ //Set position of legend
+ chart.Legend.Position = OfficeLegendPosition.Bottom;
+ //Save the document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add section to the document
+ Dim sec As IWSection = document.AddSection()
+ 'Add paragraph to the section
+ Dim paragraph As IWParagraph = sec.AddParagraph()
+ 'Load the excel file as stream
+ Dim excelStream As Stream = File.OpenRead("Excel_Template.xlsx")
+ 'Create and Append chart to the paragraph with excel stream as parameter
+ Dim chart As WChart = paragraph.AppendChart(excelStream, 1, "B2:C6", 470, 300)
+ 'Set chart type and title
+ chart.ChartType = OfficeChartType.Column_Clustered
+ chart.ChartTitle = "Purchase Details"
+ chart.ChartTitleArea.FontName = "Calibri"
+ chart.ChartTitleArea.Size = 14
+ chart.ChartArea.Border.LinePattern = OfficeChartLinePattern.None
+ 'Set name to chart series
+ chart.Series(0).Name = "Sum of Purchases"
+ chart.Series(1).Name = "Sum of Future Expenses"
+ chart.PrimaryCategoryAxis.Title = "Products"
+ chart.PrimaryValueAxis.Title = "In Dollars"
+ 'Set position of legend
+ chart.Legend.Position = OfficeLegendPosition.Bottom
+ 'Save the document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create an instance of WordDocument class (Empty Word Document)
+ WordDocument document = new WordDocument();
+ //Add a new section into the Word Document
+ IWSection section = document.AddSection();
+ //Add a new paragraph into Word document and append text into paragraph
+ IWParagraph paragraph = section.AddParagraph();
+ paragraph.AppendText("Today's Date: ");
+ //Add the new Date field in Word document with field name and its type.
+ WField field = paragraph.AppendField("Date", FieldType.FieldDate) as WField;
+ //Field code used to describe how to display the date
+ field.FieldCode = @"DATE \@" + "\"MMMM d, yyyy\"";
+ //Save the document in the given name and format
+ document.Save("Sample.docx", FormatType.Docx);
+ //Release the resources occupied by WordDocument instance
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create an instance of WordDocument class (Empty Word Document)
+ Dim document As New WordDocument()
+ 'Add a new section into the Word Document
+ Dim section As IWSection = document.AddSection()
+ 'Add a new paragraph into Word document and append text into paragraph
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ paragraph.AppendText("Today's Date: ")
+ 'Add the new Date field in Word document with field name and its type.
+ Dim field As WField = TryCast(paragraph.AppendField("Date", FieldType.FieldDate), WField)
+ 'Field code used to describe how to display the date
+ field.FieldCode = "DATE \@" + """MMMM d, yyyy"""
+ 'Save the document in the given name and format
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Release the resources occupied by WordDocument instance
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create an instance of WordDocument class (Empty Word Document)
+ WordDocument document = new WordDocument();
+ //Add a new section into the Word Document
+ IWSection section = document.AddSection();
+ //Add a new paragraph into Word document and append text into paragraph
+ IWParagraph paragraph = section.AddParagraph();
+ paragraph.AppendText("Northwind Database");
+ paragraph.ParagraphFormat.HorizontalAlignment = Syncfusion.DocIO.DLS.HorizontalAlignment.Center;
+ //Add a paragraph into section
+ paragraph = section.AddParagraph();
+ //Add a new bookmark start into paragraph with name "Northwind"
+ paragraph.AppendBookmarkStart("Northwind");
+ //Add a text between the bookmark start and end into paragraph
+ paragraph.AppendText("The Northwind sample database (Northwind.mdb) is included with all versions of Access. It provides data you can experiment with and database objects that demonstrate features you might want to implement in your own databases.");
+ //Add a new bookmark end into paragraph with name " Northwind "
+ paragraph.AppendBookmarkEnd("Northwind");
+ //Add a text after the bookmark end
+ paragraph.AppendText(" Using Northwind, you can become familiar with how a relational database is structured and how the database objects work together to help you enter, store, manipulate, and print your data.");
+ //Save the document in the given name and format
+ document.Save("Bookmarks.docx", FormatType.Docx);
+ //Release the resources occupied by WordDocument instance
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create an instance of WordDocument class (Empty Word Document)
+ Dim document As New WordDocument()
+ 'Add a new section into the Word Document
+ Dim section As IWSection = document.AddSection()
+ 'Add a new paragraph into Word document and append text into paragraph
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ paragraph.AppendText("Northwind Database")
+ paragraph.ParagraphFormat.HorizontalAlignment = Syncfusion.DocIO.DLS.HorizontalAlignment.Center
+ 'Add a paragraph into section
+ paragraph = section.AddParagraph()
+ 'Add a new bookmark start into paragraph with name "Northwind"
+ paragraph.AppendBookmarkStart("Northwind")
+ 'Add a text between the bookmark start and end into paragraph
+ paragraph.AppendText("The Northwind sample database (Northwind.mdb) is included with all versions of Access. It provides data you can experiment with and database objects that demonstrate features you might want to implement in your own databases.")
+ 'Add a new bookmark end into paragraph with name " Northwind "
+ paragraph.AppendBookmarkEnd("Northwind")
+ 'Add a text after the bookmark end
+ paragraph.AppendText(" Using Northwind, you can become familiar with how a relational database is structured and how the database objects work together to help you enter, store, manipulate, and print your data.")
+ 'Save the document in the given name and format
+ document.Save("Bookmarks.docx", FormatType.Docx)
+ 'Release the resources occupied by WordDocument instance
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create an instance of WordDocument class (Empty Word Document)
+ WordDocument document = new WordDocument();
+ //Add a new section into the Word Document
+ IWSection section = document.AddSection();
+ //Add a new paragraph into Word document and append text into paragraph
+ IWParagraph paragraph = section.AddParagraph();
+ paragraph.AppendText("Northwind Database");
+ paragraph.ParagraphFormat.HorizontalAlignment = Syncfusion.DocIO.DLS.HorizontalAlignment.Center;
+ //Add a paragraph into section
+ paragraph = section.AddParagraph();
+ //Add a new bookmark start into paragraph with name "Northwind"
+ paragraph.AppendBookmarkStart("Northwind");
+ //Add a text between the bookmark start and end into paragraph
+ paragraph.AppendText("The Northwind sample database (Northwind.mdb) is included with all versions of Access. It provides data you can experiment with and database objects that demonstrate features you might want to implement in your own databases.");
+ //Add a new bookmark end into paragraph with name " Northwind "
+ paragraph.AppendBookmarkEnd("Northwind");
+ //Add a text after the bookmark end
+ paragraph.AppendText(" Using Northwind, you can become familiar with how a relational database is structured and how the database objects work together to help you enter, store, manipulate, and print your data.");
+ //Save the document in the given name and format
+ document.Save("Bookmarks.docx", FormatType.Docx);
+ //Release the resources occupied by WordDocument instance
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create an instance of WordDocument class (Empty Word Document)
+ Dim document As New WordDocument()
+ 'Add a new section into the Word Document
+ Dim section As IWSection = document.AddSection()
+ 'Add a new paragraph into Word document and append text into paragraph
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ paragraph.AppendText("Northwind Database")
+ paragraph.ParagraphFormat.HorizontalAlignment = Syncfusion.DocIO.DLS.HorizontalAlignment.Center
+ 'Add a paragraph into section
+ paragraph = section.AddParagraph()
+ 'Add a new bookmark start into paragraph with name "Northwind"
+ paragraph.AppendBookmarkStart("Northwind")
+ 'Add a text between the bookmark start and end into paragraph
+ paragraph.AppendText("The Northwind sample database (Northwind.mdb) is included with all versions of Access. It provides data you can experiment with and database objects that demonstrate features you might want to implement in your own databases.")
+ 'Add a new bookmark end into paragraph with name " Northwind "
+ paragraph.AppendBookmarkEnd("Northwind")
+ 'Add a text after the bookmark end
+ paragraph.AppendText(" Using Northwind, you can become familiar with how a relational database is structured and how the database objects work together to help you enter, store, manipulate, and print your data.")
+ 'Save the document in the given name and format
+ document.Save("Bookmarks.docx", FormatType.Docx)
+ 'Release the resources occupied by WordDocument instance
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Creates a new Word document.
+ WordDocument document = new WordDocument();
+ //Add a section and a paragraph in the document
+ document.EnsureMinimal();
+ IWParagraph paragraph = document.LastParagraph;
+ //Append text to the paragraph
+ paragraph.AppendText("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua");
+ //Add comment to a paragraph
+ WComment comment = paragraph.AppendComment("comment test");
+ //Specify the author of the comment
+ comment.Format.User = "Peter";
+ //Specify the initial of the author
+ comment.Format.UserInitials = "St";
+ //Save and close the Word document
+ document.Save("Comment.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Creates a new Word document.
+ Dim document As New WordDocument()
+ 'Add a section and a paragraph in the document
+ document.EnsureMinimal()
+ Dim paragraph As IWParagraph = document.LastParagraph
+ 'Append text to the paragraph
+ paragraph.AppendText("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua")
+ 'Add comment to a paragraph
+ Dim comment As WComment = paragraph.AppendComment("comment test")
+ 'Specify the author of the comment
+ comment.Format.User = "Peter"
+ 'Specify the initial of the author
+ comment.Format.UserInitials = "St"
+ 'Save and close the Word document
+ document.Save("Comment.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Create a section
+ IWSection section = document.AddSection();
+ //Add a paragraph to a section
+ IWParagraph paragraph = section.AddParagraph();
+ //Append the text to paragraph
+ paragraph.AppendText("Working with footnotes");
+ //Formatting the text
+ paragraph.ApplyStyle(BuiltinStyle.Heading1);
+ //Add a paragraph to a section
+ paragraph = section.AddParagraph();
+ //Append the footnotes
+ WFootnote footnote = (WFootnote) paragraph.AppendFootnote(Syncfusion.DocIO.FootnoteType.Footnote);
+ //Set the footnote character format
+ footnote.MarkerCharacterFormat.SubSuperScript = SubSuperScript.SuperScript;
+ //Inserts the text into the paragraph
+ paragraph.AppendText("Sample content for footnotes").CharacterFormat.Bold = true;
+ //Add footnote text
+ paragraph = footnote.TextBody.AddParagraph();
+ paragraph.AppendText("Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula");
+ //Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Create a section
+ Dim section As IWSection = document.AddSection()
+ 'Add a paragraph to a section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Append the text to paragraph
+ paragraph.AppendText("Working with footnotes")
+ 'Formatting the text
+ paragraph.ApplyStyle(BuiltinStyle.Heading1)
+ 'Add a paragraph to a section
+ paragraph = section.AddParagraph()
+ 'Append the footnotes
+ Dim footnote As WFootnote = DirectCast(paragraph.AppendFootnote(Syncfusion.DocIO.FootnoteType.Footnote), WFootnote)
+ 'Set the footnote character format
+ footnote.MarkerCharacterFormat.SubSuperScript = SubSuperScript.SuperScript
+ 'Inserts the text into the paragraph
+ paragraph.AppendText("Sample content for footnotes").CharacterFormat.Bold = True
+ 'Add footnote text
+ paragraph = footnote.TextBody.AddParagraph()
+ paragraph.AppendText("Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula")
+ �Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new document
+ WordDocument document = new WordDocument();
+ //Create a section
+ IWSection section = document.AddSection();
+ //Add a paragraph to a section
+ IWParagraph paragraph = section.AddParagraph();
+ //Append the text to paragraph
+ paragraph.AppendText("Working with endnotes");
+ //Formatting the text
+ paragraph.ApplyStyle(BuiltinStyle.Heading1);
+ //Add a paragraph to a section
+ paragraph = section.AddParagraph();
+ //Append the endnote
+ WFootnote endnote = (WFootnote) paragraph.AppendFootnote(Syncfusion.DocIO.FootnoteType.Endnote);
+ //Set the endnote character format
+ endnote.MarkerCharacterFormat.SubSuperScript = SubSuperScript.SuperScript;
+ //Insert the text into the paragraph
+ paragraph.AppendText("Sample content for endnotes").CharacterFormat.Bold = true;
+ //Add footnote text
+ paragraph = endnote.TextBody.AddParagraph();
+ paragraph.AppendText("Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula");
+ //Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new document
+ Dim document As New WordDocument()
+ 'Create a section
+ Dim section As IWSection = document.AddSection()
+ 'Add a paragraph to a section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Append the text to paragraph
+ paragraph.AppendText("Working with endnotes")
+ 'Formatting the text
+ paragraph.ApplyStyle(BuiltinStyle.Heading1)
+ 'Add a paragraph to a section
+ paragraph = section.AddParagraph()
+ 'Append the endnote
+ Dim endnote As WFootnote = DirectCast(paragraph.AppendFootnote(Syncfusion.DocIO.FootnoteType.Endnote), WFootnote)
+ 'Set the endnote character format
+ endnote.MarkerCharacterFormat.SubSuperScript = SubSuperScript.SuperScript
+ 'Insert the text into the paragraph
+ paragraph.AppendText("Sample content for endnotes").CharacterFormat.Bold = True
+ 'Add footnote text
+ paragraph = endnote.TextBody.AddParagraph()
+ paragraph.AppendText("Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula")
+ �Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Append new textbox to the paragraph
+ IWTextBox textbox = paragraph.AppendTextBox(150, 75);
+ //Add new text to the textbox body
+ IWParagraph textboxParagraph = textbox.TextBoxBody.AddParagraph();
+ textboxParagraph.AppendText("Text inside text box");
+ //Save and close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Append new textbox to the paragraph
+ Dim textbox As IWTextBox = paragraph.AppendTextBox(150, 75)
+ 'Add new text to the textbox body
+ Dim textboxParagraph As IWParagraph = textbox.TextBoxBody.AddParagraph()
+ textboxParagraph.AppendText("Text inside text box")
+ 'Save and close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ paragraph.AppendText("Example of adding symbols to the paragraph: ");
+ //Insert symbol with character code 100
+ paragraph.AppendSymbol(100);
+ //Save and close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ paragraph.AppendText("Example of adding symbols to the paragraph: ")
+ 'Insert symbol with character code 100
+ paragraph.AppendSymbol(100)
+ 'Save and close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ paragraph.AppendText("Before line break");
+ //Add line break to the paragraph
+ paragraph.AppendBreak(BreakType.LineBreak);
+ paragraph.AppendText("After line break");
+ IWParagraph pageBreakPara = section.AddParagraph();
+ pageBreakPara.AppendText("Before page break");
+ //Add page break to the paragraph
+ pageBreakPara.AppendBreak(BreakType.PageBreak);
+ pageBreakPara.AppendText("After page break");
+ IWSection secondSection = document.AddSection();
+ //Add columns to the section
+ secondSection.AddColumn(100, 2);
+ secondSection.AddColumn(100, 2);
+ IWParagraph columnBreakPara = secondSection.AddParagraph();
+ columnBreakPara.AppendText("Before column break");
+ //Add column break to the paragraph
+ columnBreakPara.AppendBreak(BreakType.ColumnBreak);
+ columnBreakPara.AppendText("After column break");
+ //Save and Close the document instance
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ paragraph.AppendText("Before line break")
+ 'Add line break to the paragraph
+ paragraph.AppendBreak(BreakType.LineBreak)
+ paragraph.AppendText("After line break")
+ Dim pageBreakPara As IWParagraph = section.AddParagraph()
+ pageBreakPara.AppendText("Before page break")
+ 'Add page break to the paragraph
+ pageBreakPara.AppendBreak(BreakType.PageBreak)
+ pageBreakPara.AppendText("After page break")
+ Dim secondSection As IWSection = document.AddSection()
+ 'Add columns to the section
+ secondSection.AddColumn(100, 2)
+ secondSection.AddColumn(100, 2)
+ Dim columnBreakPara As IWParagraph = secondSection.AddParagraph()
+ columnBreakPara.AppendText("Before column break")
+ 'Add column break to the paragraph
+ columnBreakPara.AppendBreak(BreakType.ColumnBreak)
+ columnBreakPara.AppendText("After column break")
+ 'Save and Close the document instance
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ WParagraph paragraph = section.AddParagraph() as WParagraph;
+ //Add new shape to the document
+ Shape rectangle = paragraph.AppendShape(AutoShapeType.RoundedRectangle, 150, 100);
+ //Set position for shape
+ rectangle.VerticalPosition = 72;
+ rectangle.HorizontalPosition = 72;
+ paragraph = section.AddParagraph() as WParagraph;
+ //Add text body contents to the shape
+ paragraph = rectangle.TextBody.AddParagraph() as WParagraph;
+ IWTextRange text = paragraph.AppendText("This text is in rounded rectangle shape");
+ text.CharacterFormat.TextColor = Color.Green;
+ text.CharacterFormat.Bold = true;
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As WParagraph = TryCast(section.AddParagraph(), WParagraph)
+ 'Add new shape to the document
+ Dim rectangle As Shape = paragraph.AppendShape(AutoShapeType.RoundedRectangle, 150, 100)
+ 'Set position for shape
+ rectangle.VerticalPosition = 72
+ rectangle.HorizontalPosition = 72
+ paragraph = TryCast(section.AddParagraph(), WParagraph)
+ 'Add text body contents to the shape
+ paragraph = TryCast(rectangle.TextBody.AddParagraph(), WParagraph)
+ Dim text As IWTextRange = paragraph.AppendText("This text is in rounded rectangle shape")
+ text.CharacterFormat.TextColor = Color.Green
+ text.CharacterFormat.Bold = True
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load the template document
+ WordDocument document = new WordDocument("Template.docx");
+ //Html string to be inserted
+ string htmlstring = "This text is inserted as HTML string.
";
+ IWParagraph paragraph = document.Sections[0].Body.Paragraphs[0];
+ //Append the Html string to first paragraph in the document
+ paragraph.AppendHTML(htmlstring);
+ //Save and close the document
+ document.Save("Sample.docx");
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load the template document
+ Dim document As New WordDocument("Template.docx")
+ 'Html string to be inserted
+ Dim htmlstring As String = "This text is inserted as HTML string.
"
+ Dim paragraph As IWParagraph = document.Sections(0).Body.Paragraphs(0)
+ 'Append the Html string to first paragraph in the document
+ paragraph.AppendHTML(htmlstring)
+ 'Save and close the document
+ document.Save("Sample.docx")
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ WParagraph paragraph = document.Sections[0].Paragraphs[1];
+ //Find the first occurrence of a particular text in the paragraph
+ TextSelection textSelection = paragraph.Find("panda", true, true);
+ //Get the found text as single text range
+ WTextRange textRange = textSelection.GetAsOneRange();
+ //Modify the text
+ textRange.Text = "Replaced text";
+ //Set highlight color
+ textRange.CharacterFormat.HighlightColor = Color.Yellow;
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ Dim paragraph As WParagraph = document.Sections(0).Paragraphs(1)
+ 'Find the first occurrence of a particular text in the paragraph
+ Dim textSelection As TextSelection = paragraph.Find("panda", true, true)
+ 'Get the found text as single text range
+ Dim textRange As WTextRange = textSelection.GetAsOneRange()
+ 'Modify the text
+ textRange.Text = "Replaced text"
+ 'Set highlight color
+ textRange.CharacterFormat.HighlightColor = Color.Yellow
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx");
+ WParagraph paragraph = document.Sections[0].Paragraphs[1];
+ //Find the first occurrence of the regular expression
+ TextSelection selection = paragraph.Find(new Regex("Panda"));
+ //Replace all occurrence of a particular regular expression with the text selection in the paragraph
+ paragraph.Replace("Giant panda", selection, true, false);
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx")
+ Dim paragraph As WParagraph = document.Sections(0).Paragraphs(1)
+ 'Find the first occurrence of the regular expression
+ Dim selection As TextSelection = paragraph.Find(New Regex("Panda"))
+ 'Replace all occurrence of a particular regular expression with the text selection in the paragraph
+ paragraph.Replace("Giant panda", selection, True, False)
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx");
+ WParagraph paragraph = document.Sections[0].Paragraphs[1];
+ //Find the first occurrence of the regular expression
+ TextSelection selection = paragraph.Find(new Regex("Panda"));
+ //Replace all occurrence of a particular regular expression with the text selection in the paragraph
+ paragraph.Replace("Giant panda", selection, true, false, true);
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx")
+ Dim paragraph As WParagraph = document.Sections(0).Paragraphs(1)
+ 'Find the first occurrence of the regular expression
+ Dim selection As TextSelection = paragraph.Find(New Regex("Panda"))
+ 'Replace all occurrence of a particular regular expression with the text selection in the paragraph
+ paragraph.Replace("Giant panda", selection, True, False, False)
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ WParagraph paragraph = section.AddParagraph() as WParagraph;
+ paragraph.AppendText("Gender\t");
+ //Append new Checkbox
+ WCheckBox checkbox = paragraph.AppendCheckBox();
+ checkbox.Checked = false;
+ //Set Checkbox size
+ checkbox.CheckBoxSize = 10;
+ checkbox.CalculateOnExit = true;
+ //Set help text
+ checkbox.Help = "Help text";
+ paragraph.AppendText("Male\t");
+ checkbox = paragraph.AppendCheckBox();
+ checkbox.Checked = false;
+ checkbox.CheckBoxSize = 10;
+ checkbox.CalculateOnExit = true;
+ paragraph.AppendText("Female");
+ //Save the Word document
+ document.Save("Checkbox.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As WParagraph = TryCast(section.AddParagraph(), WParagraph)
+ paragraph.AppendText("Gender" & vbTab)
+ 'Append new Checkbox
+ Dim checkbox As WCheckBox = paragraph.AppendCheckBox()
+ checkbox.Checked = False
+ 'Set Checkbox size
+ checkbox.CheckBoxSize = 10
+ checkbox.CalculateOnExit = True
+ 'Set help text
+ checkbox.Help = "Help text"
+ paragraph.AppendText("Male" & vbTab)
+ checkbox = paragraph.AppendCheckBox()
+ checkbox.Checked = False
+ checkbox.CheckBoxSize = 10
+ checkbox.CalculateOnExit = True
+ paragraph.AppendText("Female")
+ 'Save the Word document
+ document.Save("Checkbox.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ WParagraph paragraph = section.AddParagraph() as WParagraph;
+ paragraph.AppendText("General Information");
+ section.AddParagraph();
+ paragraph = section.AddParagraph() as WParagraph;
+ IWTextRange text = paragraph.AppendText("Name\t");
+ text.CharacterFormat.Bold = true;
+ //Append Text form field
+ WTextFormField textfield = paragraph.AppendTextFormField(null);
+ //Set type of Text form field
+ textfield.Type = TextFormFieldType.RegularText;
+ textfield.CharacterFormat.FontName = "Calibri";
+ textfield.CalculateOnExit = true;
+ //Save the Word document
+ document.Save("Textfield.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As WParagraph = TryCast(section.AddParagraph(), WParagraph)
+ paragraph.AppendText("General Information")
+ section.AddParagraph()
+ paragraph = TryCast(section.AddParagraph(), WParagraph)
+ Dim text As IWTextRange = paragraph.AppendText("Name" & vbTab)
+ text.CharacterFormat.Bold = True
+ 'Append Text form field
+ Dim textfield As WTextFormField = paragraph.AppendTextFormField(Nothing)
+ 'Set type of Text form field
+ textfield.Type = TextFormFieldType.RegularText
+ textfield.CharacterFormat.FontName = "Calibri"
+ textfield.CalculateOnExit = True
+ 'Save the Word document
+ document.Save("Textfield.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ WParagraph paragraph = section.AddParagraph() as WParagraph;
+ paragraph.AppendText("Gender\t");
+ //Append new Checkbox
+ WCheckBox checkbox = paragraph.AppendCheckBox("CheckBox1", true);
+ //checkbox.Checked = false;
+ //Set Checkbox size
+ checkbox.CheckBoxSize = 10;
+ checkbox.CalculateOnExit = true;
+ //Set help text
+ checkbox.Help = "Help text";
+ paragraph.AppendText("Male\t");
+ checkbox = paragraph.AppendCheckBox("CheckBox2",false);
+ //checkbox.Checked = false;
+ checkbox.CheckBoxSize = 10;
+ checkbox.CalculateOnExit = true;
+ paragraph.AppendText("Female");
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As WParagraph = TryCast(section.AddParagraph(), WParagraph)
+ paragraph.AppendText("Gender" & vbTab)
+ 'Append new Checkbox
+ Dim checkbox As WCheckBox = paragraph.AppendCheckBox("CheckBox1", True)
+ 'checkbox.Checked = false;
+ 'Set Checkbox size
+ checkbox.CheckBoxSize = 10
+ checkbox.CalculateOnExit = True
+ 'Set help text
+ checkbox.Help = "Help text"
+ paragraph.AppendText("Male" & vbTab)
+ checkbox = paragraph.AppendCheckBox("CheckBox2", False)
+ 'checkbox.Checked = false;
+ checkbox.CheckBoxSize = 10
+ checkbox.CalculateOnExit = True
+ paragraph.AppendText("Female")
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ WParagraph paragraph = section.AddParagraph() as WParagraph;
+ paragraph.AppendText("General Information");
+ section.AddParagraph();
+ paragraph = section.AddParagraph() as WParagraph;
+ IWTextRange text = paragraph.AppendText("Date of Birth\t");
+ text.CharacterFormat.Bold = true;
+ //Append Text form field
+ WTextFormField textfield = paragraph.AppendTextFormField("Date field", DateTime.Now.ToString("MM/DD/YY"));
+ textfield.StringFormat = "MM/DD/YY";
+ //Set Text form field type
+ textfield.Type = TextFormFieldType.DateText;
+ textfield.CalculateOnExit = true;
+ //Save the Word document
+ document.Save("Textfield.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As WParagraph = TryCast(section.AddParagraph(), WParagraph)
+ paragraph.AppendText("General Information")
+ section.AddParagraph()
+ paragraph = TryCast(section.AddParagraph(), WParagraph)
+ Dim text As IWTextRange = paragraph.AppendText("Date of Birth" & vbTab)
+ text.CharacterFormat.Bold = True
+ 'Append Text form field
+ Dim textfield As WTextFormField = paragraph.AppendTextFormField("Date field", DateTime.Now.ToString("MM/DD/YY"))
+ textfield.StringFormat = "MM/DD/YY"
+ 'Set Text form field type
+ textfield.Type = TextFormFieldType.DateText
+ textfield.CalculateOnExit = True
+ 'Save the Word document
+ document.Save("Textfield.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ WParagraph paragraph = section.AddParagraph() as WParagraph;
+ paragraph.AppendText("Educational Qualification\t");
+ //Append Dropdown field
+ WDropDownFormField dropdownfield = paragraph.AppendDropDownFormField("FieldName");
+ //Add items to the dropdown items collection
+ dropdownfield.DropDownItems.Add("Higher");
+ dropdownfield.DropDownItems.Add("Vocational");
+ dropdownfield.DropDownItems.Add("Universal");
+ dropdownfield.Enabled = true;
+ //Set the item index for default value
+ dropdownfield.DropDownSelectedIndex = 1;
+ dropdownfield.CalculateOnExit = true;
+ //Save the Word document
+ document.Save("Dropdown.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As WParagraph = TryCast(section.AddParagraph(), WParagraph)
+ paragraph.AppendText("Educational Qualification" & vbTab)
+ 'Append Dropdown field
+ Dim dropdownfield As WDropDownFormField = paragraph.AppendDropDownFormField("FieldName")
+ 'Add items to the dropdown items collection
+ dropdownfield.DropDownItems.Add("Higher")
+ dropdownfield.DropDownItems.Add("Vocational")
+ dropdownfield.DropDownItems.Add("Universal")
+ dropdownfield.Enabled = True
+ 'Set the item index for default value
+ dropdownfield.DropDownSelectedIndex = 1
+ dropdownfield.CalculateOnExit = True
+ 'Save the Word document
+ document.Save("Dropdown.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ paragraph.AppendText("Web Hyperlink: ");
+ paragraph = section.AddParagraph();
+ //Append web hyperlink to the paragraph
+ IWField field = paragraph.AppendHyperlink("http://www.syncfusion.com", "Syncfusion", HyperlinkType.WebLink);
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ paragraph.AppendText("Web Hyperlink: ")
+ paragraph = section.AddParagraph()
+ 'Append web hyperlink to the paragraph
+ Dim field As IWField = paragraph.AppendHyperlink("http://www.syncfusion.com", "Syncfusion", HyperlinkType.WebLink)
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ paragraph.AppendText("Image Hyperlink");
+ paragraph = section.AddParagraph();
+ //Create a new image instance and load image
+ WPicture picture = new WPicture(document);
+ picture.LoadImage(Image.FromFile("Image.png"));
+ //Append new image hyperlink to the paragraph
+ paragraph.AppendHyperlink("http://www.syncfusion.com", picture, HyperlinkType.WebLink);
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ paragraph.AppendText("Image Hyperlink")
+ paragraph = section.AddParagraph()
+ 'Create a new image instance and load image
+ Dim picture As New WPicture(document)
+ picture.LoadImage(Image.FromFile("Image.png"))
+ 'Append new image hyperlink to the paragraph
+ paragraph.AppendHyperlink("http://www.syncfusion.com", picture, HyperlinkType.WebLink)
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add the section into the Word document
+ IWSection section = document.AddSection();
+ string paraText = "Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula";
+ //Add the paragraph into the created section
+ IWParagraph paragraph = section.AddParagraph();
+ //Append the TOC field with LowerHeadingLevel and UpperHeadingLevel to determines the TOC entries
+ paragraph.AppendTOC(1, 3);
+ //Add the section into the Word document
+ section = document.AddSection();
+ //Add the paragraph into the created section
+ paragraph = section.AddParagraph();
+ //Add the text for the headings
+ paragraph.AppendText("First Chapter");
+ //Set a build in heading style.
+ paragraph.ApplyStyle(BuiltinStyle.Heading1);
+ //Add the text into the paragraph
+ section.AddParagraph().AppendText(paraText);
+ //Add the section into the Word document
+ section = document.AddSection();
+ //Add the paragraph into the created section
+ paragraph = section.AddParagraph();
+ //Add the text for the headings
+ paragraph.AppendText("Second Chapter");
+ //Set a build in heading style.
+ paragraph.ApplyStyle(BuiltinStyle.Heading2);
+ //Add the text into the paragraph
+ section.AddParagraph().AppendText(paraText);
+ //Add the section into the Word document
+ section = document.AddSection();
+ //Add the paragraph into the created section
+ paragraph = section.AddParagraph();
+ //Add the text into the headings
+ paragraph.AppendText("Third Chapter");
+ //Set a build in heading style
+ paragraph.ApplyStyle(BuiltinStyle.Heading3);
+ //Add the text into the paragraph.
+ section.AddParagraph().AppendText(paraText);
+ //Update the table of contents
+ document.UpdateTableOfContents();
+ //Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add the section into the Word document
+ Dim section As IWSection = document.AddSection()
+ Dim paraText As String = "Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula"
+ 'Add the paragraph into the created section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Append the TOC field with LowerHeadingLevel and UpperHeadingLevel to determines the TOC entries
+ paragraph.AppendTOC(1, 3)
+ 'Add the section into the Word document
+ section = document.AddSection()
+ 'Add the paragraph into the created section
+ paragraph = section.AddParagraph()
+ 'Add the text for the headings
+ paragraph.AppendText("First Chapter")
+ 'Set a build in heading style
+ paragraph.ApplyStyle(BuiltinStyle.Heading1)
+ 'Add the text into the paragraph.
+ section.AddParagraph().AppendText(paraText)
+ 'Add the section into the Word document
+ section = document.AddSection()
+ 'Add the paragraph into the created section
+ paragraph = section.AddParagraph()
+ 'Add the text for the headings
+ paragraph.AppendText("Second Chapter")
+ 'Set a build in heading style
+ paragraph.ApplyStyle(BuiltinStyle.Heading2)
+ 'Add the text into the paragraph
+ section.AddParagraph().AppendText(paraText)
+ 'Add the section into the Word document
+ section = document.AddSection()
+ 'Add the paragraph into the created section
+ paragraph = section.AddParagraph()
+ 'Add the text into the headings
+ paragraph.AppendText("Third Chapter")
+ 'Set a build in heading style
+ paragraph.ApplyStyle(BuiltinStyle.Heading3)
+ 'Add the text into the paragraph
+ section.AddParagraph().AppendText(paraText)
+ 'Update the table of contents
+ document.UpdateTableOfContents()
+ �Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ IWSection section = document.AddSection();
+ IWParagraph paragraph = section.AddParagraph();
+ //Add text, bookmark start and end in the paragraph
+ paragraph.AppendBookmarkStart("Title");
+ paragraph.AppendText("Northwind Database");
+ paragraph.AppendBookmarkEnd("Title");
+ paragraph = section.AddParagraph();
+ paragraph.AppendText("The Northwind sample database (Northwind.mdb) is included with all versions of Access. It provides data you can experiment with and database objects that demonstrate features you might want to implement in your own databases.");
+ section = document.AddSection();
+ section.AddParagraph();
+ paragraph = section.AddParagraph() as WParagraph;
+ //Get the collection of bookmark start in the word document
+ List<Entity> items = document.GetCrossReferenceItems(ReferenceType.Bookmark);
+ paragraph.AppendText("Bookmark Cross Reference starts here ");
+ //Append the cross reference for bookmark �Title� with ContentText as reference kind
+ paragraph.AppendCrossReference(ReferenceType.Bookmark, ReferenceKind.ContentText, items[0], true, false, false, string.Empty);
+ //Update the document Fields
+ document.UpdateDocumentFields();
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ Dim section As IWSection = document.AddSection()
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add text, bookmark start and end in the paragraph
+ paragraph.AppendBookmarkStart("Title")
+ paragraph.AppendText("Northwind Database")
+ paragraph.AppendBookmarkEnd("Title")
+ paragraph = section.AddParagraph()
+ paragraph.AppendText("The Northwind sample database (Northwind.mdb) is included with all versions of Access. It provides data you can experiment with and database objects that demonstrate features you might want to implement in your own databases.")
+ section = document.AddSection()
+ section.AddParagraph()
+ paragraph = TryCast(section.AddParagraph(), WParagraph)
+ 'Get the collection of bookmark start in the word document
+ Dim items As List(Of Entity) = document.GetCrossReferenceItems(ReferenceType.Bookmark)
+ paragraph.AppendText("Bookmark Cross Reference starts here ")
+ 'Append the cross reference for bookmark �Title� with ContentText as reference kind
+ paragraph.AppendCrossReference(ReferenceType.Bookmark, ReferenceKind.ContentText, items(0), True, False, False, String.Empty)
+ 'Update the document Fields
+ document.UpdateDocumentFields()
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Open the file to be embedded
+ FileStream stream = new FileStream("Book1.xlsx", FileMode.Open);
+ //Load the picture instance with the image need to be displayed
+ WPicture picture = new WPicture(document);
+ picture.LoadImage(Image.FromFile("Image.png"));
+ //Append the Ole object to the paragraph
+ WOleObject ole = paragraph.AppendOleObject(stream, picture, OleObjectType.ExcelWorksheet);
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Open the file to be embedded
+ Dim stream As New FileStream("Book1.xlsx", FileMode.Open)
+ 'Load the picture instance with the image need to be displayed
+ Dim picture As New WPicture(document)
+ picture.LoadImage(Image.FromFile("Image.png"))
+ 'Append the Ole object to the paragraph
+ Dim ole As WOleObject = paragraph.AppendOleObject(stream, picture, OleObjectType.ExcelWorksheet)
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add section to the document
+ IWSection sec = document.AddSection();
+ //Add paragraph to the section
+ IWParagraph paragraph = sec.AddParagraph();
+ //Load the picture instance with the image need to be displayed
+ WPicture picture = new WPicture(document);
+ picture.LoadImage(Image.FromFile("Image.png"));
+ //Get the file as byte array
+ byte[] olebytes = File.ReadAllBytes("Excel_Template.xlsx");
+ paragraph = sec.AddParagraph();
+ //Append OLE object
+ paragraph.AppendOleObject(olebytes, picture, OleObjectType.ExcelWorksheet);
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Word2010);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add section to the document
+ Dim sec As IWSection = document.AddSection()
+ 'Add paragraph to the section
+ Dim paragraph As IWParagraph = sec.AddParagraph()
+ 'Load the picture instance with the image need to be displayed
+ Dim picture As New WPicture(document)
+ picture.LoadImage(Image.FromFile("Image.png"))
+ 'Get the file as byte array
+ Dim olebytes As Byte() = File.ReadAllBytes("Excel_Template.xlsx")
+ paragraph = sec.AddParagraph()
+ 'Append OLE object
+ paragraph.AppendOleObject(olebytes, picture, OleObjectType.ExcelWorksheet)
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Word2010)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add section to the document
+ IWSection sec = document.AddSection();
+ //Add paragraph to the section
+ IWParagraph paragraph = sec.AddParagraph();
+ //Load the picture instance with the image need to be displayed
+ WPicture picture = new WPicture(document);
+ picture.LoadImage(Image.FromFile("Image.png"));
+ FileStream stream = new FileStream("Excel_Template.xlsx", FileMode.Open);
+ WOleObject ole = paragraph.AppendOleObject(stream, picture, OleLinkType.Embed);
+ ole.ObjectType = "Excel Worksheet";
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Word2010);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add section to the document
+ Dim sec As IWSection = document.AddSection()
+ 'Add paragraph to the section
+ Dim paragraph As IWParagraph = sec.AddParagraph()
+ 'Load the picture instance with the image need to be displayed
+ Dim picture As New WPicture(document)
+ picture.LoadImage(Image.FromFile("Image.png"))
+ Dim stream As New FileStream("Excel_Template.xlsx", FileMode.Open)
+ Dim ole As WOleObject = paragraph.AppendOleObject(stream, picture, OleLinkType.Embed)
+ ole.ObjectType = "Excel Worksheet"
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Word2010)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add section to the document
+ IWSection sec = document.AddSection();
+ //Add paragraph to the section
+ IWParagraph paragraph = sec.AddParagraph();
+ //Load the picture instance with the image need to be displayed
+ WPicture picture = new WPicture(document);
+ picture.LoadImage(Image.FromFile("Image.png"));
+ //Get the file as byte array
+ byte[] olebytes = File.ReadAllBytes("Excel_Template.xlsx");
+ WOleObject ole = paragraph.AppendOleObject(olebytes, picture, OleLinkType.Embed);
+ ole.ObjectType = "Excel Worksheet";
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Word2010);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add section to the document
+ Dim sec As IWSection = document.AddSection()
+ 'Add paragraph to the section
+ Dim paragraph As IWParagraph = sec.AddParagraph()
+ 'Load the picture instance with the image need to be displayed
+ Dim picture As New WPicture(document)
+ picture.LoadImage(Image.FromFile("Image.png"))
+ 'Get the file as byte array
+ Dim olebytes As Byte() = File.ReadAllBytes("Excel_Template.xlsx")
+ Dim ole As WOleObject = paragraph.AppendOleObject(olebytes, picture, OleLinkType.Embed)
+ ole.ObjectType = "Excel Worksheet"
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Word2010)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add section to the document
+ IWSection sec = document.AddSection();
+ //Add paragraph to the section
+ IWParagraph paragraph = sec.AddParagraph();
+ //Load the picture instance with the image need to be displayed
+ WPicture picture = new WPicture(document);
+ picture.LoadImage(Image.FromFile("Image.png"));
+ //Get the file as byte array
+ byte[] olebytes = File.ReadAllBytes("Excel_Template.xlsx");
+ paragraph = sec.AddParagraph();
+ //Append OLE object
+ paragraph.AppendOleObject(olebytes, picture, ".xlsx");
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Word2010);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add section to the document
+ Dim sec As IWSection = document.AddSection()
+ 'Add paragraph to the section
+ Dim paragraph As IWParagraph = sec.AddParagraph()
+ 'Load the picture instance with the image need to be displayed
+ Dim picture As New WPicture(document)
+ picture.LoadImage(Image.FromFile("Image.png"))
+ 'Get the file as byte array
+ Dim olebytes As Byte() = File.ReadAllBytes("Excel_Template.xlsx")
+ paragraph = sec.AddParagraph()
+ 'Append OLE object
+ paragraph.AppendOleObject(olebytes, picture, ".xlsx")
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Word2010)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Open the file to be embedded
+ FileStream stream = new FileStream("Excel_Template.xlsx", FileMode.Open);
+ //Load the picture instance with the image need to be displayed
+ WPicture picture = new WPicture(document);
+ picture.LoadImage(Image.FromFile("Image.png"));
+ //Append the Ole object to the paragraph
+ WOleObject ole = paragraph.AppendOleObject(stream, picture, "xlsx");
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Open the file to be embedded
+ Dim stream As New FileStream("Excel_Template.xlsx", FileMode.Open)
+ 'Load the picture instance with the image need to be displayed
+ Dim picture As New WPicture(document)
+ picture.LoadImage(Image.FromFile("Image.png"))
+ 'Append the Ole object to the paragraph
+ Dim ole As WOleObject = paragraph.AppendOleObject(stream, picture, "xlsx")
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add section to the document
+ IWSection sec = document.AddSection();
+ //Add paragraph to the section
+ IWParagraph paragraph = sec.AddParagraph();
+ //Load the picture instance with the image need to be displayed
+ WPicture picture = new WPicture(document);
+ picture.LoadImage(Image.FromFile("Image.png"));
+ paragraph = sec.AddParagraph();
+ paragraph.AppendOleObject(@"..\..\Data\Excel_Template.xlsx", picture, OleObjectType.ExcelWorksheet);
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add section to the document
+ Dim sec As IWSection = document.AddSection()
+ 'Add paragraph to the section
+ Dim paragraph As IWParagraph = sec.AddParagraph()
+ 'Load the picture instance with the image need to be displayed
+ Dim picture As New WPicture(document)
+ picture.LoadImage(Image.FromFile("Image.png"))
+ paragraph = sec.AddParagraph()
+ paragraph.AppendOleObject("..\..\Data\Excel_Template.xlsx", picture, OleObjectType.ExcelWorksheet)
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add section to the document
+ IWSection sec = document.AddSection();
+ //Add paragraph to the section
+ IWParagraph paragraph = sec.AddParagraph();
+ //Load the picture instance with the image need to be displayed
+ WPicture picture = new WPicture(document);
+ picture.LoadImage(Image.FromFile("Image.png"));
+ WOleObject ole = paragraph.AppendOleObject(@"..\..\Data\Excel_Template.xlsx", picture);
+ //Set how to display the Ole object
+ ole.DisplayAsIcon = false;
+ //Save and close the document
+ document.Save("Sample.docx");
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add section to the document
+ Dim sec As IWSection = document.AddSection()
+ 'Add paragraph to the section
+ Dim paragraph As IWParagraph = sec.AddParagraph()
+ 'Load the picture instance with the image need to be displayed
+ Dim picture As New WPicture(document)
+ picture.LoadImage(Image.FromFile("Image.png"))
+ Dim ole As WOleObject = paragraph.AppendOleObject("..\..\Data\Excel_Template.xlsx", picture)
+ 'Set how to display the Ole object
+ ole.DisplayAsIcon = False
+ 'Save and close the document
+ document.Save("Sample.docx")
+ document.Close()
+ End Sub
+
+
+ //Create a new Word document
+ using(WordDocument wordDocument = new WordDocument())
+ {
+ //Adds one section and one paragraph to the document
+ wordDocument.EnsureMinimal();
+ //Appends a new mathematical equation to the paragraph using LaTeX syntax.
+ wordDocument.LastParagraph.AppendMath(@"\dot{a}");
+ //Saves the Word document
+ wordDocument.Save("Result.docx", FormatType.Docx);
+ }
+
+
+ 'Create a new Word document
+ Dim wordDocument As New WordDocument()
+ 'Adds one section and one paragraph to the document
+ wordDocument.EnsureMinimal()
+ 'Appends a new mathematical equation to the paragraph using LaTeX syntax.
+ wordDocument.LastParagraph.AppendMath("\dot{a}")
+ 'Saves the Word document
+ wordDocument.Save("Result.docx", FormatType.Docx)
+ 'Close the document
+ wordDocument.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ document.EnsureMinimal();
+ //Add text to the first section
+ document.LastParagraph.AppendText("First section");
+ //Insert section break
+ WSection newsection = document.LastParagraph.InsertSectionBreak();
+ //Add new paragraph to the second section
+ IWParagraph paragraph = newsection.AddParagraph();
+ paragraph.AppendText("Second section");
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ document.EnsureMinimal()
+ 'Add text to the first section
+ document.LastParagraph.AppendText("First section")
+ 'Insert section break
+ Dim newsection As WSection = document.LastParagraph.InsertSectionBreak()
+ 'Add new paragraph to the second section
+ Dim paragraph As IWParagraph = newsection.AddParagraph()
+ paragraph.AppendText("Second section")
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ document.EnsureMinimal();
+ //Add text to the first section
+ document.LastParagraph.AppendText("First section");
+ //Insert section break
+ WSection newsection = document.LastParagraph.InsertSectionBreak(SectionBreakCode.Oddpage);
+ //Add new paragraph to the second section
+ IWParagraph paragraph = newsection.AddParagraph();
+ paragraph.AppendText("Second section");
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ document.EnsureMinimal()
+ 'Add text to the first section
+ document.LastParagraph.AppendText("First section")
+ 'Insert section break
+ Dim newsection As WSection = document.LastParagraph.InsertSectionBreak(SectionBreakCode.Oddpage)
+ 'Add new paragraph to the second section
+ Dim paragraph As IWParagraph = newsection.AddParagraph()
+ paragraph.AppendText("Second section")
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ // Loads an existing Word document into DocIO instance.
+ WordDocument document = new WordDocument("Template.docx");
+ //Gets the document text
+ document.GetText();
+ // Gets a numeric string value of the numbering list paragraph.
+ String listString = document.LastParagraph.ListString;
+ // Saves the document in the given name and format.
+ document.Save("Document.docx", FormatType.Docx);
+ // Releases the resources occupied by WordDocument instance.
+ document.Close();
+
+
+ ' Loads an existing Word document into DocIO instance.
+ Dim document As WordDocument = New WordDocument("Template.docx")
+ ' Gets the document text.
+ document.GetText()
+ ' Gets a numeric string value of the numbering list paragraph
+ Dim listString As String = document.LastParagraph.ListString
+ ' Saves the document in the given name and format.
+ document.Save("Document.docx", FormatType.Docx)
+ ' Releases the resources occupied by WordDocument instance.
+ document.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add new text to the paragraph
+ IWTextRange text = paragraph.AppendText("A new text is added to the paragraph.");
+ text.CharacterFormat.FontSize = 14;
+ text.CharacterFormat.Bold = true;
+ text.CharacterFormat.TextColor = Color.Green;
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add new text to the paragraph
+ Dim text As IWTextRange = paragraph.AppendText("A new text is added to the paragraph.")
+ text.CharacterFormat.FontSize = 14
+ text.CharacterFormat.Bold = True
+ text.CharacterFormat.TextColor = Color.Green
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add new inline control to the paragraph
+ IInlineContentControl inlineControl = paragraph.AppendInlineContentControl(ContentControlType.RichText);
+ WTextRange controlText = new WTextRange(document);
+ controlText.CharacterFormat.Bold = true;
+ controlText.CharacterFormat.TextColor = Color.Green;
+ controlText.Text = "Inline content control inserted.";
+ //Add text range to the control added
+ inlineControl.ParagraphItems.Add(controlText);
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add new inline control to the paragraph
+ Dim inlineControl As IInlineContentControl = paragraph.AppendInlineContentControl(ContentControlType.RichText)
+ Dim textRange As New WTextRange(document)
+ textRange.CharacterFormat.Bold = True
+ textRange.CharacterFormat.TextColor = Color.Green
+ textRange.Text = "Inline content control inserted."
+ 'Add text range to the control added
+ inlineControl.ParagraphItems.Add(textRange)
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph firstParagraph = section.AddParagraph();
+ //Get the image and convert to byte array.
+ Image image = Image.FromFile("Image.png");
+ MemoryStream stream = new MemoryStream();
+ image.Save(stream, System.Drawing.Imaging.ImageFormat.Png);
+ byte[] imageBytes = stream.ToArray();
+ //Add image to the paragraph
+ IWPicture picture = firstParagraph.AppendPicture(imageBytes);
+ //Set height and width for the image
+ picture.Height = 100;
+ picture.Width = 100;
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim firstParagraph As IWParagraph = section.AddParagraph()
+ 'Get the image and convert to byte array.
+ Dim image__1 As Image = Image.FromFile("Image.png")
+ Dim stream As New MemoryStream()
+ image__1.Save(stream, System.Drawing.Imaging.ImageFormat.Png)
+ Dim imageBytes As Byte() = stream.ToArray()
+ 'Add image to the paragraph
+ Dim picture As IWPicture = firstParagraph.AppendPicture(imageBytes)
+ 'Set height and width for the image
+ picture.Height = 100
+ picture.Width = 100
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph firstParagraph = section.AddParagraph();
+ //Get the image as byte array.
+ byte[] imageBytes = File.ReadAllBytes("Image.png");
+ //Get the SVG image as byte array.
+ byte[] svgData = File.ReadAllBytes("Image.svg");
+ //Add SVG image to the paragraph
+ IWPicture picture = firstParagraph.AppendPicture(svgData, imageBytes);
+ //Set height and width for the image
+ picture.Height = 100;
+ picture.Width = 100;
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim firstParagraph As IWParagraph = section.AddParagraph()
+ 'Get the png image as byte array.
+ Dim imageBytes As Byte() = File.ReadAllBytes("Image.png")
+ 'Get the SVG image as byte array.
+ Dim svgData As Byte() = File.ReadAllBytes("Image.svg")
+ 'Add SVG image to the paragraph
+ Dim picture As IWPicture = firstParagraph.AppendPicture(svgData, imageBytes);
+ 'Set height and width for the image
+ picture.Height = 100
+ picture.Width = 100
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add section to the document
+ IWSection sec = document.AddSection();
+ //Add paragraph to the section
+ IWParagraph paragraph = sec.AddParagraph();
+ //Input data for chart
+ object[][] data = new object[6][];
+ for (int i = 0; i < 6; i++)
+ data[i] = new object[3];
+ data[0][0] = "";
+ data[1][0] = "Gravad lax";
+ data[2][0] = "Louisiana Hot spiced Okara";
+ data[3][0] = "Mascarpone Fabioli";
+ data[4][0] = "Wimmers gute SemmelKnodel";
+ data[5][0] = "Maxilaku";
+ data[0][1] = "Sum of Purchases";
+ data[1][1] = 286;
+ data[2][1] = 680;
+ data[3][1] = 288;
+ data[4][1] = 200;
+ data[5][1] = 731;
+ data[0][2] = "Sum of Future Expenses";
+ data[1][2] = 1300;
+ data[2][2] = 700;
+ data[3][2] = 1280;
+ data[4][2] = 1200;
+ data[5][2] = 2660; ///
+ //Create and Append chart to the paragraph
+ WChart chart = paragraph.AppendChart(data, 470, 300);
+ //Set chart type and title
+ chart.ChartTitle = "Purchase Details";
+ chart.ChartTitleArea.FontName = "Calibri";
+ chart.ChartTitleArea.Size = 14;
+ chart.ChartArea.Border.LinePattern = OfficeChartLinePattern.None;
+ //Set series type
+ chart.Series[0].SerieType = OfficeChartType.Line_Markers;
+ chart.Series[1].SerieType = OfficeChartType.Bar_Clustered;
+ chart.PrimaryCategoryAxis.Title = "Products";
+ chart.PrimaryValueAxis.Title = "In Dollars";
+ //Set position of legend
+ chart.Legend.Position = OfficeLegendPosition.Bottom;
+ //Save the document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add section to the document
+ Dim sec As IWSection = document.AddSection()
+ 'Add paragraph to the section
+ Dim paragraph As IWParagraph = sec.AddParagraph()
+ 'Input data for chart
+ Dim data As Object()() = New Object(5)() {}
+ For i As Integer = 0 To 5
+ data(i) = New Object(2) {}
+ Next
+ data(0)(0) = ""
+ data(1)(0) = "Gravad lax"
+ data(2)(0) = "Louisiana Hot spiced Okara"
+ data(3)(0) = "Mascarpone Fabioli"
+ data(4)(0) = "Wimmers gute SemmelKnodel"
+ data(5)(0) = "Maxilaku"
+ data(0)(1) = "Sum of Purchases"
+ data(1)(1) = 286
+ data(2)(1) = 680
+ data(3)(1) = 288
+ data(4)(1) = 200
+ data(5)(1) = 731
+ data(0)(2) = "Sum of Future Expenses"
+ data(1)(2) = 1300
+ data(2)(2) = 700
+ data(3)(2) = 1280
+ data(4)(2) = 1200
+ data(5)(2) = 2660
+ 'Create and Append chart to the paragraph
+ Dim chart As WChart = paragraph.AppendChart(data, 470, 300)
+ 'Set chart type and title
+ chart.ChartTitle = "Purchase Details"
+ chart.ChartTitleArea.FontName = "Calibri"
+ chart.ChartTitleArea.Size = 14
+ chart.ChartArea.Border.LinePattern = OfficeChartLinePattern.None
+ 'Set series type
+ chart.Series(0).SerieType = OfficeChartType.Line_Markers
+ chart.Series(1).SerieType = OfficeChartType.Bar_Clustered
+ chart.PrimaryCategoryAxis.Title = "Products"
+ chart.PrimaryValueAxis.Title = "In Dollars"
+ 'Set position of legend
+ chart.Legend.Position = OfficeLegendPosition.Bottom
+ 'Save the document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add section to the document
+ IWSection sec = document.AddSection();
+ //Add paragraph to the section
+ IWParagraph paragraph = sec.AddParagraph();
+ //Create and Append chart to the paragraph
+ WChart chart = paragraph.AppendChart(446, 270);
+ //Set chart type
+ chart.ChartType = OfficeChartType.Pie;
+ //Set chart title
+ chart.ChartTitle = "Best Selling Products";
+ chart.ChartTitleArea.FontName = "Calibri";
+ chart.ChartTitleArea.Size = 14;
+ //Set data for chart
+ chart.ChartData.SetValue(1, 1, "");
+ chart.ChartData.SetValue(1, 2, "Sales");
+ chart.ChartData.SetValue(2, 1, "Cote de Blaye");
+ chart.ChartData.SetValue(2, 2, 141.396);
+ chart.ChartData.SetValue(3, 1, "Thuringer Rostbratwurst");
+ chart.ChartData.SetValue(3, 2, 80.368);
+ chart.ChartData.SetValue(4, 1, "Raclette Courdavault");
+ chart.ChartData.SetValue(4, 2, 71.155);
+ chart.ChartData.SetValue(5, 1, "Tarte au sucre");
+ chart.ChartData.SetValue(5, 2, 47.234);
+ chart.ChartData.SetValue(6, 1, "Camembert Pierrot");
+ chart.ChartData.SetValue(6, 2, 46.825);
+ chart.ChartData.SetValue(7, 1, "Gnocchi di nonna Alice");
+ chart.ChartData.SetValue(7, 2, 42.593);
+ chart.ChartData.SetValue(8, 1, "Manjimup Dried Apples");
+ chart.ChartData.SetValue(8, 2, 41.819);
+ chart.ChartData.SetValue(9, 1, "Alice Mutton");
+ chart.ChartData.SetValue(9, 2, 32.698);
+ chart.ChartData.SetValue(10, 1, "Carnarvon Tigers");
+ chart.ChartData.SetValue(10, 2, 29.171);
+ chart.ChartData.SetValue(11, 1, "Rössle Sauerkraut.");
+ chart.ChartData.SetValue(11, 2, 25.696);
+ //Create a new chart series with the name Sales
+ IOfficeChartSerie pieSeries = chart.Series.Add("Sales");
+ pieSeries.Values = chart.ChartData[2, 2, 11, 2];
+ //Set data label
+ pieSeries.DataPoints.DefaultDataPoint.DataLabels.IsValue = true;
+ pieSeries.DataPoints.DefaultDataPoint.DataLabels.Position = OfficeDataLabelPosition.Outside;
+ //Set background color
+ chart.ChartArea.Fill.ForeColor = Color.FromArgb(242, 242, 242);
+ chart.PlotArea.Fill.ForeColor = Color.FromArgb(242, 242, 242);
+ chart.ChartArea.Border.LinePattern = OfficeChartLinePattern.None;
+ //Set category labels
+ chart.PrimaryCategoryAxis.CategoryLabels = chart.ChartData[2, 1, 11, 1];
+ //Save the document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add section to the document
+ Dim sec As IWSection = document.AddSection()
+ 'Add paragraph to the section
+ Dim paragraph As IWParagraph = sec.AddParagraph()
+ 'Create and Append chart to the paragraph
+ Dim chart As WChart = paragraph.AppendChart(446, 270)
+ 'Set chart type
+ chart.ChartType = OfficeChartType.Pie
+ 'Set chart title
+ chart.ChartTitle = "Best Selling Products"
+ chart.ChartTitleArea.FontName = "Calibri"
+ chart.ChartTitleArea.Size = 14
+ 'Set data for chart
+ chart.ChartData.SetValue(1, 1, "")
+ chart.ChartData.SetValue(1, 2, "Sales")
+ chart.ChartData.SetValue(2, 1, "Cote de Blaye")
+ chart.ChartData.SetValue(2, 2, 141.396)
+ chart.ChartData.SetValue(3, 1, "Thuringer Rostbratwurst")
+ chart.ChartData.SetValue(3, 2, 80.368)
+ chart.ChartData.SetValue(4, 1, "Raclette Courdavault")
+ chart.ChartData.SetValue(4, 2, 71.155)
+ chart.ChartData.SetValue(5, 1, "Tarte au sucre")
+ chart.ChartData.SetValue(5, 2, 47.234)
+ chart.ChartData.SetValue(6, 1, "Camembert Pierrot")
+ chart.ChartData.SetValue(6, 2, 46.825)
+ chart.ChartData.SetValue(7, 1, "Gnocchi di nonna Alice")
+ chart.ChartData.SetValue(7, 2, 42.593)
+ chart.ChartData.SetValue(8, 1, "Manjimup Dried Apples")
+ chart.ChartData.SetValue(8, 2, 41.819)
+ chart.ChartData.SetValue(9, 1, "Alice Mutton")
+ chart.ChartData.SetValue(9, 2, 32.698)
+ chart.ChartData.SetValue(10, 1, "Carnarvon Tigers")
+ chart.ChartData.SetValue(10, 2, 29.171)
+ chart.ChartData.SetValue(11, 1, "Rössle Sauerkraut.")
+ 'Create a new chart series with the name Sales
+ Dim pieSeries As IOfficeChartSerie = chart.Series.Add("Sales")
+ pieSeries.Values = chart.ChartData(2, 2, 11, 2)
+ 'Set data label
+ pieSeries.DataPoints.DefaultDataPoint.DataLabels.IsValue = True
+ pieSeries.DataPoints.DefaultDataPoint.DataLabels.Position = OfficeDataLabelPosition.Outside
+ 'Set background color
+ chart.ChartArea.Fill.ForeColor = Color.FromArgb(242, 242, 242)
+ chart.PlotArea.Fill.ForeColor = Color.FromArgb(242, 242, 242)
+ chart.ChartArea.Border.LinePattern = OfficeChartLinePattern.None
+ 'Set category labels
+ chart.PrimaryCategoryAxis.CategoryLabels = chart.ChartData(2, 1, 11, 1)
+ 'Save the document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add section to the document
+ IWSection sec = document.AddSection();
+ //Add paragraph to the section
+ IWParagraph paragraph = sec.AddParagraph();
+ //Load the excel file as stream
+ Stream excelStream = File.OpenRead("Excel_Template.xlsx");
+ //Create and Append chart to the paragraph with excel stream as parameter
+ WChart chart = paragraph.AppendChart(excelStream, 1, "B2:C6", 470, 300);
+ //Set chart type and title
+ chart.ChartType = OfficeChartType.Column_Clustered;
+ chart.ChartTitle = "Purchase Details";
+ chart.ChartTitleArea.FontName = "Calibri";
+ chart.ChartTitleArea.Size = 14;
+ chart.ChartArea.Border.LinePattern = OfficeChartLinePattern.None;
+ //Set name to chart series
+ chart.Series[0].Name = "Sum of Purchases";
+ chart.Series[1].Name = "Sum of Future Expenses";
+ chart.PrimaryCategoryAxis.Title = "Products";
+ chart.PrimaryValueAxis.Title = "In Dollars";
+ //Set position of legend
+ chart.Legend.Position = OfficeLegendPosition.Bottom;
+ //Save the document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add section to the document
+ Dim sec As IWSection = document.AddSection()
+ 'Add paragraph to the section
+ Dim paragraph As IWParagraph = sec.AddParagraph()
+ 'Load the excel file as stream
+ Dim excelStream As Stream = File.OpenRead("Excel_Template.xlsx")
+ 'Create and Append chart to the paragraph with excel stream as parameter
+ Dim chart As WChart = paragraph.AppendChart(excelStream, 1, "B2:C6", 470, 300)
+ 'Set chart type and title
+ chart.ChartType = OfficeChartType.Column_Clustered
+ chart.ChartTitle = "Purchase Details"
+ chart.ChartTitleArea.FontName = "Calibri"
+ chart.ChartTitleArea.Size = 14
+ chart.ChartArea.Border.LinePattern = OfficeChartLinePattern.None
+ 'Set name to chart series
+ chart.Series(0).Name = "Sum of Purchases"
+ chart.Series(1).Name = "Sum of Future Expenses"
+ chart.PrimaryCategoryAxis.Title = "Products"
+ chart.PrimaryValueAxis.Title = "In Dollars"
+ 'Set position of legend
+ chart.Legend.Position = OfficeLegendPosition.Bottom
+ 'Save the document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create an instance of WordDocument class (Empty Word Document)
+ WordDocument document = new WordDocument();
+ //Add a new section into the Word Document
+ IWSection section = document.AddSection();
+ //Add a new paragraph into Word document and append text into paragraph
+ IWParagraph paragraph = section.AddParagraph();
+ paragraph.AppendText("Today's Date: ");
+ //Add the new Date field in Word document with field name and its type.
+ WField field = paragraph.AppendField("Date", FieldType.FieldDate) as WField;
+ //Field code used to describe how to display the date
+ field.FieldCode = @"DATE \@" + "\"MMMM d, yyyy\"";
+ //Save the document in the given name and format
+ document.Save("Sample.docx", FormatType.Docx);
+ //Release the resources occupied by WordDocument instance
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create an instance of WordDocument class (Empty Word Document)
+ Dim document As New WordDocument()
+ 'Add a new section into the Word Document
+ Dim section As IWSection = document.AddSection()
+ 'Add a new paragraph into Word document and append text into paragraph
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ paragraph.AppendText("Today's Date: ")
+ 'Add the new Date field in Word document with field name and its type.
+ Dim field As WField = TryCast(paragraph.AppendField("Date", FieldType.FieldDate), WField)
+ 'Field code used to describe how to display the date
+ field.FieldCode = "DATE \@" + """MMMM d, yyyy"""
+ 'Save the document in the given name and format
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Release the resources occupied by WordDocument instance
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ paragraph.AppendText("Web Hyperlink: ");
+ paragraph = section.AddParagraph();
+ //Append web hyperlink to the paragraph
+ IWField field = paragraph.AppendHyperlink("http://www.syncfusion.com", "Syncfusion", HyperlinkType.WebLink);
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ paragraph.AppendText("Web Hyperlink: ")
+ paragraph = section.AddParagraph()
+ 'Append web hyperlink to the paragraph
+ Dim field As IWField = paragraph.AppendHyperlink("http://www.syncfusion.com", "Syncfusion", HyperlinkType.WebLink)
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ paragraph.AppendText("Image Hyperlink");
+ paragraph = section.AddParagraph();
+ //Create a new image instance and load image
+ WPicture picture = new WPicture(document);
+ picture.LoadImage(Image.FromFile("Image.png"));
+ //Append new image hyperlink to the paragraph
+ paragraph.AppendHyperlink("http://www.syncfusion.com", picture, HyperlinkType.WebLink);
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ paragraph.AppendText("Image Hyperlink")
+ paragraph = section.AddParagraph()
+ 'Create a new image instance and load image
+ Dim picture As New WPicture(document)
+ picture.LoadImage(Image.FromFile("Image.png"))
+ 'Append new image hyperlink to the paragraph
+ paragraph.AppendHyperlink("http://www.syncfusion.com", picture, HyperlinkType.WebLink)
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create an instance of WordDocument class (Empty Word Document)
+ WordDocument document = new WordDocument();
+ //Add a new section into the Word Document
+ IWSection section = document.AddSection();
+ //Add a new paragraph into Word document and append text into paragraph
+ IWParagraph paragraph = section.AddParagraph();
+ paragraph.AppendText("Northwind Database");
+ paragraph.ParagraphFormat.HorizontalAlignment = Syncfusion.DocIO.DLS.HorizontalAlignment.Center;
+ //Add a paragraph into section
+ paragraph = section.AddParagraph();
+ //Add a new bookmark start into paragraph with name "Northwind"
+ paragraph.AppendBookmarkStart("Northwind");
+ //Add a text between the bookmark start and end into paragraph
+ paragraph.AppendText("The Northwind sample database (Northwind.mdb) is included with all versions of Access. It provides data you can experiment with and database objects that demonstrate features you might want to implement in your own databases.");
+ //Add a new bookmark end into paragraph with name " Northwind "
+ paragraph.AppendBookmarkEnd("Northwind");
+ //Add a text after the bookmark end
+ paragraph.AppendText(" Using Northwind, you can become familiar with how a relational database is structured and how the database objects work together to help you enter, store, manipulate, and print your data.");
+ //Save the document in the given name and format
+ document.Save("Bookmarks.docx", FormatType.Docx);
+ //Release the resources occupied by WordDocument instance
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create an instance of WordDocument class (Empty Word Document)
+ Dim document As New WordDocument()
+ 'Add a new section into the Word Document
+ Dim section As IWSection = document.AddSection()
+ 'Add a new paragraph into Word document and append text into paragraph
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ paragraph.AppendText("Northwind Database")
+ paragraph.ParagraphFormat.HorizontalAlignment = Syncfusion.DocIO.DLS.HorizontalAlignment.Center
+ 'Add a paragraph into section
+ paragraph = section.AddParagraph()
+ 'Add a new bookmark start into paragraph with name "Northwind"
+ paragraph.AppendBookmarkStart("Northwind")
+ 'Add a text between the bookmark start and end into paragraph
+ paragraph.AppendText("The Northwind sample database (Northwind.mdb) is included with all versions of Access. It provides data you can experiment with and database objects that demonstrate features you might want to implement in your own databases.")
+ 'Add a new bookmark end into paragraph with name " Northwind "
+ paragraph.AppendBookmarkEnd("Northwind")
+ 'Add a text after the bookmark end
+ paragraph.AppendText(" Using Northwind, you can become familiar with how a relational database is structured and how the database objects work together to help you enter, store, manipulate, and print your data.")
+ 'Save the document in the given name and format
+ document.Save("Bookmarks.docx", FormatType.Docx)
+ 'Release the resources occupied by WordDocument instance
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create an instance of WordDocument class (Empty Word Document)
+ WordDocument document = new WordDocument();
+ //Add a new section into the Word Document
+ IWSection section = document.AddSection();
+ //Add a new paragraph into Word document and append text into paragraph
+ IWParagraph paragraph = section.AddParagraph();
+ paragraph.AppendText("Northwind Database");
+ paragraph.ParagraphFormat.HorizontalAlignment = Syncfusion.DocIO.DLS.HorizontalAlignment.Center;
+ //Add a paragraph into section
+ paragraph = section.AddParagraph();
+ //Add a new bookmark start into paragraph with name "Northwind"
+ paragraph.AppendBookmarkStart("Northwind");
+ //Add a text between the bookmark start and end into paragraph
+ paragraph.AppendText("The Northwind sample database (Northwind.mdb) is included with all versions of Access. It provides data you can experiment with and database objects that demonstrate features you might want to implement in your own databases.");
+ //Add a new bookmark end into paragraph with name " Northwind "
+ paragraph.AppendBookmarkEnd("Northwind");
+ //Add a text after the bookmark end
+ paragraph.AppendText(" Using Northwind, you can become familiar with how a relational database is structured and how the database objects work together to help you enter, store, manipulate, and print your data.");
+ //Save the document in the given name and format
+ document.Save("Bookmarks.docx", FormatType.Docx);
+ //Release the resources occupied by WordDocument instance
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create an instance of WordDocument class (Empty Word Document)
+ Dim document As New WordDocument()
+ 'Add a new section into the Word Document
+ Dim section As IWSection = document.AddSection()
+ 'Add a new paragraph into Word document and append text into paragraph
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ paragraph.AppendText("Northwind Database")
+ paragraph.ParagraphFormat.HorizontalAlignment = Syncfusion.DocIO.DLS.HorizontalAlignment.Center
+ 'Add a paragraph into section
+ paragraph = section.AddParagraph()
+ 'Add a new bookmark start into paragraph with name "Northwind"
+ paragraph.AppendBookmarkStart("Northwind")
+ 'Add a text between the bookmark start and end into paragraph
+ paragraph.AppendText("The Northwind sample database (Northwind.mdb) is included with all versions of Access. It provides data you can experiment with and database objects that demonstrate features you might want to implement in your own databases.")
+ 'Add a new bookmark end into paragraph with name " Northwind "
+ paragraph.AppendBookmarkEnd("Northwind")
+ 'Add a text after the bookmark end
+ paragraph.AppendText(" Using Northwind, you can become familiar with how a relational database is structured and how the database objects work together to help you enter, store, manipulate, and print your data.")
+ 'Save the document in the given name and format
+ document.Save("Bookmarks.docx", FormatType.Docx)
+ 'Release the resources occupied by WordDocument instance
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Creates a new Word document.
+ WordDocument document = new WordDocument();
+ //Add a section and a paragraph in the document
+ document.EnsureMinimal();
+ IWParagraph paragraph = document.LastParagraph;
+ //Append text to the paragraph
+ paragraph.AppendText("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua");
+ //Add comment to a paragraph
+ WComment comment = paragraph.AppendComment("comment test");
+ //Specify the author of the comment
+ comment.Format.User = "Peter";
+ //Specify the initial of the author
+ comment.Format.UserInitials = "St";
+ //Save and close the Word document
+ document.Save("Comment.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Creates a new Word document.
+ Dim document As New WordDocument()
+ 'Add a section and a paragraph in the document
+ document.EnsureMinimal()
+ Dim paragraph As IWParagraph = document.LastParagraph
+ 'Append text to the paragraph
+ paragraph.AppendText("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua")
+ 'Add comment to a paragraph
+ Dim comment As WComment = paragraph.AppendComment("comment test")
+ 'Specify the author of the comment
+ comment.Format.User = "Peter"
+ 'Specify the initial of the author
+ comment.Format.UserInitials = "St"
+ 'Save and close the Word document
+ document.Save("Comment.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Create a section
+ IWSection section = document.AddSection();
+ //Add a paragraph to a section
+ IWParagraph paragraph = section.AddParagraph();
+ //Append the text to paragraph
+ paragraph.AppendText("Working with footnotes");
+ //Formatting the text
+ paragraph.ApplyStyle(BuiltinStyle.Heading1);
+ //Add a paragraph to a section
+ paragraph = section.AddParagraph();
+ //Append the footnotes
+ WFootnote footnote = (WFootnote) paragraph.AppendFootnote(Syncfusion.DocIO.FootnoteType.Footnote);
+ //Set the footnote character format
+ footnote.MarkerCharacterFormat.SubSuperScript = SubSuperScript.SuperScript;
+ //Inserts the text into the paragraph
+ paragraph.AppendText("Sample content for footnotes").CharacterFormat.Bold = true;
+ //Add footnote text
+ paragraph = footnote.TextBody.AddParagraph();
+ paragraph.AppendText("Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula");
+ //Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Create a section
+ Dim section As IWSection = document.AddSection()
+ 'Add a paragraph to a section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Append the text to paragraph
+ paragraph.AppendText("Working with footnotes")
+ 'Formatting the text
+ paragraph.ApplyStyle(BuiltinStyle.Heading1)
+ 'Add a paragraph to a section
+ paragraph = section.AddParagraph()
+ 'Append the footnotes
+ Dim footnote As WFootnote = DirectCast(paragraph.AppendFootnote(Syncfusion.DocIO.FootnoteType.Footnote), WFootnote)
+ 'Set the footnote character format
+ footnote.MarkerCharacterFormat.SubSuperScript = SubSuperScript.SuperScript
+ 'Inserts the text into the paragraph
+ paragraph.AppendText("Sample content for footnotes").CharacterFormat.Bold = True
+ 'Add footnote text
+ paragraph = footnote.TextBody.AddParagraph()
+ paragraph.AppendText("Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula")
+ Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new document
+ WordDocument document = new WordDocument();
+ //Create a section
+ IWSection section = document.AddSection();
+ //Add a paragraph to a section
+ IWParagraph paragraph = section.AddParagraph();
+ //Append the text to paragraph
+ paragraph.AppendText("Working with endnotes");
+ //Formatting the text
+ paragraph.ApplyStyle(BuiltinStyle.Heading1);
+ //Add a paragraph to a section
+ paragraph = section.AddParagraph();
+ //Append the endnote
+ WFootnote endnote = (WFootnote) paragraph.AppendFootnote(Syncfusion.DocIO.FootnoteType.Endnote);
+ //Set the endnote character format
+ endnote.MarkerCharacterFormat.SubSuperScript = SubSuperScript.SuperScript;
+ //Insert the text into the paragraph
+ paragraph.AppendText("Sample content for endnotes").CharacterFormat.Bold = true;
+ //Add footnote text
+ paragraph = endnote.TextBody.AddParagraph();
+ paragraph.AppendText("Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula");
+ //Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new document
+ Dim document As New WordDocument()
+ 'Create a section
+ Dim section As IWSection = document.AddSection()
+ 'Add a paragraph to a section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Append the text to paragraph
+ paragraph.AppendText("Working with endnotes")
+ 'Formatting the text
+ paragraph.ApplyStyle(BuiltinStyle.Heading1)
+ 'Add a paragraph to a section
+ paragraph = section.AddParagraph()
+ 'Append the endnote
+ Dim endnote As WFootnote = DirectCast(paragraph.AppendFootnote(Syncfusion.DocIO.FootnoteType.Endnote), WFootnote)
+ 'Set the endnote character format
+ endnote.MarkerCharacterFormat.SubSuperScript = SubSuperScript.SuperScript
+ 'Insert the text into the paragraph
+ paragraph.AppendText("Sample content for endnotes").CharacterFormat.Bold = True
+ 'Add footnote text
+ paragraph = endnote.TextBody.AddParagraph()
+ paragraph.AppendText("Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula")
+ Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Append new textbox to the paragraph
+ IWTextBox textbox = paragraph.AppendTextBox(150, 75);
+ //Add new text to the textbox body
+ IWParagraph textboxParagraph = textbox.TextBoxBody.AddParagraph();
+ textboxParagraph.AppendText("Text inside text box");
+ //Save and close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Append new textbox to the paragraph
+ Dim textbox As IWTextBox = paragraph.AppendTextBox(150, 75)
+ 'Add new text to the textbox body
+ Dim textboxParagraph As IWParagraph = textbox.TextBoxBody.AddParagraph()
+ textboxParagraph.AppendText("Text inside text box")
+ 'Save and close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ WParagraph paragraph = section.AddParagraph() as WParagraph;
+ paragraph.AppendText("Gender\t");
+ //Append new Checkbox
+ WCheckBox checkbox = paragraph.AppendCheckBox();
+ checkbox.Checked = false;
+ //Set Checkbox size
+ checkbox.CheckBoxSize = 10;
+ checkbox.CalculateOnExit = true;
+ //Set help text
+ checkbox.Help = "Help text";
+ paragraph.AppendText("Male\t");
+ checkbox = paragraph.AppendCheckBox();
+ checkbox.Checked = false;
+ checkbox.CheckBoxSize = 10;
+ checkbox.CalculateOnExit = true;
+ paragraph.AppendText("Female");
+ //Save the Word document
+ document.Save("Checkbox.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As WParagraph = TryCast(section.AddParagraph(), WParagraph)
+ paragraph.AppendText("Gender" & vbTab)
+ 'Append new Checkbox
+ Dim checkbox As WCheckBox = paragraph.AppendCheckBox()
+ checkbox.Checked = False
+ 'Set Checkbox size
+ checkbox.CheckBoxSize = 10
+ checkbox.CalculateOnExit = True
+ 'Set help text
+ checkbox.Help = "Help text"
+ paragraph.AppendText("Male" & vbTab)
+ checkbox = paragraph.AppendCheckBox()
+ checkbox.Checked = False
+ checkbox.CheckBoxSize = 10
+ checkbox.CalculateOnExit = True
+ paragraph.AppendText("Female")
+ 'Save the Word document
+ document.Save("Checkbox.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ WParagraph paragraph = section.AddParagraph() as WParagraph;
+ paragraph.AppendText("Gender\t");
+ //Append new Checkbox
+ WCheckBox checkbox = paragraph.AppendCheckBox("CheckBox1", true);
+ //checkbox.Checked = false;
+ //Set Checkbox size
+ checkbox.CheckBoxSize = 10;
+ checkbox.CalculateOnExit = true;
+ //Set help text
+ checkbox.Help = "Help text";
+ paragraph.AppendText("Male\t");
+ checkbox = paragraph.AppendCheckBox("CheckBox2",false);
+ //checkbox.Checked = false;
+ checkbox.CheckBoxSize = 10;
+ checkbox.CalculateOnExit = true;
+ paragraph.AppendText("Female");
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As WParagraph = TryCast(section.AddParagraph(), WParagraph)
+ paragraph.AppendText("Gender" & vbTab)
+ 'Append new Checkbox
+ Dim checkbox As WCheckBox = paragraph.AppendCheckBox("CheckBox1", True)
+ 'checkbox.Checked = false;
+ 'Set Checkbox size
+ checkbox.CheckBoxSize = 10
+ checkbox.CalculateOnExit = True
+ 'Set help text
+ checkbox.Help = "Help text"
+ paragraph.AppendText("Male" & vbTab)
+ checkbox = paragraph.AppendCheckBox("CheckBox2", False)
+ 'checkbox.Checked = false;
+ checkbox.CheckBoxSize = 10
+ checkbox.CalculateOnExit = True
+ paragraph.AppendText("Female")
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ WParagraph paragraph = section.AddParagraph() as WParagraph;
+ paragraph.AppendText("General Information");
+ section.AddParagraph();
+ paragraph = section.AddParagraph() as WParagraph;
+ IWTextRange text = paragraph.AppendText("Name\t");
+ text.CharacterFormat.Bold = true;
+ //Append Text form field
+ WTextFormField textfield = paragraph.AppendTextFormField(null);
+ //Set type of Text form field
+ textfield.Type = TextFormFieldType.RegularText;
+ textfield.CharacterFormat.FontName = "Calibri";
+ textfield.CalculateOnExit = true;
+ //Save the Word document
+ document.Save("Textfield.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As WParagraph = TryCast(section.AddParagraph(), WParagraph)
+ paragraph.AppendText("General Information")
+ section.AddParagraph()
+ paragraph = TryCast(section.AddParagraph(), WParagraph)
+ Dim text As IWTextRange = paragraph.AppendText("Name" & vbTab)
+ text.CharacterFormat.Bold = True
+ 'Append Text form field
+ Dim textfield As WTextFormField = paragraph.AppendTextFormField(Nothing)
+ 'Set type of Text form field
+ textfield.Type = TextFormFieldType.RegularText
+ textfield.CharacterFormat.FontName = "Calibri"
+ textfield.CalculateOnExit = True
+ 'Save the Word document
+ document.Save("Textfield.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ WParagraph paragraph = section.AddParagraph() as WParagraph;
+ paragraph.AppendText("General Information");
+ section.AddParagraph();
+ paragraph = section.AddParagraph() as WParagraph;
+ IWTextRange text = paragraph.AppendText("Date of Birth\t");
+ text.CharacterFormat.Bold = true;
+ //Append Text form field
+ WTextFormField textfield = paragraph.AppendTextFormField("Date field", DateTime.Now.ToString("MM/DD/YY"));
+ textfield.StringFormat = "MM/DD/YY";
+ //Set Text form field type
+ textfield.Type = TextFormFieldType.DateText;
+ textfield.CalculateOnExit = true;
+ //Save the Word document
+ document.Save("Textfield.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As WParagraph = TryCast(section.AddParagraph(), WParagraph)
+ paragraph.AppendText("General Information")
+ section.AddParagraph()
+ paragraph = TryCast(section.AddParagraph(), WParagraph)
+ Dim text As IWTextRange = paragraph.AppendText("Date of Birth" & vbTab)
+ text.CharacterFormat.Bold = True
+ 'Append Text form field
+ Dim textfield As WTextFormField = paragraph.AppendTextFormField("Date field", DateTime.Now.ToString("MM/DD/YY"))
+ textfield.StringFormat = "MM/DD/YY"
+ 'Set Text form field type
+ textfield.Type = TextFormFieldType.DateText
+ textfield.CalculateOnExit = True
+ 'Save the Word document
+ document.Save("Textfield.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ WParagraph paragraph = section.AddParagraph() as WParagraph;
+ paragraph.AppendText("Educational Qualification\t");
+ //Append Dropdown field
+ WDropDownFormField dropdownfield = paragraph.AppendDropDownFormField("FieldName");
+ //Add items to the dropdown items collection
+ dropdownfield.DropDownItems.Add("Higher");
+ dropdownfield.DropDownItems.Add("Vocational");
+ dropdownfield.DropDownItems.Add("Universal");
+ dropdownfield.Enabled = true;
+ //Set the item index for default value
+ dropdownfield.DropDownSelectedIndex = 1;
+ dropdownfield.CalculateOnExit = true;
+ //Save the Word document
+ document.Save("Dropdown.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As WParagraph = TryCast(section.AddParagraph(), WParagraph)
+ paragraph.AppendText("Educational Qualification" & vbTab)
+ 'Append Dropdown field
+ Dim dropdownfield As WDropDownFormField = paragraph.AppendDropDownFormField("FieldName")
+ 'Add items to the dropdown items collection
+ dropdownfield.DropDownItems.Add("Higher")
+ dropdownfield.DropDownItems.Add("Vocational")
+ dropdownfield.DropDownItems.Add("Universal")
+ dropdownfield.Enabled = True
+ 'Set the item index for default value
+ dropdownfield.DropDownSelectedIndex = 1
+ dropdownfield.CalculateOnExit = True
+ 'Save the Word document
+ document.Save("Dropdown.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ paragraph.AppendText("Example of adding symbols to the paragraph: ");
+ //Insert symbol with character code 100
+ paragraph.AppendSymbol(100);
+ //Save and close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ paragraph.AppendText("Example of adding symbols to the paragraph: ")
+ 'Insert symbol with character code 100
+ paragraph.AppendSymbol(100)
+ 'Save and close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ paragraph.AppendText("Before line break");
+ //Add line break to the paragraph
+ paragraph.AppendBreak(BreakType.LineBreak);
+ paragraph.AppendText("After line break");
+ IWParagraph pageBreakPara = section.AddParagraph();
+ pageBreakPara.AppendText("Before page break");
+ //Add page break to the paragraph
+ pageBreakPara.AppendBreak(BreakType.PageBreak);
+ pageBreakPara.AppendText("After page break");
+ IWSection secondSection = document.AddSection();
+ //Add columns to the section
+ secondSection.AddColumn(100, 2);
+ secondSection.AddColumn(100, 2);
+ IWParagraph columnBreakPara = secondSection.AddParagraph();
+ columnBreakPara.AppendText("Before column break");
+ //Add column break to the paragraph
+ columnBreakPara.AppendBreak(BreakType.ColumnBreak);
+ columnBreakPara.AppendText("After column break");
+ //Save and Close the document instance
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ paragraph.AppendText("Before line break")
+ 'Add line break to the paragraph
+ paragraph.AppendBreak(BreakType.LineBreak)
+ paragraph.AppendText("After line break")
+ Dim pageBreakPara As IWParagraph = section.AddParagraph()
+ pageBreakPara.AppendText("Before page break")
+ 'Add page break to the paragraph
+ pageBreakPara.AppendBreak(BreakType.PageBreak)
+ pageBreakPara.AppendText("After page break")
+ Dim secondSection As IWSection = document.AddSection()
+ 'Add columns to the section
+ secondSection.AddColumn(100, 2)
+ secondSection.AddColumn(100, 2)
+ Dim columnBreakPara As IWParagraph = secondSection.AddParagraph()
+ columnBreakPara.AppendText("Before column break")
+ 'Add column break to the paragraph
+ columnBreakPara.AppendBreak(BreakType.ColumnBreak)
+ columnBreakPara.AppendText("After column break")
+ 'Save and Close the document instance
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ WParagraph paragraph = section.AddParagraph() as WParagraph;
+ //Add new shape to the document
+ Shape rectangle = paragraph.AppendShape(AutoShapeType.RoundedRectangle, 150, 100);
+ //Set position for shape
+ rectangle.VerticalPosition = 72;
+ rectangle.HorizontalPosition = 72;
+ paragraph = section.AddParagraph() as WParagraph;
+ //Add text body contents to the shape
+ paragraph = rectangle.TextBody.AddParagraph() as WParagraph;
+ IWTextRange text = paragraph.AppendText("This text is in rounded rectangle shape");
+ text.CharacterFormat.TextColor = Color.Green;
+ text.CharacterFormat.Bold = true;
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As WParagraph = TryCast(section.AddParagraph(), WParagraph)
+ 'Add new shape to the document
+ Dim rectangle As Shape = paragraph.AppendShape(AutoShapeType.RoundedRectangle, 150, 100)
+ 'Set position for shape
+ rectangle.VerticalPosition = 72
+ rectangle.HorizontalPosition = 72
+ paragraph = TryCast(section.AddParagraph(), WParagraph)
+ 'Add text body contents to the shape
+ paragraph = TryCast(rectangle.TextBody.AddParagraph(), WParagraph)
+ Dim text As IWTextRange = paragraph.AppendText("This text is in rounded rectangle shape")
+ text.CharacterFormat.TextColor = Color.Green
+ text.CharacterFormat.Bold = True
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add the section into the Word document
+ IWSection section = document.AddSection();
+ string paraText = "Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula";
+ //Add the paragraph into the created section
+ IWParagraph paragraph = section.AddParagraph();
+ //Append the TOC field with LowerHeadingLevel and UpperHeadingLevel to determines the TOC entries
+ paragraph.AppendTOC(1, 3);
+ //Add the section into the Word document
+ section = document.AddSection();
+ //Add the paragraph into the created section
+ paragraph = section.AddParagraph();
+ //Add the text for the headings
+ paragraph.AppendText("First Chapter");
+ //Set a build in heading style.
+ paragraph.ApplyStyle(BuiltinStyle.Heading1);
+ //Add the text into the paragraph
+ section.AddParagraph().AppendText(paraText);
+ //Add the section into the Word document
+ section = document.AddSection();
+ //Add the paragraph into the created section
+ paragraph = section.AddParagraph();
+ //Add the text for the headings
+ paragraph.AppendText("Second Chapter");
+ //Set a build in heading style.
+ paragraph.ApplyStyle(BuiltinStyle.Heading2);
+ //Add the text into the paragraph
+ section.AddParagraph().AppendText(paraText);
+ //Add the section into the Word document
+ section = document.AddSection();
+ //Add the paragraph into the created section
+ paragraph = section.AddParagraph();
+ //Add the text into the headings
+ paragraph.AppendText("Third Chapter");
+ //Set a build in heading style
+ paragraph.ApplyStyle(BuiltinStyle.Heading3);
+ //Add the text into the paragraph.
+ section.AddParagraph().AppendText(paraText);
+ //Update the table of contents
+ document.UpdateTableOfContents();
+ //Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add the section into the Word document
+ Dim section As IWSection = document.AddSection()
+ Dim paraText As String = "Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula"
+ 'Add the paragraph into the created section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Append the TOC field with LowerHeadingLevel and UpperHeadingLevel to determines the TOC entries
+ paragraph.AppendTOC(1, 3)
+ 'Add the section into the Word document
+ section = document.AddSection()
+ 'Add the paragraph into the created section
+ paragraph = section.AddParagraph()
+ 'Add the text for the headings
+ paragraph.AppendText("First Chapter")
+ 'Set a build in heading style
+ paragraph.ApplyStyle(BuiltinStyle.Heading1)
+ 'Add the text into the paragraph.
+ section.AddParagraph().AppendText(paraText)
+ 'Add the section into the Word document
+ section = document.AddSection()
+ 'Add the paragraph into the created section
+ paragraph = section.AddParagraph()
+ 'Add the text for the headings
+ paragraph.AppendText("Second Chapter")
+ 'Set a build in heading style
+ paragraph.ApplyStyle(BuiltinStyle.Heading2)
+ 'Add the text into the paragraph
+ section.AddParagraph().AppendText(paraText)
+ 'Add the section into the Word document
+ section = document.AddSection()
+ 'Add the paragraph into the created section
+ paragraph = section.AddParagraph()
+ 'Add the text into the headings
+ paragraph.AppendText("Third Chapter")
+ 'Set a build in heading style
+ paragraph.ApplyStyle(BuiltinStyle.Heading3)
+ 'Add the text into the paragraph
+ section.AddParagraph().AppendText(paraText)
+ 'Update the table of contents
+ document.UpdateTableOfContents()
+ Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ IWSection section = document.AddSection();
+ IWParagraph paragraph = section.AddParagraph();
+ //Add text, bookmark start and end in the paragraph
+ paragraph.AppendBookmarkStart("Title");
+ paragraph.AppendText("Northwind Database");
+ paragraph.AppendBookmarkEnd("Title");
+ paragraph = section.AddParagraph();
+ paragraph.AppendText("The Northwind sample database (Northwind.mdb) is included with all versions of Access. It provides data you can experiment with and database objects that demonstrate features you might want to implement in your own databases.");
+ section = document.AddSection();
+ section.AddParagraph();
+ paragraph = section.AddParagraph() as WParagraph;
+ //Get the collection of bookmark start in the word document
+ List<Entity> items = document.GetCrossReferenceItems(ReferenceType.Bookmark);
+ paragraph.AppendText("Bookmark Cross Reference starts here ");
+ //Append the cross reference for bookmark Title with ContentText as reference kind
+ paragraph.AppendCrossReference(ReferenceType.Bookmark, ReferenceKind.ContentText, items[0], true, false, false, string.Empty);
+ //Update the document Fields
+ document.UpdateDocumentFields();
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ Dim section As IWSection = document.AddSection()
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add text, bookmark start and end in the paragraph
+ paragraph.AppendBookmarkStart("Title")
+ paragraph.AppendText("Northwind Database")
+ paragraph.AppendBookmarkEnd("Title")
+ paragraph = section.AddParagraph()
+ paragraph.AppendText("The Northwind sample database (Northwind.mdb) is included with all versions of Access. It provides data you can experiment with and database objects that demonstrate features you might want to implement in your own databases.")
+ section = document.AddSection()
+ section.AddParagraph()
+ paragraph = TryCast(section.AddParagraph(), WParagraph)
+ 'Get the collection of bookmark start in the word document
+ Dim items As List(Of Entity) = document.GetCrossReferenceItems(ReferenceType.Bookmark)
+ paragraph.AppendText("Bookmark Cross Reference starts here ")
+ 'Append the cross reference for bookmark Title with ContentText as reference kind
+ paragraph.AppendCrossReference(ReferenceType.Bookmark, ReferenceKind.ContentText, items(0), True, False, False, String.Empty)
+ 'Update the document Fields
+ document.UpdateDocumentFields()
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add image to the paragraph
+ IWPicture picture = paragraph.AppendPicture(Image.FromFile("Image.png"));
+ //Set height and width for the image
+ picture.Height = 100;
+ picture.Width = 100;
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add image to the paragraph
+ Dim picture As IWPicture = paragraph.AppendPicture(Image.FromFile("Image.png"))
+ 'Set height and width for the image
+ picture.Height = 100
+ picture.Width = 100
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load the template document
+ WordDocument document = new WordDocument("Template.docx");
+ //Html string to be inserted
+ string htmlstring = "This text is inserted as HTML string.
";
+ IWParagraph paragraph = document.Sections[0].Body.Paragraphs[0];
+ //Append the Html string to first paragraph in the document
+ paragraph.AppendHTML(htmlstring);
+ //Save and close the document
+ document.Save("Sample.docx");
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load the template document
+ Dim document As New WordDocument("Template.docx")
+ 'Html string to be inserted
+ Dim htmlstring As String = "This text is inserted as HTML string.
"
+ Dim paragraph As IWParagraph = document.Sections(0).Body.Paragraphs(0)
+ 'Append the Html string to first paragraph in the document
+ paragraph.AppendHTML(htmlstring)
+ 'Save and close the document
+ document.Save("Sample.docx")
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add section to the document
+ IWSection sec = document.AddSection();
+ //Add paragraph to the section
+ IWParagraph paragraph = sec.AddParagraph();
+ //Load the picture instance with the image need to be displayed
+ WPicture picture = new WPicture(document);
+ picture.LoadImage(Image.FromFile("Image.png"));
+ paragraph = sec.AddParagraph();
+ paragraph.AppendOleObject(@"..\..\Data\Excel_Template.xlsx", picture, OleObjectType.ExcelWorksheet);
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add section to the document
+ Dim sec As IWSection = document.AddSection()
+ 'Add paragraph to the section
+ Dim paragraph As IWParagraph = sec.AddParagraph()
+ 'Load the picture instance with the image need to be displayed
+ Dim picture As New WPicture(document)
+ picture.LoadImage(Image.FromFile("Image.png"))
+ paragraph = sec.AddParagraph()
+ paragraph.AppendOleObject("..\..\Data\Excel_Template.xlsx", picture, OleObjectType.ExcelWorksheet)
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add section to the document
+ IWSection sec = document.AddSection();
+ //Add paragraph to the section
+ IWParagraph paragraph = sec.AddParagraph();
+ //Load the picture instance with the image need to be displayed
+ WPicture picture = new WPicture(document);
+ picture.LoadImage(Image.FromFile("Image.png"));
+ WOleObject ole = paragraph.AppendOleObject(@"..\..\Data\Excel_Template.xlsx", picture);
+ //Set how to display the Ole object
+ ole.DisplayAsIcon = false;
+ //Save and close the document
+ document.Save("Sample.docx");
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add section to the document
+ Dim sec As IWSection = document.AddSection()
+ 'Add paragraph to the section
+ Dim paragraph As IWParagraph = sec.AddParagraph()
+ 'Load the picture instance with the image need to be displayed
+ Dim picture As New WPicture(document)
+ picture.LoadImage(Image.FromFile("Image.png"))
+ Dim ole As WOleObject = paragraph.AppendOleObject("..\..\Data\Excel_Template.xlsx", picture)
+ 'Set how to display the Ole object
+ ole.DisplayAsIcon = False
+ 'Save and close the document
+ document.Save("Sample.docx")
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Open the file to be embedded
+ FileStream stream = new FileStream("Book1.xlsx", FileMode.Open);
+ //Load the picture instance with the image need to be displayed
+ WPicture picture = new WPicture(document);
+ picture.LoadImage(Image.FromFile("Image.png"));
+ //Append the Ole object to the paragraph
+ WOleObject ole = paragraph.AppendOleObject(stream, picture, OleObjectType.ExcelWorksheet);
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Open the file to be embedded
+ Dim stream As New FileStream("Book1.xlsx", FileMode.Open)
+ 'Load the picture instance with the image need to be displayed
+ Dim picture As New WPicture(document)
+ picture.LoadImage(Image.FromFile("Image.png"))
+ 'Append the Ole object to the paragraph
+ Dim ole As WOleObject = paragraph.AppendOleObject(stream, picture, OleObjectType.ExcelWorksheet)
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add section to the document
+ IWSection sec = document.AddSection();
+ //Add paragraph to the section
+ IWParagraph paragraph = sec.AddParagraph();
+ //Load the picture instance with the image need to be displayed
+ WPicture picture = new WPicture(document);
+ picture.LoadImage(Image.FromFile("Image.png"));
+ //Get the file as byte array
+ byte[] olebytes = File.ReadAllBytes("Excel_Template.xlsx");
+ paragraph = sec.AddParagraph();
+ //Append OLE object
+ paragraph.AppendOleObject(olebytes, picture, OleObjectType.ExcelWorksheet);
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Word2010);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add section to the document
+ Dim sec As IWSection = document.AddSection()
+ 'Add paragraph to the section
+ Dim paragraph As IWParagraph = sec.AddParagraph()
+ 'Load the picture instance with the image need to be displayed
+ Dim picture As New WPicture(document)
+ picture.LoadImage(Image.FromFile("Image.png"))
+ 'Get the file as byte array
+ Dim olebytes As Byte() = File.ReadAllBytes("Excel_Template.xlsx")
+ paragraph = sec.AddParagraph()
+ 'Append OLE object
+ paragraph.AppendOleObject(olebytes, picture, OleObjectType.ExcelWorksheet)
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Word2010)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add section to the document
+ IWSection sec = document.AddSection();
+ //Add paragraph to the section
+ IWParagraph paragraph = sec.AddParagraph();
+ //Load the picture instance with the image need to be displayed
+ WPicture picture = new WPicture(document);
+ picture.LoadImage(Image.FromFile("Image.png"));
+ FileStream stream = new FileStream("Excel_Template.xlsx", FileMode.Open);
+ WOleObject ole = paragraph.AppendOleObject(stream, picture, OleLinkType.Embed);
+ ole.ObjectType = "Excel Worksheet";
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Word2010);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add section to the document
+ Dim sec As IWSection = document.AddSection()
+ 'Add paragraph to the section
+ Dim paragraph As IWParagraph = sec.AddParagraph()
+ 'Load the picture instance with the image need to be displayed
+ Dim picture As New WPicture(document)
+ picture.LoadImage(Image.FromFile("Image.png"))
+ Dim stream As New FileStream("Excel_Template.xlsx", FileMode.Open)
+ Dim ole As WOleObject = paragraph.AppendOleObject(stream, picture, OleLinkType.Embed)
+ ole.ObjectType = "Excel Worksheet"
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Word2010)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add section to the document
+ IWSection sec = document.AddSection();
+ //Add paragraph to the section
+ IWParagraph paragraph = sec.AddParagraph();
+ //Load the picture instance with the image need to be displayed
+ WPicture picture = new WPicture(document);
+ picture.LoadImage(Image.FromFile("Image.png"));
+ //Get the file as byte array
+ byte[] olebytes = File.ReadAllBytes("Excel_Template.xlsx");
+ WOleObject ole = paragraph.AppendOleObject(olebytes, picture, OleLinkType.Embed);
+ ole.ObjectType = "Excel Worksheet";
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Word2010);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add section to the document
+ Dim sec As IWSection = document.AddSection()
+ 'Add paragraph to the section
+ Dim paragraph As IWParagraph = sec.AddParagraph()
+ 'Load the picture instance with the image need to be displayed
+ Dim picture As New WPicture(document)
+ picture.LoadImage(Image.FromFile("Image.png"))
+ 'Get the file as byte array
+ Dim olebytes As Byte() = File.ReadAllBytes("Excel_Template.xlsx")
+ Dim ole As WOleObject = paragraph.AppendOleObject(olebytes, picture, OleLinkType.Embed)
+ ole.ObjectType = "Excel Worksheet"
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Word2010)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add section to the document
+ IWSection sec = document.AddSection();
+ //Add paragraph to the section
+ IWParagraph paragraph = sec.AddParagraph();
+ //Load the picture instance with the image need to be displayed
+ WPicture picture = new WPicture(document);
+ picture.LoadImage(Image.FromFile("Image.png"));
+ //Get the file as byte array
+ byte[] olebytes = File.ReadAllBytes("Excel_Template.xlsx");
+ paragraph = sec.AddParagraph();
+ //Append OLE object
+ paragraph.AppendOleObject(olebytes, picture, ".xlsx");
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Word2010);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add section to the document
+ Dim sec As IWSection = document.AddSection()
+ 'Add paragraph to the section
+ Dim paragraph As IWParagraph = sec.AddParagraph()
+ 'Load the picture instance with the image need to be displayed
+ Dim picture As New WPicture(document)
+ picture.LoadImage(Image.FromFile("Image.png"))
+ 'Get the file as byte array
+ Dim olebytes As Byte() = File.ReadAllBytes("Excel_Template.xlsx")
+ paragraph = sec.AddParagraph()
+ 'Append OLE object
+ paragraph.AppendOleObject(olebytes, picture, ".xlsx")
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Word2010)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Open the file to be embedded
+ FileStream stream = new FileStream("Excel_Template.xlsx", FileMode.Open);
+ //Load the picture instance with the image need to be displayed
+ WPicture picture = new WPicture(document);
+ picture.LoadImage(Image.FromFile("Image.png"));
+ //Append the Ole object to the paragraph
+ WOleObject ole = paragraph.AppendOleObject(stream, picture, "xlsx");
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Open the file to be embedded
+ Dim stream As New FileStream("Excel_Template.xlsx", FileMode.Open)
+ 'Load the picture instance with the image need to be displayed
+ Dim picture As New WPicture(document)
+ picture.LoadImage(Image.FromFile("Image.png"))
+ 'Append the Ole object to the paragraph
+ Dim ole As WOleObject = paragraph.AppendOleObject(stream, picture, "xlsx")
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ //Create a new Word document
+ using(WordDocument wordDocument = new WordDocument())
+ {
+ //Adds one section and one paragraph to the document
+ wordDocument.EnsureMinimal();
+ //Appends a new mathematical equation to the paragraph using LaTeX syntax.
+ wordDocument.LastParagraph.AppendMath(@"\dot{a}");
+ //Saves the Word document
+ wordDocument.Save("Result.docx", FormatType.Docx);
+ }
+
+
+ 'Create a new Word document
+ Dim wordDocument As New WordDocument()
+ 'Adds one section and one paragraph to the document
+ wordDocument.EnsureMinimal()
+ 'Appends a new mathematical equation to the paragraph using LaTeX syntax.
+ wordDocument.LastParagraph.AppendMath("\dot{a}")
+ 'Saves the Word document
+ wordDocument.Save("Result.docx", FormatType.Docx)
+ 'Close the document
+ wordDocument.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ WParagraph paragraph = document.Sections[0].Paragraphs[1];
+ //Find the first occurrence of a particular text in the paragraph
+ TextSelection textSelection = paragraph.Find(new Regex("Panda"));
+ //Get the found text as single text range
+ WTextRange textRange = textSelection.GetAsOneRange();
+ //Modify the text
+ textRange.Text = "Replaced text";
+ //Set highlight color
+ textRange.CharacterFormat.HighlightColor = Color.Yellow;
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ Dim paragraph As WParagraph = document.Sections(0).Paragraphs(1)
+ 'Find the first occurrence of a particular text in the paragraph
+ Dim textSelection As TextSelection = paragraph.Find(New Regex("Panda"))
+ 'Get the found text as single text range
+ Dim textRange As WTextRange = textSelection.GetAsOneRange()
+ 'Modify the text
+ textRange.Text = "Replaced text"
+ 'Set highlight color
+ textRange.CharacterFormat.HighlightColor = Color.Yellow
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ WParagraph paragraph = document.Sections[0].Paragraphs[1];
+ //Find the first occurrence of a particular text in the paragraph
+ TextSelection textSelection = paragraph.Find("panda", true, true);
+ //Get the found text as single text range
+ WTextRange textRange = textSelection.GetAsOneRange();
+ //Modify the text
+ textRange.Text = "Replaced text";
+ //Set highlight color
+ textRange.CharacterFormat.HighlightColor = Color.Yellow;
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ Dim paragraph As WParagraph = document.Sections(0).Paragraphs(1)
+ 'Find the first occurrence of a particular text in the paragraph
+ Dim textSelection As TextSelection = paragraph.Find("panda", true, true)
+ 'Get the found text as single text range
+ Dim textRange As WTextRange = textSelection.GetAsOneRange()
+ 'Modify the text
+ textRange.Text = "Replaced text"
+ 'Set highlight color
+ textRange.CharacterFormat.HighlightColor = Color.Yellow
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx");
+ WParagraph paragraph = document.Sections[0].Paragraphs[1];
+ //Replace all occurrence of a particular text in the paragraph
+ paragraph.Replace(new Regex("Paragraph"),"paragraph");
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx")
+ Dim paragraph As WParagraph = document.Sections(0).Paragraphs(1)
+ 'Replace all occurrence of a particular text in the paragraph
+ paragraph.Replace(New Regex("Paragraph"), "paragraph")
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx");
+ WParagraph paragraph = document.Sections[0].Paragraphs[1];
+ //Replace all occurrence of a particular text in the paragraph
+ paragraph.Replace("Paragraph","paragraph", false, true);
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx")
+ Dim paragraph As WParagraph = document.Sections(0).Paragraphs(1)
+ 'Replace all occurrence of a particular text in the paragraph
+ paragraph.Replace("Paragraph", "paragraph", False, True)
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx");
+ WParagraph paragraph = document.Sections[0].Paragraphs[1];
+ //Find the first occurrence of the regular expression
+ TextSelection selection = paragraph.Find(new Regex("Panda"));
+ //Replace all occurrence of a particular regular expression with the text selection in the paragraph
+ paragraph.Replace(new Regex("Giant panda"), selection);
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx")
+ Dim paragraph As WParagraph = document.Sections(0).Paragraphs(1)
+ 'Find the first occurrence of the regular expression
+ Dim selection As TextSelection = paragraph.Find(New Regex("Panda"))
+ 'Replace all occurrence of a particular regular expression with the text selection in the paragraph
+ paragraph.Replace(New Regex("Giant panda"), selection)
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx");
+ WParagraph paragraph = document.Sections[0].Paragraphs[1];
+ //Find the first occurrence of the regular expression
+ TextSelection selection = paragraph.Find(new Regex("Panda"));
+ //Replace all occurrence of a particular regular expression with the text selection in the paragraph
+ paragraph.Replace(new Regex("Giant panda"), selection, true);
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx")
+ Dim paragraph As WParagraph = document.Sections(0).Paragraphs(1)
+ 'Find the first occurrence of the regular expression
+ Dim selection As TextSelection = paragraph.Find(New Regex("Panda"))
+ 'Replace all occurrence of a particular regular expression with the text selection in the paragraph
+ paragraph.Replace(New Regex("Giant panda"), selection, True)
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx");
+ WParagraph paragraph = document.Sections[0].Paragraphs[1];
+ //Find the first occurrence of the regular expression
+ TextSelection selection = paragraph.Find(new Regex("Panda"));
+ //Replace all occurrence of a particular regular expression with the text selection in the paragraph
+ paragraph.Replace("Giant panda", selection, true, false);
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx")
+ Dim paragraph As WParagraph = document.Sections(0).Paragraphs(1)
+ 'Find the first occurrence of the regular expression
+ Dim selection As TextSelection = paragraph.Find(New Regex("Panda"))
+ 'Replace all occurrence of a particular regular expression with the text selection in the paragraph
+ paragraph.Replace("Giant panda", selection, True, False)
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Template.docx");
+ WParagraph paragraph = document.Sections[0].Paragraphs[1];
+ //Find the first occurrence of the regular expression
+ TextSelection selection = paragraph.Find(new Regex("Panda"));
+ //Replace all occurrence of a particular regular expression with the text selection in the paragraph
+ paragraph.Replace("Giant panda", selection, true, false, true);
+ //Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Template.docx")
+ Dim paragraph As WParagraph = document.Sections(0).Paragraphs(1)
+ 'Find the first occurrence of the regular expression
+ Dim selection As TextSelection = paragraph.Find(New Regex("Panda"))
+ 'Replace all occurrence of a particular regular expression with the text selection in the paragraph
+ paragraph.Replace("Giant panda", selection, True, False, False)
+ 'Save and Close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ document.EnsureMinimal();
+ //Add text to the first section
+ document.LastParagraph.AppendText("First section");
+ //Insert section break
+ WSection newsection = document.LastParagraph.InsertSectionBreak();
+ //Add new paragraph to the second section
+ IWParagraph paragraph = newsection.AddParagraph();
+ paragraph.AppendText("Second section");
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ document.EnsureMinimal()
+ 'Add text to the first section
+ document.LastParagraph.AppendText("First section")
+ 'Insert section break
+ Dim newsection As WSection = document.LastParagraph.InsertSectionBreak()
+ 'Add new paragraph to the second section
+ Dim paragraph As IWParagraph = newsection.AddParagraph()
+ paragraph.AppendText("Second section")
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ document.EnsureMinimal();
+ //Add text to the first section
+ document.LastParagraph.AppendText("First section");
+ //Insert section break
+ WSection newsection = document.LastParagraph.InsertSectionBreak(SectionBreakCode.Oddpage);
+ //Add new paragraph to the second section
+ IWParagraph paragraph = newsection.AddParagraph();
+ paragraph.AppendText("Second section");
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ document.EnsureMinimal()
+ 'Add text to the first section
+ document.LastParagraph.AppendText("First section")
+ 'Insert section break
+ Dim newsection As WSection = document.LastParagraph.InsertSectionBreak(SectionBreakCode.Oddpage)
+ 'Add new paragraph to the second section
+ Dim paragraph As IWParagraph = newsection.AddParagraph()
+ paragraph.AppendText("Second section")
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ // Loads an existing Word document into DocIO instance.
+ WordDocument document = new WordDocument("Template.docx");
+ //Gets the document text
+ document.GetText();
+ // Gets a numeric string value of the numbering list paragraph.
+ String listString = document.LastParagraph.ListString;
+ // Saves the document in the given name and format.
+ document.Save("Document.docx", FormatType.Docx);
+ // Releases the resources occupied by WordDocument instance.
+ document.Close();
+
+
+ ' Loads an existing Word document into DocIO instance.
+ Dim document As WordDocument = New WordDocument("Template.docx")
+ ' Gets the document text.
+ document.GetText()
+ ' Gets a numeric string value of the numbering list paragraph
+ Dim listString As String = document.LastParagraph.ListString
+ ' Saves the document in the given name and format.
+ document.Save("Document.docx", FormatType.Docx)
+ ' Releases the resources occupied by WordDocument instance.
+ document.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add the section into Word document
+ IWSection section = document.AddSection();
+ //Add the column into the section
+ section.AddColumn(150, 20);
+ //Add the column into the section
+ section.AddColumn(150, 20);
+ //Add the column into the section
+ section.AddColumn(150, 20);
+ //Add a paragraph to created section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add a paragraph to created section
+ paragraph = section.AddParagraph();
+ paragraph.Text = "Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula";
+ //Append the text to the created paragraph
+ paragraph.AppendText(paragraph.Text);
+ //Add the column breaks
+ paragraph.AppendBreak(BreakType.ColumnBreak);
+ //Add a paragraph to created section
+ paragraph = section.AddParagraph();
+ //Append the text to the created paragraph
+ paragraph.AppendText(paragraph.Text);
+ //Add the column breaks
+ paragraph.AppendBreak(BreakType.ColumnBreak);
+ //Add a paragraph to created section
+ paragraph = section.AddParagraph();
+ //Append the text to the created paragraph
+ paragraph.AppendText(paragraph.Text);
+ //Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add the section into Word document
+ Dim section As IWSection = document.AddSection()
+ 'Add the column into the section
+ section.AddColumn(150, 20)
+ 'Add the column into the section
+ section.AddColumn(150, 20)
+ 'Add the column into the section
+ section.AddColumn(150, 20)
+ 'Add a paragraph to created section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add a paragraph to created section
+ paragraph = section.AddParagraph()
+ Dim paraText As String = "Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula"
+ 'Append the text to the created paragraph
+ paragraph.AppendText(paraText)
+ 'Add the column breaks
+ paragraph.AppendBreak(BreakType.ColumnBreak)
+ 'Add a paragraph to created section
+ paragraph = section.AddParagraph()
+ 'Append the text to the created paragraph
+ paragraph.AppendText(paraText)
+ 'Add the column breaks
+ paragraph.AppendBreak(BreakType.ColumnBreak)
+ 'Add a paragraph to created section
+ paragraph = section.AddParagraph()
+ 'Append the text to the created paragraph
+ paragraph.AppendText(paraText)
+ 'Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Gets the first section in the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ paragraph.AppendText("First paragraph in section");
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Gets the first section in the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ paragraph.AppendText("First paragraph in section")
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Gets the first section in the document
+ IWSection section = document.AddSection();
+ //Add new table to the section
+ IWTable table = section.AddTable();
+ //Set rows and columns count
+ table.ResetCells(2, 2);
+ //Add contents to the table
+ IWParagraph paragraph = table[0, 0].AddParagraph();
+ paragraph.AppendText("Apple");
+ paragraph = table[0, 1].AddParagraph();
+ paragraph.AppendText("Red");
+ paragraph = table[1, 0].AddParagraph();
+ paragraph.AppendText("Banana");
+ paragraph = table[1, 1].AddParagraph();
+ paragraph.AppendText("Yellow");
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Gets the first section in the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new table to the section
+ Dim table As IWTable = section.AddTable()
+ 'Set rows and columns count
+ table.ResetCells(2, 2)
+ 'Add contents to the table
+ Dim paragraph As IWParagraph = table(0, 0).AddParagraph()
+ paragraph.AppendText("Apple")
+ paragraph = table(0, 1).AddParagraph()
+ paragraph.AppendText("Red")
+ paragraph = table(1, 0).AddParagraph()
+ paragraph.AppendText("Banana")
+ paragraph = table(1, 1).AddParagraph()
+ paragraph.AppendText("Yellow")
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument("Sample.docx");
+ //Gets the first section in the document
+ IWSection section = document.Sections[0];
+ //Make the columns to be of equal width
+ section.MakeColumnsEqual();
+ //Save and close the document
+ document.Save("Result.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument("Sample.docx")
+ 'Gets the first section in the document
+ Dim section As IWSection = document.Sections(0)
+ 'Make the columns to be of equal width
+ section.MakeColumnsEqual()
+ 'Save and close the document
+ document.Save("Result.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add the section into Word document
+ IWSection section = document.AddSection();
+ //Add the column into the section
+ section.AddColumn(150, 20);
+ //Add the column into the section
+ section.AddColumn(150, 20);
+ //Add the column into the section
+ section.AddColumn(150, 20);
+ //Add a paragraph to created section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add a paragraph to created section
+ paragraph = section.AddParagraph();
+ paragraph.Text = "Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula";
+ //Append the text to the created paragraph
+ paragraph.AppendText(paragraph.Text);
+ //Add the column breaks
+ paragraph.AppendBreak(BreakType.ColumnBreak);
+ //Add a paragraph to created section
+ paragraph = section.AddParagraph();
+ //Append the text to the created paragraph
+ paragraph.AppendText(paragraph.Text);
+ //Add the column breaks
+ paragraph.AppendBreak(BreakType.ColumnBreak);
+ //Add a paragraph to created section
+ paragraph = section.AddParagraph();
+ //Append the text to the created paragraph
+ paragraph.AppendText(paragraph.Text);
+ //Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add the section into Word document
+ Dim section As IWSection = document.AddSection()
+ 'Add the column into the section
+ section.AddColumn(150, 20)
+ 'Add the column into the section
+ section.AddColumn(150, 20)
+ 'Add the column into the section
+ section.AddColumn(150, 20)
+ 'Add a paragraph to created section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add a paragraph to created section
+ paragraph = section.AddParagraph()
+ Dim paraText As String = "Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula"
+ 'Append the text to the created paragraph
+ paragraph.AppendText(paraText)
+ 'Add the column breaks
+ paragraph.AppendBreak(BreakType.ColumnBreak)
+ 'Add a paragraph to created section
+ paragraph = section.AddParagraph()
+ 'Append the text to the created paragraph
+ paragraph.AppendText(paraText)
+ 'Add the column breaks
+ paragraph.AppendBreak(BreakType.ColumnBreak)
+ 'Add a paragraph to created section
+ paragraph = section.AddParagraph()
+ 'Append the text to the created paragraph
+ paragraph.AppendText(paraText)
+ 'Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument("Sample.docx");
+ //Gets the first section in the document
+ IWSection section = document.Sections[0];
+ //Make the columns to be of equal width
+ section.MakeColumnsEqual();
+ //Save and close the document
+ document.Save("Result.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument("Sample.docx")
+ 'Gets the first section in the document
+ Dim section As IWSection = document.Sections(0)
+ 'Make the columns to be of equal width
+ section.MakeColumnsEqual()
+ 'Save and close the document
+ document.Save("Result.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Gets the first section in the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ paragraph.AppendText("First paragraph in section");
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Gets the first section in the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ paragraph.AppendText("First paragraph in section")
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Gets the first section in the document
+ IWSection section = document.AddSection();
+ //Add new table to the section
+ IWTable table = section.AddTable();
+ //Set rows and columns count
+ table.ResetCells(2, 2);
+ //Add contents to the table
+ IWParagraph paragraph = table[0, 0].AddParagraph();
+ paragraph.AppendText("Apple");
+ paragraph = table[0, 1].AddParagraph();
+ paragraph.AppendText("Red");
+ paragraph = table[1, 0].AddParagraph();
+ paragraph.AppendText("Banana");
+ paragraph = table[1, 1].AddParagraph();
+ paragraph.AppendText("Yellow");
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Gets the first section in the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new table to the section
+ Dim table As IWTable = section.AddTable()
+ 'Set rows and columns count
+ table.ResetCells(2, 2)
+ 'Add contents to the table
+ Dim paragraph As IWParagraph = table(0, 0).AddParagraph()
+ paragraph.AppendText("Apple")
+ paragraph = table(0, 1).AddParagraph()
+ paragraph.AppendText("Red")
+ paragraph = table(1, 0).AddParagraph()
+ paragraph.AppendText("Banana")
+ paragraph = table(1, 1).AddParagraph()
+ paragraph.AppendText("Yellow")
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ IWSection section = document.AddSection();
+ section.AddParagraph().AppendText("Price Details");
+ section.AddParagraph();
+ //Add a new table into Word document
+ IWTable table = section.AddTable();
+ //Add the first row to table
+ WTableRow row = table.AddRow();
+ //Add the first cell into first row
+ WTableCell cell = row.AddCell();
+ //Specify the cell width
+ cell.Width = 200;
+ cell.AddParagraph().AppendText("Apple");
+ //Add the second cell into first row
+ cell = row.AddCell();
+ //Specify the cell width
+ cell.Width = 200;
+ cell.AddParagraph().AppendText("$40");
+ //Add second row to table
+ row = table.AddRow(false);
+ //Add the first cell into first row
+ cell = row.Cells[0];
+ cell.AddParagraph().AppendText("Orange");
+ //Add the second cell into first row
+ cell = row.Cells[1];
+ cell.AddParagraph().AppendText("$30");
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ Dim section As IWSection = document.AddSection()
+ section.AddParagraph().AppendText("Price Details")
+ section.AddParagraph()
+ 'Add a new table into Word document
+ Dim table As IWTable = section.AddTable()
+ 'Add the first row to table
+ Dim row As WTableRow = table.AddRow()
+ 'Add the first cell into first row
+ Dim cell As WTableCell = row.AddCell()
+ 'Specify the cell width
+ cell.Width = 200
+ cell.AddParagraph().AppendText("Apple")
+ 'Add the second cell into first row
+ cell = row.AddCell()
+ 'Specify the cell width
+ cell.Width = 200
+ cell.AddParagraph().AppendText("$40")
+ 'Add second row to table
+ row = table.AddRow(False)
+ 'Add the first cell into first row
+ cell = row.Cells(0)
+ cell.AddParagraph().AppendText("Orange")
+ 'Add the second cell into first row
+ cell = row.Cells(1)
+ cell.AddParagraph().AppendText("$30")
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ IWSection section = document.AddSection();
+ section.AddParagraph().AppendText("Price Details");
+ section.AddParagraph();
+ //Add a new table into Word document
+ IWTable table = section.AddTable();
+ //Add the first row to table
+ WTableRow row = table.AddRow();
+ //Add the first cell into first row
+ WTableCell cell = row.AddCell();
+ //Specify the cell width
+ cell.Width = 200;
+ cell.AddParagraph().AppendText("Apple");
+ //Add the second cell into first row
+ cell = row.AddCell();
+ //Specify the cell width
+ cell.Width = 200;
+ cell.AddParagraph().AppendText("$40");
+ //Add second row to table
+ row = table.AddRow(false);
+ //Add the first cell into first row
+ cell = row.Cells[0];
+ cell.AddParagraph().AppendText("Orange");
+ //Add the second cell into first row
+ cell = row.Cells[1];
+ cell.AddParagraph().AppendText("$30");
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ Dim section As IWSection = document.AddSection()
+ section.AddParagraph().AppendText("Price Details")
+ section.AddParagraph()
+ 'Add a new table into Word document
+ Dim table As IWTable = section.AddTable()
+ 'Add the first row to table
+ Dim row As WTableRow = table.AddRow()
+ 'Add the first cell into first row
+ Dim cell As WTableCell = row.AddCell()
+ 'Specify the cell width
+ cell.Width = 200
+ cell.AddParagraph().AppendText("Apple")
+ 'Add the second cell into first row
+ cell = row.AddCell()
+ 'Specify the cell width
+ cell.Width = 200
+ cell.AddParagraph().AppendText("$40")
+ 'Add second row to table
+ row = table.AddRow(False)
+ 'Add the first cell into first row
+ cell = row.Cells(0)
+ cell.AddParagraph().AppendText("Orange")
+ 'Add the second cell into first row
+ cell = row.Cells(1)
+ cell.AddParagraph().AppendText("$30")
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ IWSection section = document.AddSection();
+ section.AddParagraph().AppendText("Price Details");
+ section.AddParagraph();
+ //Add a new table into Word document
+ IWTable table = section.AddTable();
+ //Add the first row into table
+ WTableRow row = table.AddRow();
+ //Add the first cell into first row
+ WTableCell cell = row.AddCell();
+ //Specify the cell width
+ cell.Width = 200;
+ cell.AddParagraph().AppendText("Item");
+ //Add the second cell into first row
+ cell = row.AddCell();
+ //Specify the cell width
+ cell.Width = 200;
+ cell.AddParagraph().AppendText("Price($)");
+ //Add the second row into table
+ row = table.AddRow(true, false);
+ //Add the first cell into second row
+ cell = row.AddCell();
+ //Specify the cell width
+ cell.Width = 200;
+ cell.AddParagraph().AppendText("Apple");
+ //Add the second cell into second row
+ cell = row.AddCell();
+ //Specify the cell width
+ cell.Width = 200;
+ cell.AddParagraph().AppendText("50");
+ //Add the third row into table
+ row = table.AddRow(true, false);
+ //Add the first cell into third row
+ cell = row.AddCell();
+ //Specify the cell width
+ cell.Width = 200;
+ cell.AddParagraph().AppendText("Orange");
+ //Add the second cell into third row
+ cell = row.AddCell();
+ //Specify the cell width
+ cell.Width = 200;
+ cell.AddParagraph().AppendText("30");
+ document.Save("Table.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ Dim section As IWSection = document.AddSection()
+ section.AddParagraph().AppendText("Price Details")
+ section.AddParagraph()
+ 'Add a new table into Word document
+ Dim table As IWTable = section.AddTable()
+ 'Add the first row into table
+ Dim row As WTableRow = table.AddRow()
+ 'Add the first cell into first row
+ Dim cell As WTableCell = row.AddCell()
+ 'Specify the cell width
+ cell.Width = 200
+ cell.AddParagraph().AppendText("Item")
+ 'Add the second cell into first row
+ cell = row.AddCell()
+ 'Specify the cell width
+ cell.Width = 200
+ cell.AddParagraph().AppendText("Price($)")
+ 'Add the second row into table
+ row = table.AddRow(True, False)
+ 'Add the first cell into second row
+ cell = row.AddCell()
+ 'Specify the cell width
+ cell.Width = 200
+ cell.AddParagraph().AppendText("Apple")
+ 'Add the second cell into second row
+ cell = row.AddCell()
+ 'Specify the cell width
+ cell.Width = 200
+ cell.AddParagraph().AppendText("50")
+ 'Add the third row into table
+ row = table.AddRow(True, False)
+ 'Add the first cell into third row
+ cell = row.AddCell()
+ 'Specify the cell width
+ cell.Width = 200
+ cell.AddParagraph().AppendText("Orange")
+ 'Add the second cell into third row
+ cell = row.AddCell()
+ 'Specify the cell width
+ cell.Width = 200
+ cell.AddParagraph().AppendText("30")
+ document.Save("Table.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Gets the first section in the document
+ IWSection section = document.AddSection();
+ //Add new table to the section
+ IWTable table = section.AddTable();
+ //Set rows and columns count
+ table.ResetCells(2, 2);
+ //Add contents to the table
+ IWParagraph paragraph = table[0, 0].AddParagraph();
+ paragraph.AppendText("Apple");
+ paragraph = table[0, 1].AddParagraph();
+ paragraph.AppendText("Red");
+ paragraph = table[1, 0].AddParagraph();
+ paragraph.AppendText("Banana");
+ paragraph = table[1, 1].AddParagraph();
+ paragraph.AppendText("Yellow");
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Gets the first section in the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new table to the section
+ Dim table As IWTable = section.AddTable()
+ 'Set rows and columns count
+ table.ResetCells(2, 2)
+ 'Add contents to the table
+ Dim paragraph As IWParagraph = table(0, 0).AddParagraph()
+ paragraph.AppendText("Apple")
+ paragraph = table(0, 1).AddParagraph()
+ paragraph.AppendText("Red")
+ paragraph = table(1, 0).AddParagraph()
+ paragraph.AppendText("Banana")
+ paragraph = table(1, 1).AddParagraph()
+ paragraph.AppendText("Yellow")
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ IWSection section = document.AddSection();
+ //Add a new table into Word document
+ IWTable table = section.AddTable();
+ RowFormat format = new RowFormat();
+ format.BackColor = Color.LightGray;
+ format.CellSpacing = 2;
+ format.Paddings.All = 2;
+ //Set number of rows and columns
+ table.ResetCells(2, 2, format, 200);
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ Dim section As IWSection = document.AddSection()
+ 'Add a new table into Word document
+ Dim table As IWTable = section.AddTable()
+ Dim format As New RowFormat()
+ format.BackColor = Color.LightGray
+ format.CellSpacing = 2
+ format.Paddings.All = 2
+ 'Set number of rows and columns
+ table.ResetCells(2, 2, format, 200)
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ WordDocument document = new WordDocument();
+ IWSection section = document.AddSection();
+ section.AddParagraph().AppendText("Vertical merging of Table cells");
+ IWTable table = section.AddTable();
+ table.ResetCells(5, 5);
+ //Specify the vertical merge to the third cell, from second row to fifth row
+ table.ApplyVerticalMerge(2, 1, 4);
+ document.Save("VerticalMerge.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ Dim document As New WordDocument()
+ Dim section As IWSection = document.AddSection()
+ section.AddParagraph().AppendText("Vertical merging of Table cells")
+ Dim table As IWTable = section.AddTable()
+ table.ResetCells(5, 5)
+ 'Specify the vertical merge to the third cell, from second row to fifth row
+ table.ApplyVerticalMerge(2, 1, 4)
+ document.Save("VerticalMerge.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ WordDocument document = new WordDocument();
+ IWSection section = document.AddSection();
+ section.AddParagraph().AppendText("Vertical merging of Table cells");
+ IWTable table = section.AddTable();
+ table.ResetCells(5, 5);
+ //Specify the horizontal merge from second cell to fifth cell in third row
+ table.ApplyHorizontalMerge(2, 1, 4);
+ document.Save("HorizontalMerge.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ Dim document As New WordDocument()
+ Dim section As IWSection = document.AddSection()
+ section.AddParagraph().AppendText("Vertical merging of Table cells")
+ Dim table As IWTable = section.AddTable()
+ table.ResetCells(5, 5)
+ 'Specify the horizontal merge from second cell to fifth cell in third row
+ table.ApplyHorizontalMerge(2, 1, 4)
+ document.Save("HorizontalMerge.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Table.docx", FormatType.Docx);
+ WSection section = document.Sections[0];
+ //Get the table
+ WTable table = section.Tables[0] as WTable;
+ //Apply "LightShading" built-in style to table
+ table.ApplyStyle(BuiltinTableStyle.LightShading);
+ document.Save("TableStyle.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Table.docx", FormatType.Docx)
+ Dim section As WSection = document.Sections(0)
+ 'Get the table
+ Dim table As WTable = TryCast(section.Tables(0), WTable)
+ 'Apply "LightShading" built-in style to table
+ table.ApplyStyle(BuiltinTableStyle.LightShading)
+ document.Save("TableStyle.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load a template document
+ WordDocument document = new WordDocument("Template.docx");
+ //Get the table
+ WTable table = document.Sections[0].Tables[0] as WTable;
+ //Get the last cell
+ WTableCell cell = table.LastCell;
+ //Apply text direction to the last cell
+ cell.CellFormat.TextDirection = Syncfusion.DocIO.DLS.TextDirection.Vertical;
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load a template document
+ Dim document As New WordDocument("Template.docx")
+ 'Get the table
+ Dim table As WTable = TryCast(document.Sections(0).Tables(0), WTable)
+ 'Get the last cell
+ Dim cell As WTableCell = table.LastCell
+ 'Apply text direction to the last cell
+ cell.CellFormat.TextDirection = Syncfusion.DocIO.DLS.TextDirection.Vertical
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load a template document
+ WordDocument document = new WordDocument("Template.docx");
+ //Get the table
+ WTable table = document.Sections[0].Tables[0] as WTable;
+ //Get the last cell
+ WTableRow row = table.FirstRow;
+ //Apply text direction to the last cell
+ row.RowFormat.BackColor = Color.LightGray;
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load a template document
+ Dim document As New WordDocument("Template.docx")
+ 'Get the table
+ Dim table As WTable = TryCast(document.Sections(0).Tables(0), WTable)
+ 'Get the last cell
+ Dim row As WTableRow = table.FirstRow
+ 'Apply text direction to the last cell
+ row.RowFormat.BackColor = Color.LightGray
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load a template document
+ WordDocument document = new WordDocument("Template.docx");
+ //Get the table
+ WTable table = document.Sections[0].Tables[0] as WTable;
+ //Get the last cell
+ WTableRow row = table.LastRow;
+ //Apply text direction to the last cell
+ row.RowFormat.BackColor = Color.LightGray;
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load a template document
+ Dim document As New WordDocument("Template.docx")
+ 'Get the table
+ Dim table As WTable = TryCast(document.Sections(0).Tables(0), WTable)
+ 'Get the last cell
+ Dim row As WTableRow = table.LastRow
+ 'Apply text direction to the last cell
+ row.RowFormat.BackColor = Color.LightGray
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a Word document
+ WordDocument document = new WordDocument();
+ IWSection section = document.AddSection();
+ //Add new table.
+ IWTable table = section.AddTable();
+ table.ResetCells(2, 2);
+ //Add content to table cell
+ table[0, 0].AddParagraph().AppendText("First row, First cell");
+ table[0, 1].AddParagraph().AppendText("First row, Second cell");
+ table[1, 0].AddParagraph().AppendText("Second row, First cell");
+ table[1, 1].AddParagraph().AppendText("Second row, Second cell");
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a Word document
+ Dim document As New WordDocument()
+ Dim section As IWSection = document.AddSection()
+ section.AddParagraph().AppendText("Horizontal merging of Table cells")
+ 'Add new table.
+ Dim table As IWTable = section.AddTable()
+ table.ResetCells(2, 2)
+ 'Add content to table cell
+ table(0, 0).AddParagraph().AppendText("First row, First cell")
+ table(0, 1).AddParagraph().AppendText("First row, Second cell")
+ table(1, 0).AddParagraph().AppendText("Second row, First cell")
+ table(1, 1).AddParagraph().AppendText("Second row, Second cell")
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ WordDocument document = new WordDocument("Table.docx", FormatType.Docx);
+ WSection section = document.Sections[0];
+ WTable table = section.Tables[0] as WTable;
+ //Applies "LightShading" built-in style to table
+ table.ApplyStyle(BuiltinTableStyle.LightShading);
+ //Disable special formatting for header row of the table
+ table.ApplyStyleForHeaderRow = false;
+ //Save and close the document
+ document.Save("TableStyle.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ Dim document As New WordDocument("Table.docx", FormatType.Docx)
+ Dim section As WSection = document.Sections(0)
+ Dim table As WTable = TryCast(section.Tables(0), WTable)
+ 'Applies "LightShading" built-in style to table
+ table.ApplyStyle(BuiltinTableStyle.LightShading)
+ 'Disable special formatting for header row of the table
+ table.ApplyStyleForHeaderRow = False
+ 'Save and close the document
+ document.Save("TableStyle.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ WordDocument document = new WordDocument("Table.docx", FormatType.Docx);
+ WSection section = document.Sections[0];
+ WTable table = section.Tables[0] as WTable;
+ //Applies "LightShading" built-in style to table
+ table.ApplyStyle(BuiltinTableStyle.LightShading);
+ //Enable special formatting for last row of the table
+ table.ApplyStyleForLastRow = false;
+ //Save and close the document
+ document.Save("TableStyle.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ Dim document As New WordDocument("Table.docx", FormatType.Docx)
+ Dim section As WSection = document.Sections(0)
+ Dim table As WTable = TryCast(section.Tables(0), WTable)
+ 'Applies "LightShading" built-in style to table
+ table.ApplyStyle(BuiltinTableStyle.LightShading)
+ 'Enable special formatting for last row of the table
+ table.ApplyStyleForLastRow = True
+ 'Save and close the document
+ document.Save("TableStyle.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ WordDocument document = new WordDocument("Table.docx", FormatType.Docx);
+ WSection section = document.Sections[0];
+ WTable table = section.Tables[0] as WTable;
+ //Applies "LightShading" built-in style to table
+ table.ApplyStyle(BuiltinTableStyle.LightShading);
+ //Disable special formatting for first column of the table
+ table.ApplyStyleForFirstColumn = false;
+ //Save and close the document
+ document.Save("TableStyle.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ Dim document As New WordDocument("Table.docx", FormatType.Docx)
+ Dim section As WSection = document.Sections(0)
+ Dim table As WTable = TryCast(section.Tables(0), WTable)
+ 'Applies "LightShading" built-in style to table
+ table.ApplyStyle(BuiltinTableStyle.LightShading)
+ 'Disable special formatting for first column of the table
+ table.ApplyStyleForFirstColumn = False
+ 'Save and close the document
+ document.Save("TableStyle.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ WordDocument document = new WordDocument("Table.docx", FormatType.Docx);
+ WSection section = document.Sections[0];
+ WTable table = section.Tables[0] as WTable;
+ //Applies "LightShading" built-in style to table
+ table.ApplyStyle(BuiltinTableStyle.LightShading);
+ //Enable special formatting for last column of the table
+ table.ApplyStyleForLastColumn = true;
+ //Save and close the document
+ document.Save("TableStyle.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ Dim document As New WordDocument("Table.docx", FormatType.Docx)
+ Dim section As WSection = document.Sections(0)
+ Dim table As WTable = TryCast(section.Tables(0), WTable)
+ 'Applies "LightShading" built-in style to table
+ table.ApplyStyle(BuiltinTableStyle.LightShading)
+ 'Enable special formatting for last column of the table
+ table.ApplyStyleForLastColumn = True
+ 'Save and close the document
+ document.Save("TableStyle.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ WordDocument document = new WordDocument("Table.docx", FormatType.Docx);
+ WSection section = document.Sections[0];
+ WTable table = section.Tables[0] as WTable;
+ //Applies "LightShading" built-in style to table
+ table.ApplyStyle(BuiltinTableStyle.LightShading);
+ //Disable special formatting for banded rows of the table
+ table.ApplyStyleForBandedRows = false;
+ //Save and close the document
+ document.Save("TableStyle.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ Dim document As New WordDocument("Table.docx", FormatType.Docx)
+ Dim section As WSection = document.Sections(0)
+ Dim table As WTable = TryCast(section.Tables(0), WTable)
+ 'Applies "LightShading" built-in style to table
+ table.ApplyStyle(BuiltinTableStyle.LightShading)
+ 'Enable special formatting for banded rows of the table
+ table.ApplyStyleForBandedRows = False
+ 'Save and close the document
+ document.Save("TableStyle.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ WordDocument document = new WordDocument("Table.docx", FormatType.Docx);
+ WSection section = document.Sections[0];
+ WTable table = section.Tables[0] as WTable;
+ //Applies "LightShading" built-in style to table
+ table.ApplyStyle(BuiltinTableStyle.LightShading);
+ //Enable special formatting for banded columns of the table
+ table.ApplyStyleForBandedColumns = true;
+ //Save and close the document
+ document.Save("TableStyle.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ Dim document As New WordDocument("Table.docx", FormatType.Docx)
+ Dim section As WSection = document.Sections(0)
+ Dim table As WTable = TryCast(section.Tables(0), WTable)
+ 'Applies "LightShading" built-in style to table
+ table.ApplyStyle(BuiltinTableStyle.LightShading)
+ 'Enable special formatting for banded columns of the table
+ table.ApplyStyleForBandedColumns = True
+ 'Save and close the document
+ document.Save("TableStyle.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ IWSection section = document.AddSection();
+ //Add a new table into Word document
+ IWTable table = section.AddTable();
+ //Set number of rows and columns
+ table.ResetCells(2, 2);
+ //Set left indent for table.
+ table.IndentFromLeft = 10;
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ Dim section As IWSection = document.AddSection()
+ 'Add a new table into Word document
+ Dim table As IWTable = section.AddTable()
+ 'Set number of rows and columns
+ table.ResetCells(2, 2)
+ 'Set left indent for table.
+ table.IndentFromLeft = 10
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Gets the first section in the document
+ IWSection section = document.AddSection();
+ //Add new table to the section
+ IWTable table = section.AddTable();
+ //Set rows and columns count
+ table.ResetCells(2, 2);
+ //Add contents to the table
+ IWParagraph paragraph = table[0, 0].AddParagraph();
+ paragraph.AppendText("Apple");
+ paragraph = table[0, 1].AddParagraph();
+ paragraph.AppendText("Red");
+ paragraph = table[1, 0].AddParagraph();
+ paragraph.AppendText("Banana");
+ paragraph = table[1, 1].AddParagraph();
+ paragraph.AppendText("Yellow");
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Gets the first section in the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new table to the section
+ Dim table As IWTable = section.AddTable()
+ 'Set rows and columns count
+ table.ResetCells(2, 2)
+ 'Add contents to the table
+ Dim paragraph As IWParagraph = table(0, 0).AddParagraph()
+ paragraph.AppendText("Apple")
+ paragraph = table(0, 1).AddParagraph()
+ paragraph.AppendText("Red")
+ paragraph = table(1, 0).AddParagraph()
+ paragraph.AppendText("Banana")
+ paragraph = table(1, 1).AddParagraph()
+ paragraph.AppendText("Yellow")
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ IWSection section = document.AddSection();
+ //Add a new table into Word document
+ IWTable table = section.AddTable();
+ RowFormat format = new RowFormat();
+ format.BackColor = Color.LightGray;
+ format.CellSpacing = 2;
+ format.Paddings.All = 2;
+ //Set number of rows and columns
+ table.ResetCells(2, 2, format, 200);
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ Dim section As IWSection = document.AddSection()
+ 'Add a new table into Word document
+ Dim table As IWTable = section.AddTable()
+ Dim format As New RowFormat()
+ format.BackColor = Color.LightGray
+ format.CellSpacing = 2
+ format.Paddings.All = 2
+ 'Set number of rows and columns
+ table.ResetCells(2, 2, format, 200)
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document
+ WordDocument document = new WordDocument("Table.docx", FormatType.Docx);
+ WSection section = document.Sections[0];
+ //Get the table
+ WTable table = section.Tables[0] as WTable;
+ //Apply "LightShading" built-in style to table
+ table.ApplyStyle(BuiltinTableStyle.LightShading);
+ document.Save("TableStyle.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document
+ Dim document As New WordDocument("Table.docx", FormatType.Docx)
+ Dim section As WSection = document.Sections(0)
+ 'Get the table
+ Dim table As WTable = TryCast(section.Tables(0), WTable)
+ 'Apply "LightShading" built-in style to table
+ table.ApplyStyle(BuiltinTableStyle.LightShading)
+ document.Save("TableStyle.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ IWSection section = document.AddSection();
+ section.AddParagraph().AppendText("Price Details");
+ section.AddParagraph();
+ //Add a new table into Word document
+ IWTable table = section.AddTable();
+ //Add the first row to table
+ WTableRow row = table.AddRow();
+ //Add the first cell into first row
+ WTableCell cell = row.AddCell();
+ //Specify the cell width
+ cell.Width = 200;
+ cell.AddParagraph().AppendText("Apple");
+ //Add the second cell into first row
+ cell = row.AddCell();
+ //Specify the cell width
+ cell.Width = 200;
+ cell.AddParagraph().AppendText("$40");
+ //Add second row to table
+ row = table.AddRow(false);
+ //Add the first cell into first row
+ cell = row.Cells[0];
+ cell.AddParagraph().AppendText("Orange");
+ //Add the second cell into first row
+ cell = row.Cells[1];
+ cell.AddParagraph().AppendText("$30");
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ Dim section As IWSection = document.AddSection()
+ section.AddParagraph().AppendText("Price Details")
+ section.AddParagraph()
+ 'Add a new table into Word document
+ Dim table As IWTable = section.AddTable()
+ 'Add the first row to table
+ Dim row As WTableRow = table.AddRow()
+ 'Add the first cell into first row
+ Dim cell As WTableCell = row.AddCell()
+ 'Specify the cell width
+ cell.Width = 200
+ cell.AddParagraph().AppendText("Apple")
+ 'Add the second cell into first row
+ cell = row.AddCell()
+ 'Specify the cell width
+ cell.Width = 200
+ cell.AddParagraph().AppendText("$40")
+ 'Add second row to table
+ row = table.AddRow(False)
+ 'Add the first cell into first row
+ cell = row.Cells(0)
+ cell.AddParagraph().AppendText("Orange")
+ 'Add the second cell into first row
+ cell = row.Cells(1)
+ cell.AddParagraph().AppendText("$30")
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ IWSection section = document.AddSection();
+ section.AddParagraph().AppendText("Price Details");
+ section.AddParagraph();
+ //Add a new table into Word document
+ IWTable table = section.AddTable();
+ //Add the first row to table
+ WTableRow row = table.AddRow();
+ //Add the first cell into first row
+ WTableCell cell = row.AddCell();
+ //Specify the cell width
+ cell.Width = 200;
+ cell.AddParagraph().AppendText("Apple");
+ //Add the second cell into first row
+ cell = row.AddCell();
+ //Specify the cell width
+ cell.Width = 200;
+ cell.AddParagraph().AppendText("$40");
+ //Add second row to table
+ row = table.AddRow(false);
+ //Add the first cell into first row
+ cell = row.Cells[0];
+ cell.AddParagraph().AppendText("Orange");
+ //Add the second cell into first row
+ cell = row.Cells[1];
+ cell.AddParagraph().AppendText("$30");
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ Dim section As IWSection = document.AddSection()
+ section.AddParagraph().AppendText("Price Details")
+ section.AddParagraph()
+ 'Add a new table into Word document
+ Dim table As IWTable = section.AddTable()
+ 'Add the first row to table
+ Dim row As WTableRow = table.AddRow()
+ 'Add the first cell into first row
+ Dim cell As WTableCell = row.AddCell()
+ 'Specify the cell width
+ cell.Width = 200
+ cell.AddParagraph().AppendText("Apple")
+ 'Add the second cell into first row
+ cell = row.AddCell()
+ 'Specify the cell width
+ cell.Width = 200
+ cell.AddParagraph().AppendText("$40")
+ 'Add second row to table
+ row = table.AddRow(False)
+ 'Add the first cell into first row
+ cell = row.Cells(0)
+ cell.AddParagraph().AppendText("Orange")
+ 'Add the second cell into first row
+ cell = row.Cells(1)
+ cell.AddParagraph().AppendText("$30")
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ IWSection section = document.AddSection();
+ section.AddParagraph().AppendText("Price Details");
+ section.AddParagraph();
+ //Add a new table into Word document
+ IWTable table = section.AddTable();
+ //Add the first row into table
+ WTableRow row = table.AddRow();
+ //Add the first cell into first row
+ WTableCell cell = row.AddCell();
+ //Specify the cell width
+ cell.Width = 200;
+ cell.AddParagraph().AppendText("Item");
+ //Add the second cell into first row
+ cell = row.AddCell();
+ //Specify the cell width
+ cell.Width = 200;
+ cell.AddParagraph().AppendText("Price($)");
+ //Add the second row into table
+ row = table.AddRow(true, false);
+ //Add the first cell into second row
+ cell = row.AddCell();
+ //Specify the cell width
+ cell.Width = 200;
+ cell.AddParagraph().AppendText("Apple");
+ //Add the second cell into second row
+ cell = row.AddCell();
+ //Specify the cell width
+ cell.Width = 200;
+ cell.AddParagraph().AppendText("50");
+ //Add the third row into table
+ row = table.AddRow(true, false);
+ //Add the first cell into third row
+ cell = row.AddCell();
+ //Specify the cell width
+ cell.Width = 200;
+ cell.AddParagraph().AppendText("Orange");
+ //Add the second cell into third row
+ cell = row.AddCell();
+ //Specify the cell width
+ cell.Width = 200;
+ cell.AddParagraph().AppendText("30");
+ document.Save("Table.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ Dim section As IWSection = document.AddSection()
+ section.AddParagraph().AppendText("Price Details")
+ section.AddParagraph()
+ 'Add a new table into Word document
+ Dim table As IWTable = section.AddTable()
+ 'Add the first row into table
+ Dim row As WTableRow = table.AddRow()
+ 'Add the first cell into first row
+ Dim cell As WTableCell = row.AddCell()
+ 'Specify the cell width
+ cell.Width = 200
+ cell.AddParagraph().AppendText("Item")
+ 'Add the second cell into first row
+ cell = row.AddCell()
+ 'Specify the cell width
+ cell.Width = 200
+ cell.AddParagraph().AppendText("Price($)")
+ 'Add the second row into table
+ row = table.AddRow(True, False)
+ 'Add the first cell into second row
+ cell = row.AddCell()
+ 'Specify the cell width
+ cell.Width = 200
+ cell.AddParagraph().AppendText("Apple")
+ 'Add the second cell into second row
+ cell = row.AddCell()
+ 'Specify the cell width
+ cell.Width = 200
+ cell.AddParagraph().AppendText("50")
+ 'Add the third row into table
+ row = table.AddRow(True, False)
+ 'Add the first cell into third row
+ cell = row.AddCell()
+ 'Specify the cell width
+ cell.Width = 200
+ cell.AddParagraph().AppendText("Orange")
+ 'Add the second cell into third row
+ cell = row.AddCell()
+ 'Specify the cell width
+ cell.Width = 200
+ cell.AddParagraph().AppendText("30")
+ document.Save("Table.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load a template document
+ WordDocument document = new WordDocument("Template.docx");
+ //Get the table
+ WTable table = document.Sections[0].Tables[0] as WTable;
+ //Replace the text
+ table.Replace(new Regex("illustrates"), "describes");
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load a template document
+ Dim document As New WordDocument("Template.docx")
+ 'Get the table
+ Dim table As WTable = TryCast(document.Sections(0).Tables(0), WTable)
+ 'Replace the text
+ table.Replace(New Regex("illustrates"), "describes")
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load a template document
+ WordDocument document = new WordDocument("Template.docx");
+ //Get the table
+ WTable table = document.Sections[0].Tables[0] as WTable;
+ //Replace the text
+ table.Replace("illustrates", "describes", true, true);
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load a template document
+ Dim document As New WordDocument("Template.docx")
+ 'Get the table
+ Dim table As WTable = TryCast(document.Sections(0).Tables(0), WTable)
+ 'Replace the text
+ table.Replace("illustrates", "describes", True, True)
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load a template document
+ WordDocument document = new WordDocument("Template.docx");
+ //Get the table
+ WTable table = document.Sections[0].Tables[0] as WTable;
+ //Get first paragraph
+ WParagraph paragraph = document.Sections[0].Paragraphs[0];
+ //Get the text using text selection
+ TextSelection selection = new TextSelection(paragraph, 0, 20);
+ //Replace the text
+ table.Replace(new Regex("illustrates"), selection);
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load a template document
+ Dim document As New WordDocument("Template.docx")
+ 'Get the table
+ Dim table As WTable = TryCast(document.Sections(0).Tables(0), WTable)
+ 'Get first paragraph
+ Dim paragraph As WParagraph = document.Sections(0).Paragraphs(0)
+ 'Get the text using text selection
+ Dim selection As New TextSelection(paragraph, 0, 20)
+ 'Replace the text
+ table.Replace(New Regex("illustrates"), selection)
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load a template document
+ WordDocument document = new WordDocument("Template.docx");
+ //Get the table
+ WTable table = document.Sections[0].Tables[0] as WTable;
+ //Get first paragraph
+ WParagraph paragraph = document.Sections[0].Paragraphs[0];
+ //Get the text using text selection
+ TextSelection selection = new TextSelection(paragraph, 0, 20);
+ //Replace the text
+ table.Replace(new Regex("illustrates"), selection, true);
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load a template document
+ Dim document As New WordDocument("Template.docx")
+ 'Get the table
+ Dim table As WTable = TryCast(document.Sections(0).Tables(0), WTable)
+ 'Get first paragraph
+ Dim paragraph As WParagraph = document.Sections(0).Paragraphs(0)
+ 'Get the text using text selection
+ Dim selection As New TextSelection(paragraph, 0, 20)
+ 'Replace the text
+ table.Replace(New Regex("illustrates"), selection, True)
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load a template document
+ WordDocument document = new WordDocument("Template.docx");
+ //Get the table
+ WTable table = document.Sections[0].Tables[0] as WTable;
+ //Find the text in the table
+ TextSelection selection = table.Find(new Regex("content"));
+ WTextRange text = selection.GetAsOneRange();
+ //Set the character format of the text found
+ text.CharacterFormat.AllCaps = true;
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load a template document
+ Dim document As New WordDocument("Template.docx")
+ 'Get the table
+ Dim table As WTable = TryCast(document.Sections(0).Tables(0), WTable)
+ 'Find the text in the table
+ Dim selection As TextSelection = table.Find(New Regex("content"))
+ Dim text As WTextRange = selection.GetAsOneRange()
+ 'Set the character format of the text found
+ text.CharacterFormat.AllCaps = True
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ WordDocument document = new WordDocument();
+ IWSection section = document.AddSection();
+ section.AddParagraph().AppendText("Vertical merging of Table cells");
+ IWTable table = section.AddTable();
+ table.ResetCells(5, 5);
+ //Specify the vertical merge to the third cell, from second row to fifth row
+ table.ApplyVerticalMerge(2, 1, 4);
+ document.Save("VerticalMerge.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ Dim document As New WordDocument()
+ Dim section As IWSection = document.AddSection()
+ section.AddParagraph().AppendText("Vertical merging of Table cells")
+ Dim table As IWTable = section.AddTable()
+ table.ResetCells(5, 5)
+ 'Specify the vertical merge to the third cell, from second row to fifth row
+ table.ApplyVerticalMerge(2, 1, 4)
+ document.Save("VerticalMerge.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ WordDocument document = new WordDocument();
+ IWSection section = document.AddSection();
+ section.AddParagraph().AppendText("Vertical merging of Table cells");
+ IWTable table = section.AddTable();
+ table.ResetCells(5, 5);
+ //Specify the horizontal merge from second cell to fifth cell in third row
+ table.ApplyHorizontalMerge(2, 1, 4);
+ document.Save("HorizontalMerge.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ Dim document As New WordDocument()
+ Dim section As IWSection = document.AddSection()
+ section.AddParagraph().AppendText("Vertical merging of Table cells")
+ Dim table As IWTable = section.AddTable()
+ table.ResetCells(5, 5)
+ 'Specify the horizontal merge from second cell to fifth cell in third row
+ table.ApplyHorizontalMerge(2, 1, 4)
+ document.Save("HorizontalMerge.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ //Loads the template document
+ WordDocument document = new WordDocument("Sample.docx");
+ //Accesses the instance of the first section in the Word document
+ WSection section = document.Sections[0];
+ //Accesses the instance of the first table in the section
+ WTable table = section.Tables[0] as WTable;
+ //Auto fits the table with respect to window.
+ table.AutoFit(AutoFitType.FitToWindow);
+ //Saves and closes the document instance
+ document.Save("TableAutoFit.docx");
+ document.Close();
+
+
+ Private Sub SurroundingSub()
+ Dim document As WordDocument = New WordDocument("Sample.docx")
+ Dim section As WSection = document.Sections(0)
+ Dim table As WTable = TryCast(section.Tables(0), WTable)
+ table.AutoFit(AutoFitType.FitToWindow)
+ document.Save("TableAutoFit.docx")
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load a template document
+ WordDocument document = new WordDocument("Template.docx");
+ //Get the table
+ WTable table = document.Sections[0].Tables[0] as WTable;
+ //Get the last cell
+ WTableCell cell = table.LastCell;
+ //Apply text direction to the last cell
+ cell.CellFormat.TextDirection = Syncfusion.DocIO.DLS.TextDirection.Vertical;
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load a template document
+ Dim document As New WordDocument("Template.docx")
+ 'Get the table
+ Dim table As WTable = TryCast(document.Sections(0).Tables(0), WTable)
+ 'Get the last cell
+ Dim cell As WTableCell = table.LastCell
+ 'Apply text direction to the last cell
+ cell.CellFormat.TextDirection = Syncfusion.DocIO.DLS.TextDirection.Vertical
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load a template document
+ WordDocument document = new WordDocument("Template.docx");
+ //Get the table
+ WTable table = document.Sections[0].Tables[0] as WTable;
+ //Get the last cell
+ WTableRow row = table.FirstRow;
+ //Apply text direction to the last cell
+ row.RowFormat.BackColor = Color.LightGray;
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load a template document
+ Dim document As New WordDocument("Template.docx")
+ 'Get the table
+ Dim table As WTable = TryCast(document.Sections(0).Tables(0), WTable)
+ 'Get the last cell
+ Dim row As WTableRow = table.FirstRow
+ 'Apply text direction to the last cell
+ row.RowFormat.BackColor = Color.LightGray
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load a template document
+ WordDocument document = new WordDocument("Template.docx");
+ //Get the table
+ WTable table = document.Sections[0].Tables[0] as WTable;
+ //Get the last cell
+ WTableRow row = table.LastRow;
+ //Apply text direction to the last cell
+ row.RowFormat.BackColor = Color.LightGray;
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load a template document
+ Dim document As New WordDocument("Template.docx")
+ 'Get the table
+ Dim table As WTable = TryCast(document.Sections(0).Tables(0), WTable)
+ 'Get the last cell
+ Dim row As WTableRow = table.LastRow
+ 'Apply text direction to the last cell
+ row.RowFormat.BackColor = Color.LightGray
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a Word document
+ WordDocument document = new WordDocument();
+ IWSection section = document.AddSection();
+ //Add new table.
+ IWTable table = section.AddTable();
+ table.ResetCells(2, 2);
+ //Add content to table cell
+ table[0, 0].AddParagraph().AppendText("First row, First cell");
+ table[0, 1].AddParagraph().AppendText("First row, Second cell");
+ table[1, 0].AddParagraph().AppendText("Second row, First cell");
+ table[1, 1].AddParagraph().AppendText("Second row, Second cell");
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a Word document
+ Dim document As New WordDocument()
+ Dim section As IWSection = document.AddSection()
+ section.AddParagraph().AppendText("Horizontal merging of Table cells")
+ 'Add new table.
+ Dim table As IWTable = section.AddTable()
+ table.ResetCells(2, 2)
+ 'Add content to table cell
+ table(0, 0).AddParagraph().AppendText("First row, First cell")
+ table(0, 1).AddParagraph().AppendText("First row, Second cell")
+ table(1, 0).AddParagraph().AppendText("Second row, First cell")
+ table(1, 1).AddParagraph().AppendText("Second row, Second cell")
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ IWSection section = document.AddSection();
+ //Add a new table into Word document
+ IWTable table = section.AddTable();
+ //Set number of rows and columns
+ table.ResetCells(2, 2);
+ //Set left indent for table.
+ table.IndentFromLeft = 10;
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ Dim section As IWSection = document.AddSection()
+ 'Add a new table into Word document
+ Dim table As IWTable = section.AddTable()
+ 'Set number of rows and columns
+ table.ResetCells(2, 2)
+ 'Set left indent for table.
+ table.IndentFromLeft = 10
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ WordDocument document = new WordDocument("Table.docx", FormatType.Docx);
+ WSection section = document.Sections[0];
+ WTable table = section.Tables[0] as WTable;
+ //Applies "LightShading" built-in style to table
+ table.ApplyStyle(BuiltinTableStyle.LightShading);
+ //Disable special formatting for header row of the table
+ table.ApplyStyleForHeaderRow = false;
+ //Save and close the document
+ document.Save("TableStyle.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ Dim document As New WordDocument("Table.docx", FormatType.Docx)
+ Dim section As WSection = document.Sections(0)
+ Dim table As WTable = TryCast(section.Tables(0), WTable)
+ 'Applies "LightShading" built-in style to table
+ table.ApplyStyle(BuiltinTableStyle.LightShading)
+ 'Disable special formatting for header row of the table
+ table.ApplyStyleForHeaderRow = False
+ 'Save and close the document
+ document.Save("TableStyle.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ WordDocument document = new WordDocument("Table.docx", FormatType.Docx);
+ WSection section = document.Sections[0];
+ WTable table = section.Tables[0] as WTable;
+ //Applies "LightShading" built-in style to table
+ table.ApplyStyle(BuiltinTableStyle.LightShading);
+ //Enable special formatting for last row of the table
+ table.ApplyStyleForLastRow = false;
+ //Save and close the document
+ document.Save("TableStyle.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ Dim document As New WordDocument("Table.docx", FormatType.Docx)
+ Dim section As WSection = document.Sections(0)
+ Dim table As WTable = TryCast(section.Tables(0), WTable)
+ 'Applies "LightShading" built-in style to table
+ table.ApplyStyle(BuiltinTableStyle.LightShading)
+ 'Enable special formatting for last row of the table
+ table.ApplyStyleForLastRow = True
+ 'Save and close the document
+ document.Save("TableStyle.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ WordDocument document = new WordDocument("Table.docx", FormatType.Docx);
+ WSection section = document.Sections[0];
+ WTable table = section.Tables[0] as WTable;
+ //Applies "LightShading" built-in style to table
+ table.ApplyStyle(BuiltinTableStyle.LightShading);
+ //Disable special formatting for first column of the table
+ table.ApplyStyleForFirstColumn = false;
+ //Save and close the document
+ document.Save("TableStyle.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ Dim document As New WordDocument("Table.docx", FormatType.Docx)
+ Dim section As WSection = document.Sections(0)
+ Dim table As WTable = TryCast(section.Tables(0), WTable)
+ 'Applies "LightShading" built-in style to table
+ table.ApplyStyle(BuiltinTableStyle.LightShading)
+ 'Disable special formatting for first column of the table
+ table.ApplyStyleForFirstColumn = False
+ 'Save and close the document
+ document.Save("TableStyle.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ WordDocument document = new WordDocument("Table.docx", FormatType.Docx);
+ WSection section = document.Sections[0];
+ WTable table = section.Tables[0] as WTable;
+ //Applies "LightShading" built-in style to table
+ table.ApplyStyle(BuiltinTableStyle.LightShading);
+ //Enable special formatting for last column of the table
+ table.ApplyStyleForLastColumn = true;
+ //Save and close the document
+ document.Save("TableStyle.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ Dim document As New WordDocument("Table.docx", FormatType.Docx)
+ Dim section As WSection = document.Sections(0)
+ Dim table As WTable = TryCast(section.Tables(0), WTable)
+ 'Applies "LightShading" built-in style to table
+ table.ApplyStyle(BuiltinTableStyle.LightShading)
+ 'Enable special formatting for last column of the table
+ table.ApplyStyleForLastColumn = True
+ 'Save and close the document
+ document.Save("TableStyle.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ WordDocument document = new WordDocument("Table.docx", FormatType.Docx);
+ WSection section = document.Sections[0];
+ WTable table = section.Tables[0] as WTable;
+ //Applies "LightShading" built-in style to table
+ table.ApplyStyle(BuiltinTableStyle.LightShading);
+ //Disable special formatting for banded rows of the table
+ table.ApplyStyleForBandedRows = false;
+ //Save and close the document
+ document.Save("TableStyle.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ Dim document As New WordDocument("Table.docx", FormatType.Docx)
+ Dim section As WSection = document.Sections(0)
+ Dim table As WTable = TryCast(section.Tables(0), WTable)
+ 'Applies "LightShading" built-in style to table
+ table.ApplyStyle(BuiltinTableStyle.LightShading)
+ 'Enable special formatting for banded rows of the table
+ table.ApplyStyleForBandedRows = False
+ 'Save and close the document
+ document.Save("TableStyle.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ WordDocument document = new WordDocument("Table.docx", FormatType.Docx);
+ WSection section = document.Sections[0];
+ WTable table = section.Tables[0] as WTable;
+ //Applies "LightShading" built-in style to table
+ table.ApplyStyle(BuiltinTableStyle.LightShading);
+ //Enable special formatting for banded columns of the table
+ table.ApplyStyleForBandedColumns = true;
+ //Save and close the document
+ document.Save("TableStyle.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ Dim document As New WordDocument("Table.docx", FormatType.Docx)
+ Dim section As WSection = document.Sections(0)
+ Dim table As WTable = TryCast(section.Tables(0), WTable)
+ 'Applies "LightShading" built-in style to table
+ table.ApplyStyle(BuiltinTableStyle.LightShading)
+ 'Enable special formatting for banded columns of the table
+ table.ApplyStyleForBandedColumns = True
+ 'Save and close the document
+ document.Save("TableStyle.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load a template document
+ WordDocument document = new WordDocument("Template.docx");
+ //Get the table
+ WTable table = document.Sections[0].Tables[0] as WTable;
+ //Find the text in the table
+ TextSelection selection = table.Find(new Regex("Cell"));
+ WTextRange text = selection.GetAsOneRange();
+ //Get the owner paragraph
+ WParagraph paragraph = text.OwnerParagraph;
+ //Get the owner cell
+ WTableCell cell = paragraph.OwnerTextBody as WTableCell;
+ //Get the index of the cell
+ int index = cell.GetCellIndex();
+ //Apply text direction to the next cell
+ cell = cell.OwnerRow.Cells[index + 1];
+ cell.CellFormat.TextDirection = Syncfusion.DocIO.DLS.TextDirection.Vertical;
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load a template document
+ Dim document As New WordDocument("Template.docx")
+ 'Get the table
+ Dim table As WTable = TryCast(document.Sections(0).Tables(0), WTable)
+ 'Find the text in the table
+ Dim selection As TextSelection = table.Find(New Regex("Cell"))
+ Dim text As WTextRange = selection.GetAsOneRange()
+ 'Get the owner paragraph
+ Dim paragraph As WParagraph = text.OwnerParagraph
+ 'Get the owner cell
+ Dim cell As WTableCell = TryCast(paragraph.OwnerTextBody, WTableCell)
+ 'Get the index of the cell
+ Dim index As Integer = cell.GetCellIndex()
+ 'Apply text direction to the next cell
+ cell = cell.OwnerRow.Cells(index + 1)
+ cell.CellFormat.TextDirection = Syncfusion.DocIO.DLS.TextDirection.Vertical
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ WordDocument document = new WordDocument();
+ //Adds new section to the document.
+ IWSection section = document.AddSection();
+ //Adds new table to the section.
+ IWTable table = section.AddTable();
+ //Adds new row to the table.
+ WTableRow tableRow = table.AddRow();
+ //Adds new cell to the row.
+ WTableCell tableCell = tableRow.AddCell();
+ tableCell.Width = 100;
+ //Adds new paragraph to the cell.
+ IWParagraph paragraph = tableCell.AddParagraph();
+ //Adds new text to the paragraph.
+ paragraph.AppendText("Content Control");
+ //Create the Cell Content Control for the document.
+ CellContentControl control = new CellContentControl(document);
+ //Change the color value in Content Control properties.
+ control.ContentControlProperties.Color = System.Drawing.Color.Green;
+ //Set it to the row content control.
+ tableCell.ContentControl = control;
+ //Save the Word document.
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document.
+ document.Close();
+
+
+ Dim document As New WordDocument()
+ 'Adds new section to the document.
+ Dim section As IWSection = document.AddSection()
+ 'Adds new table to the section.
+ Dim table As IWTable = section.AddTable()
+ 'Adds new row to the table.
+ Dim tableRow As WTableRow = table.AddRow()
+ 'Adds new cell to the row.
+ Dim tableCell As WTableCell = tableRow.AddCell()
+ tableCell.Width = 100
+ 'Adds new paragraph to the cell.
+ Dim paragraph As IWParagraph = tableCell.AddParagraph()
+ 'Adds new text to the paragraph.
+ paragraph.AppendText("Content Control")
+ 'Create the Cell Content Control for the document.
+ Dim control As New CellContentControl(document)
+ 'Change the color value in Content Control properties.
+ control.ContentControlProperties.Color = System.Drawing.Color.Green
+ ' Set it to the row content control.
+ tableCell.ContentControl = control
+ 'Save the Word document.
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document.
+ document.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load a template document
+ WordDocument document = new WordDocument("Template.docx");
+ //Get the table
+ WTable table = document.Sections[0].Tables[0] as WTable;
+ //Find the text in the table
+ TextSelection selection = table.Find(new Regex("Cell"));
+ WTextRange text = selection.GetAsOneRange();
+ //Get the owner paragraph
+ WParagraph paragraph = text.OwnerParagraph;
+ //Get the owner cell
+ WTableCell cell = paragraph.OwnerTextBody as WTableCell;
+ //Get the index of the cell
+ int index = cell.GetCellIndex();
+ //Apply text direction to the next cell
+ WTableRow row = cell.OwnerRow;
+ row.RowFormat.BackColor = Color.LightGray;
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load a template document
+ Dim document As New WordDocument("Template.docx")
+ 'Get the table
+ Dim table As WTable = TryCast(document.Sections(0).Tables(0), WTable)
+ 'Find the text in the table
+ Dim selection As TextSelection = table.Find(New Regex("Cell"))
+ Dim text As WTextRange = selection.GetAsOneRange()
+ 'Get the owner paragraph
+ Dim paragraph As WParagraph = text.OwnerParagraph
+ 'Get the owner cell
+ Dim cell As WTableCell = TryCast(paragraph.OwnerTextBody, WTableCell)
+ 'Get the index of the cell
+ Dim index As Integer = cell.GetCellIndex()
+ 'Apply text direction to the next cell
+ Dim row As WTableRow = cell.OwnerRow
+ row.RowFormat.BackColor = Color.LightGray
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load a template document
+ WordDocument document = new WordDocument("Template.docx");
+ //Get the table
+ WTable table = document.Sections[0].Tables[0] as WTable;
+ foreach (WTableRow row in table.Rows)
+ {
+ foreach (WTableCell cell in row.Cells)
+ {
+ cell.Width = 100;
+ }
+ }
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load a template document
+ Dim document As New WordDocument("Template.docx")
+ 'Get the table
+ Dim table As WTable = TryCast(document.Sections(0).Tables(0), WTable)
+ For Each row As WTableRow In table.Rows
+ For Each cell As WTableCell In row.Cells
+ cell.Width = 100
+ Next
+ Next
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ WordDocument document = new WordDocument();
+ IWSection section = document.AddSection();
+ section.AddParagraph().AppendText("Price Details");
+ section.AddParagraph();
+ //Add a new table into Word document
+ IWTable table = section.AddTable();
+ //Add the first row into table
+ WTableRow row = table.AddRow();
+ //Add the first cell into first row
+ WTableCell cell = row.AddCell();
+ cell.Width = 100;
+ cell.AddParagraph().AppendText("Orange");
+ //Add the second cell into first row
+ cell = row.AddCell();
+ cell.Width = 100;
+ cell.AddParagraph().AppendText("$30");
+ //Add the second row into table
+ row = table.AddRow(true, false);
+ //Add the first cell into second row
+ cell = row.AddCell();
+ cell.Width = 100;
+ cell.AddParagraph().AppendText("Apple");
+ //Add the second cell into second row
+ cell = row.AddCell();
+ cell.Width = 100;
+ cell.AddParagraph().AppendText("$50");
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ Dim document As New WordDocument()
+ Dim section As IWSection = document.AddSection()
+ section.AddParagraph().AppendText("Price Details")
+ section.AddParagraph()
+ 'Add a new table into Word document
+ Dim table As IWTable = section.AddTable()
+ 'Add the first row into table
+ Dim row As WTableRow = table.AddRow()
+ 'Add the first cell into first row
+ Dim cell As WTableCell = row.AddCell()
+ cell.Width = 100
+ cell.AddParagraph().AppendText("Orange")
+ 'Add the second cell into first row
+ cell = row.AddCell()
+ cell.Width = 100
+ cell.AddParagraph().AppendText("$30")
+ 'Add the second row into table
+ row = table.AddRow(True, False)
+ 'Add the first cell into second row
+ cell = row.AddCell()
+ cell.Width = 100
+ cell.AddParagraph().AppendText("Apple")
+ 'Add the second cell into second row
+ cell = row.AddCell()
+ cell.Width = 100
+ cell.AddParagraph().AppendText("$50")
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ WordDocument document = new WordDocument();
+ IWSection section = document.AddSection();
+ section.AddParagraph().AppendText("Price Details");
+ section.AddParagraph();
+ //Add a new table into Word document
+ IWTable table = section.AddTable();
+ //Add the first row into table
+ WTableRow row = table.AddRow();
+ //Add the first cell into first row
+ WTableCell cell = row.AddCell();
+ cell.Width = 100;
+ cell.AddParagraph().AppendText("Orange");
+ //Add the second cell into first row
+ cell = row.AddCell();
+ cell.Width = 100;
+ cell.AddParagraph().AppendText("$30");
+ //Add the second row into table
+ row = table.AddRow(true, false);
+ //Add the first cell into second row
+ cell = row.AddCell();
+ cell.Width = 50;
+ cell.AddParagraph().AppendText("Apple");
+ //Add the second cell into second row
+ cell = row.AddCell(true);
+ cell.AddParagraph().AppendText("$50");
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ Dim document As New WordDocument()
+ Dim section As IWSection = document.AddSection()
+ section.AddParagraph().AppendText("Price Details")
+ section.AddParagraph()
+ 'Add a new table into Word document
+ Dim table As IWTable = section.AddTable()
+ 'Add the first row into table
+ Dim row As WTableRow = table.AddRow()
+ 'Add the first cell into first row
+ Dim cell As WTableCell = row.AddCell()
+ cell.Width = 100
+ cell.AddParagraph().AppendText("Orange")
+ 'Add the second cell into first row
+ cell = row.AddCell()
+ cell.Width = 100
+ cell.AddParagraph().AppendText("$30")
+ 'Add the second row into table
+ row = table.AddRow(True, False)
+ 'Add the first cell into second row
+ cell = row.AddCell()
+ cell.Width = 50
+ cell.AddParagraph().AppendText("Apple")
+ 'Add the second cell into second row
+ cell = row.AddCell(True)
+ cell.AddParagraph().AppendText("$50")
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load a template document
+ WordDocument document = new WordDocument("Template.docx");
+ //Get the table
+ WTable table = document.Sections[0].Tables[0] as WTable;
+ //Find the text in the table
+ TextSelection selection = table.Find(new Regex("Cell"));
+ WTextRange text = selection.GetAsOneRange();
+ //Get the owner paragraph
+ WParagraph paragraph = text.OwnerParagraph;
+ //Get the owner cell
+ WTableCell cell = paragraph.OwnerTextBody as WTableCell;
+ //Get the row index.
+ int index = cell.OwnerRow.GetRowIndex();
+ //Set height for next row
+ table.Rows[index + 1].Height = 20;
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load a template document
+ Dim document As New WordDocument("Template.docx")
+ 'Get the table
+ Dim table As WTable = TryCast(document.Sections(0).Tables(0), WTable)
+ 'Find the text in the table
+ Dim selection As TextSelection = table.Find(New Regex("Cell"))
+ Dim text As WTextRange = selection.GetAsOneRange()
+ 'Get the owner paragraph
+ Dim paragraph As WParagraph = text.OwnerParagraph
+ 'Get the owner cell
+ Dim cell As WTableCell = TryCast(paragraph.OwnerTextBody, WTableCell)
+ 'Get the row index.
+ Dim index As Integer = cell.OwnerRow.GetRowIndex()
+ 'Set height for next row
+ table.Rows(index + 1).Height = 20
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ IWSection section = document.AddSection();
+ //Add a new table into Word document
+ IWTable table = section.AddTable();
+ //Set number of rows and columns
+ table.ResetCells(2, 2);
+ //Set row height and type.
+ table.Rows[1].Height = 20;
+ table.Rows[1].HeightType = TableRowHeightType.AtLeast;
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ Dim section As IWSection = document.AddSection()
+ 'Add a new table into Word document
+ Dim table As IWTable = section.AddTable()
+ 'Set number of rows and columns
+ table.ResetCells(2, 2)
+ 'Set row height and type.
+ table.Rows(1).Height = 20
+ table.Rows(1).HeightType = TableRowHeightType.AtLeast
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ WordDocument document = new WordDocument();
+ //Adds new section to the document.
+ IWSection section = document.AddSection();
+ //Adds new table to the section.
+ IWTable table = section.AddTable();
+ //Adds new row to the table.
+ WTableRow tableRow = table.AddRow();
+ //Adds new cell to the row.
+ WTableCell tableCell = tableRow.AddCell();
+ tableCell.Width = 100;
+ //Adds new paragraph to the cell.
+ IWParagraph paragraph = tableCell.AddParagraph();
+ //Adds new text to the paragraph.
+ paragraph.AppendText("Content Control");
+ //Create the Row Content Control for the document.
+ RowContentControl control = new RowContentControl(document);
+ //Change the color value in Content Control properties.
+ control.ContentControlProperties.Color = System.Drawing.Color.Blue;
+ // Sets it to the row content control.
+ tableRow.ContentControl = control;
+ //Save the Word document.
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document.
+ document.Close();
+
+
+ Dim document As New WordDocument()
+ 'Adds new section to the document.
+ Dim section As IWSection = document.AddSection()
+ 'Adds new table to the section.
+ Dim table As IWTable = section.AddTable()
+ 'Adds new row to the table.
+ Dim tableRow As WTableRow = table.AddRow()
+ 'Adds new cell to the row.
+ Dim tableCell As WTableCell = tableRow.AddCell()
+ tableCell.Width = 100
+ 'Adds new paragraph to the cell.
+ Dim paragraph As IWParagraph = tableCell.AddParagraph()
+ 'Adds new text to the paragraph.
+ paragraph.AppendText("Content Control")
+ 'Create the Row Content Control for the document.
+ Dim control As New RowContentControl(document)
+ 'Change the color value in Content Control properties.
+ control.ContentControlProperties.Color = System.Drawing.Color.Blue
+ ' Sets it to the row content control.
+ tableRow.ContentControl = control
+ 'Save the Word document.
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document.
+ document.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Loads an existing document
+ WordDocument document = new WordDocument("Template.docx");
+ HTMLExport export = new HTMLExport();
+ //The images in the input document will be copied to this folder
+ document.SaveOptions.HtmlExportImagesFolder = @"D:\Data\";
+ //The headers and footers in the input will be exported
+ document.SaveOptions.HtmlExportHeadersFooters = true;
+ //Export the text form fields as editable
+ document.SaveOptions.HtmlExportTextInputFormFieldAsText = false;
+ //Set the style sheet type
+ document.SaveOptions.HtmlExportCssStyleSheetType = CssStyleSheetType.External;
+ //Set name for style sheet
+ document.SaveOptions.HtmlExportCssStyleSheetFileName = "UserDefinedFileName.css";
+ //Save the document as html file
+ export.SaveAsXhtml(document, "WordtoHtml.html");
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Loads an existing document
+ Dim document As New WordDocument("Template.docx")
+ Dim export As New HTMLExport()
+ 'The images in the input document will be copied to this folder
+ document.SaveOptions.HtmlExportImagesFolder = "D:\Data\"
+ 'The headers and footers in the input will be exported
+ document.SaveOptions.HtmlExportHeadersFooters = True
+ 'Export the text form fields as editable
+ document.SaveOptions.HtmlExportTextInputFormFieldAsText = False
+ 'Set the style sheet type
+ document.SaveOptions.HtmlExportCssStyleSheetType = CssStyleSheetType.External
+ 'Set name for style sheet
+ document.SaveOptions.HtmlExportCssStyleSheetFileName = "UserDefinedFileName.css"
+ 'Save the document as html file
+ export.SaveAsXhtml(document, "WordtoHtml.html")
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ //Export the fonts used in the document
+ document.SaveOptions.EPubExportFont = true;
+ //Export header and footer
+ document.SaveOptions.HtmlExportHeadersFooters = true;
+ //Save the document as EPub file
+ document.Save("WordToEPub.epub", FormatType.EPub);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ 'Export the fonts used in the document
+ document.SaveOptions.EPubExportFont = True
+ 'Export header and footer
+ document.SaveOptions.HtmlExportHeadersFooters = True
+ 'Save the document as EPub file
+ document.Save("WordToEPub.epub", FormatType.EPub)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing document
+ WordDocument document = new WordDocument("Template.doc", FormatType.Doc);
+ //Preserve compatibility mode as in the input Word document
+ document.SaveOptions.MaintainCompatibilityMode = true;
+ //Save the document as Docx file
+ document.Save("Result.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing document
+ Dim document As New WordDocument("Template.doc", FormatType.Doc)
+ 'Export the fonts used in the document
+ document.SaveOptions.EPubExportFont = True
+ 'Preserve compatibility mode as in the input Word document
+ document.SaveOptions.MaintainCompatibilityMode = True
+ 'Save the document as Docx file
+ document.Save("Result.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ Open the document
+ WordDocument document = new WordDocument("Sample.docx");
+ Set the folder location to export the images
+ document.SaveOptions.MarkdownExportImagesFolder = @"D:/WordToMarkdownConversion/";
+ Save as Markdown document
+ document.Save("Result.md", FormatType.Markdown);
+ Close the document
+ document.Close();
+
+
+ //'Opens the document.
+ Dim document As WordDocument = New WordDocument("Sample.docx");
+ Set the folder location to export the images
+ document.SaveOptions.MarkdownExportImagesFolder = @"D:/WordToMarkdownConversion/";
+ Save as Markdown document
+ document.Save("Result.md", FormatType.Markdown);
+ Close the document
+ document.Close();
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing document
+ WordDocument document = new WordDocument("Template.rtf", FormatType.Rtf);
+ //Sets the OptmizedRtfFileSize property as true
+ document.SaveOptions.OptimizeRtfFileSize = true;
+ //Save the document as Docx file
+ document.Save("Result.rtf", FormatType.Rtf);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing document
+ Dim document As New WordDocument("Template.rtf", FormatType.Rtf)
+ 'Sets the OptmizedRtfFileSize property as true
+ document.SaveOptions.OptimizeRtfFileSize = True
+ 'Save the document as Docx file
+ document.Save("Result.rtf", FormatType.Rtf)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ //Opens an existing Word document
+ WordDocument document = new WordDocument("Input.docx");
+ //Disables a flag to export HTML without WordCompatiblity
+ document.SaveOptions.HTMLExportWithWordCompatiblity = false;
+ //Saves the document
+ document.Save("Output.html", FormatType.Html);
+ //Closes the document
+ document.Close();
+
+
+ 'Opens an existing Word document
+ Dim document As WordDocument = New WordDocument("Input.docx")
+ 'Disables a flag to export HTML without WordCompatiblity
+ document.SaveOptions.HTMLExportWithWordCompatiblity = False
+ 'Saves the document
+ document.Save("Output.html", FormatType.Html)
+ 'Close the document
+ document.Close()
+
+
+ //Loads an existing Word document
+ WordDocument wordDocument = new WordDocument("Template.docx", FormatType.Docx);
+ //Sets ShowInBalloons to render a document comments in converted PDF document.
+ wordDocument.RevisionOptions.CommentDisplayMode = CommentDisplayMode.ShowInBalloons;
+ //Instantiation of DocToPDFConverter for Word to PDF conversion
+ DocToPDFConverter converter = new DocToPDFConverter();
+ //Converts Word document into PDF document
+ PdfDocument pdfDocument = converter.ConvertToPDF(wordDocument);
+ //Saves the PDF file
+ pdfDocument.Save("WordtoPDF.pdf");
+ //Releases all resources used by the object
+ converter.Dispose();
+ //Closes the instance of document objects
+ wordDocument.Close();
+ pdfDocument.Close(true);
+
+
+ 'Loads an existing Word document
+ Dim wordDocument As WordDocument = New WordDocument("Template.docx", FormatType.Docx)
+ 'Sets ShowInBalloons to render a document comments in converted PDF document.
+ wordDocument.RevisionOptions.CommentDisplayMode = CommentDisplayMode.ShowInBalloons
+ 'Instantiation of DocToPDFConverter for Word to PDF conversion
+ Dim converter As DocToPDFConverter = New DocToPDFConverter
+ 'Converts Word document into PDF document
+ Dim pdfDocument As PdfDocument = converter.ConvertToPDF(wordDocument)
+ 'Saves the PDF file
+ pdfDocument.Save("WordtoPDF.pdf")
+ 'Releases all resources used by the object
+ converter.Dispose()
+ 'Closes the instance of document objects
+ wordDocument.Close()
+ pdfDocument.Close(True)
+
+
+ //Loads an existing Word document
+ WordDocument wordDocument = new WordDocument("Template.docx", FormatType.Docx);
+ //Sets ShowInBalloons to render a document comments in converted PDF document.
+ wordDocument.RevisionOptions.CommentDisplayMode = CommentDisplayMode.ShowInBalloons;
+ //Sets the color to be used for Comment Balloon.
+ wordDocument.RevisionOptions.CommentColor = RevisionColor.Pink;
+ //Instantiation of DocToPDFConverter for Word to PDF conversion
+ DocToPDFConverter converter = new DocToPDFConverter();
+ //Converts Word document into PDF document
+ PdfDocument pdfDocument = converter.ConvertToPDF(wordDocument);
+ //Saves the PDF file
+ pdfDocument.Save("WordtoPDF.pdf");
+ //Releases all resources used by the object
+ converter.Dispose();
+ //Closes the instance of document objects
+ wordDocument.Close();
+ pdfDocument.Close(true);
+
+
+ 'Loads an existing Word document
+ Dim wordDocument As WordDocument = New WordDocument("Template.docx", FormatType.Docx)
+ 'Sets ShowInBalloons to render a document comments in converted PDF document.
+ wordDocument.RevisionOptions.CommentDisplayMode = CommentDisplayMode.ShowInBalloons
+ 'Sets the color to be used for Comment Balloon.
+ wordDocument.RevisionOptions.CommentColor = RevisionColor.Pink
+ 'Instantiation of DocToPDFConverter for Word to PDF conversion
+ Dim converter As DocToPDFConverter = New DocToPDFConverter
+ 'Converts Word document into PDF document
+ Dim pdfDocument As PdfDocument = converter.ConvertToPDF(wordDocument)
+ 'Saves the PDF file
+ pdfDocument.Save("WordtoPDF.pdf")
+ 'Releases all resources used by the object
+ converter.Dispose()
+ 'Closes the instance of document objects
+ wordDocument.Close()
+ pdfDocument.Close(True)
+
+
+ //Loads an existing Word document
+ WordDocument wordDocument = new WordDocument("Template.docx", FormatType.Docx);
+ //Sets revision types to preserve track changes in PDF conversion.
+ wordDocument.RevisionOptions.ShowMarkup = RevisionType.Insertions | RevisionType.Formatting | RevisionType.Deletions;
+ //Sets the color for Revision mark color.
+ wordDocument.RevisionOptions.RevisionBarsColor = RevisionColor.Pink;
+ //Instantiation of DocToPDFConverter for Word to PDF conversion
+ DocToPDFConverter converter = new DocToPDFConverter();
+ //Converts Word document into PDF document
+ PdfDocument pdfDocument = converter.ConvertToPDF(wordDocument);
+ //Saves the PDF file
+ pdfDocument.Save("WordtoPDF.pdf");
+ //Releases all resources used by the object
+ converter.Dispose();
+ //Closes the instance of document objects
+ wordDocument.Close();
+ pdfDocument.Close(true);
+
+
+ 'Loads an existing Word document
+ Dim wordDocument As WordDocument = New WordDocument("Template.docx", FormatType.Docx)
+ 'Sets revision types to preserve track changes in PDF conversion.
+ wordDocument.RevisionOptions.ShowMarkup = RevisionType.Insertions Or RevisionType.Formatting Or RevisionType.Deletions
+ 'Sets the color for Revision mark color.
+ wordDocument.RevisionOptions.RevisionBarsColor = RevisionColor.Pink
+ 'Instantiation of DocToPDFConverter for Word to PDF conversion
+ Dim converter As DocToPDFConverter = New DocToPDFConverter
+ 'Converts Word document into PDF document
+ Dim pdfDocument As PdfDocument = converter.ConvertToPDF(wordDocument)
+ 'Saves the PDF file
+ pdfDocument.Save("WordtoPDF.pdf")
+ 'Releases all resources used by the object
+ converter.Dispose()
+ 'Closes the instance of document objects
+ wordDocument.Close()
+ pdfDocument.Close(True)
+
+
+ //Loads an existing Word document
+ WordDocument wordDocument = new WordDocument("Template.docx", FormatType.Docx);
+ //Sets revision types to preserve track changes in PDF conversion.
+ wordDocument.RevisionOptions.ShowMarkup = RevisionType.Insertions | RevisionType.Formatting | RevisionType.Deletions;
+ //Sets the color for inserted text color.
+ wordDocument.RevisionOptions.InsertedTextColor = RevisionColor.ClassicRed;
+ //Instantiation of DocToPDFConverter for Word to PDF conversion
+ DocToPDFConverter converter = new DocToPDFConverter();
+ //Converts Word document into PDF document
+ PdfDocument pdfDocument = converter.ConvertToPDF(wordDocument);
+ //Saves the PDF file
+ pdfDocument.Save("WordtoPDF.pdf");
+ //Releases all resources used by the object
+ converter.Dispose();
+ //Closes the instance of document objects
+ wordDocument.Close();
+ pdfDocument.Close(true);
+
+
+ 'Loads an existing Word document
+ Dim wordDocument As WordDocument = New WordDocument("Template.docx", FormatType.Docx)
+ 'Sets revision types to preserve track changes in PDF conversion.
+ wordDocument.RevisionOptions.ShowMarkup = RevisionType.Insertions Or RevisionType.Formatting Or RevisionType.Deletions
+ 'Sets the color for inserted text color.
+ wordDocument.RevisionOptions.InsertedTextColor = RevisionColor.ClassicRed
+ 'Instantiation of DocToPDFConverter for Word to PDF conversion
+ Dim converter As DocToPDFConverter = New DocToPDFConverter
+ 'Converts Word document into PDF document
+ Dim pdfDocument As PdfDocument = converter.ConvertToPDF(wordDocument)
+ 'Saves the PDF file
+ pdfDocument.Save("WordtoPDF.pdf")
+ 'Releases all resources used by the object
+ converter.Dispose()
+ 'Closes the instance of document objects
+ wordDocument.Close()
+ pdfDocument.Close(True)
+
+
+ //Loads an existing Word document
+ WordDocument wordDocument = new WordDocument("Template.docx", FormatType.Docx);
+ //Sets revision types to preserve track changes in PDF conversion.
+ wordDocument.RevisionOptions.ShowMarkup = RevisionType.Insertions | RevisionType.Formatting | RevisionType.Deletions;
+ //Sets the color for Deleted content color.
+ wordDocument.RevisionOptions.DeletedTextColor = RevisionColor.ClassicBlue;
+ //Instantiation of DocToPDFConverter for Word to PDF conversion
+ DocToPDFConverter converter = new DocToPDFConverter();
+ //Converts Word document into PDF document
+ PdfDocument pdfDocument = converter.ConvertToPDF(wordDocument);
+ //Saves the PDF file
+ pdfDocument.Save("WordtoPDF.pdf");
+ //Releases all resources used by the object
+ converter.Dispose();
+ //Closes the instance of document objects
+ wordDocument.Close();
+ pdfDocument.Close(true);
+
+
+ 'Loads an existing Word document
+ Dim wordDocument As WordDocument = New WordDocument("Template.docx", FormatType.Docx)
+ 'Sets revision types to preserve track changes in PDF conversion.
+ wordDocument.RevisionOptions.ShowMarkup = RevisionType.Insertions Or RevisionType.Formatting Or RevisionType.Deletions
+ 'Sets the color for Deleted content color.
+ wordDocument.RevisionOptions.DeletedTextColor = RevisionColor.ClassicBlue
+ 'Instantiation of DocToPDFConverter for Word to PDF conversion
+ Dim converter As DocToPDFConverter = New DocToPDFConverter
+ 'Converts Word document into PDF document
+ Dim pdfDocument As PdfDocument = converter.ConvertToPDF(wordDocument)
+ 'Saves the PDF file
+ pdfDocument.Save("WordtoPDF.pdf")
+ 'Releases all resources used by the object
+ converter.Dispose()
+ 'Closes the instance of document objects
+ wordDocument.Close()
+ pdfDocument.Close(True)
+
+
+ //Loads an existing Word document
+ WordDocument wordDocument = new WordDocument("Template.docx", FormatType.Docx);
+ //Sets revision types to preserve track changes in PDF conversion.
+ wordDocument.RevisionOptions.ShowMarkup = RevisionType.Insertions | RevisionType.Formatting | RevisionType.Deletions;
+ //Sets the color for Revised property color.
+ wordDocument.RevisionOptions.RevisedPropertiesColor = RevisionColor.Turquoise;
+ //Instantiation of DocToPDFConverter for Word to PDF conversion
+ DocToPDFConverter converter = new DocToPDFConverter();
+ //Converts Word document into PDF document
+ PdfDocument pdfDocument = converter.ConvertToPDF(wordDocument);
+ //Saves the PDF file
+ pdfDocument.Save("WordtoPDF.pdf");
+ //Releases all resources used by the object
+ converter.Dispose();
+ //Closes the instance of document objects
+ wordDocument.Close();
+ pdfDocument.Close(true);
+
+
+ 'Loads an existing Word document
+ Dim wordDocument As WordDocument = New WordDocument("Template.docx", FormatType.Docx)
+ 'Sets revision types to preserve track changes in PDF conversion.
+ wordDocument.RevisionOptions.ShowMarkup = RevisionType.Insertions Or RevisionType.Formatting Or RevisionType.Deletions
+ 'Sets the color for Revised property color.
+ wordDocument.RevisionOptions.RevisedPropertiesColor = RevisionColor.Turquoise
+ 'Instantiation of DocToPDFConverter for Word to PDF conversion
+ Dim converter As DocToPDFConverter = New DocToPDFConverter
+ 'Converts Word document into PDF document
+ Dim pdfDocument As PdfDocument = converter.ConvertToPDF(wordDocument)
+ 'Saves the PDF file
+ pdfDocument.Save("WordtoPDF.pdf")
+ 'Releases all resources used by the object
+ converter.Dispose()
+ 'Closes the instance of document objects
+ wordDocument.Close()
+ pdfDocument.Close(True)
+
+
+ //Loads an existing Word document
+ WordDocument wordDocument = new WordDocument("Template.docx", FormatType.Docx);
+ //Sets revision types to preserve track changes in PDF conversion.
+ wordDocument.RevisionOptions.ShowMarkup = RevisionType.Insertions | RevisionType.Formatting | RevisionType.Deletions;
+ //Instantiation of DocToPDFConverter for Word to PDF conversion
+ DocToPDFConverter converter = new DocToPDFConverter();
+ //Converts Word document into PDF document
+ PdfDocument pdfDocument = converter.ConvertToPDF(wordDocument);
+ //Saves the PDF file
+ pdfDocument.Save("WordtoPDF.pdf");
+ //Releases all resources used by the object
+ converter.Dispose();
+ //Closes the instance of document objects
+ wordDocument.Close();
+ pdfDocument.Close(true);
+
+
+ 'Loads an existing Word document
+ Dim wordDocument As WordDocument = New WordDocument("Template.docx", FormatType.Docx)
+ 'Sets revision types to preserve track changes in PDF conversion.
+ wordDocument.RevisionOptions.ShowMarkup = RevisionType.Insertions Or RevisionType.Formatting Or RevisionType.Deletions
+ 'Instantiation of DocToPDFConverter for Word to PDF conversion
+ Dim converter As DocToPDFConverter = New DocToPDFConverter
+ 'Converts Word document into PDF document
+ Dim pdfDocument As PdfDocument = converter.ConvertToPDF(wordDocument)
+ 'Saves the PDF file
+ pdfDocument.Save("WordtoPDF.pdf")
+ 'Releases all resources used by the object
+ converter.Dispose()
+ 'Closes the instance of document objects
+ wordDocument.Close()
+ pdfDocument.Close(True)
+
+
+ //Loads an existing Word document
+ WordDocument wordDocument = new WordDocument("Template.docx", FormatType.Docx);
+ //Sets revision types to preserve track changes in PDF conversion.
+ wordDocument.RevisionOptions.ShowMarkup = RevisionType.Insertions | RevisionType.Formatting | RevisionType.Deletions;
+ //Hides showing revisions in balloons when converting Word documents to PDF
+ wordDocument.RevisionOptions.ShowInBalloons = RevisionType.None;
+ //Instantiation of DocToPDFConverter for Word to PDF conversion
+ DocToPDFConverter converter = new DocToPDFConverter();
+ //Converts Word document into PDF document
+ PdfDocument pdfDocument = converter.ConvertToPDF(wordDocument);
+ //Saves the PDF file
+ pdfDocument.Save("WordtoPDF.pdf");
+ //Releases all resources used by the object
+ converter.Dispose();
+ //Closes the instance of document objects
+ wordDocument.Close();
+ pdfDocument.Close(true);
+
+
+ 'Loads an existing Word document
+ Dim wordDocument As WordDocument = New WordDocument("Template.docx", FormatType.Docx)
+ 'Sets revision types to preserve track changes in PDF conversion.
+ wordDocument.RevisionOptions.ShowMarkup = RevisionType.Insertions Or RevisionType.Formatting Or RevisionType.Deletions
+ 'Hides showing revisions in balloons when converting Word documents to PDF
+ wordDocument.RevisionOptions.ShowInBalloons = RevisionType.None
+ 'Instantiation of DocToPDFConverter for Word to PDF conversion
+ Dim converter As DocToPDFConverter = New DocToPDFConverter
+ 'Converts Word document into PDF document
+ Dim pdfDocument As PdfDocument = converter.ConvertToPDF(wordDocument)
+ 'Saves the PDF file
+ pdfDocument.Save("WordtoPDF.pdf")
+ 'Releases all resources used by the object
+ converter.Dispose()
+ 'Closes the instance of document objects
+ wordDocument.Close()
+ pdfDocument.Close(True)
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ WordDocument document = new WordDocument();
+ document.Open("Table.docx", FormatType.Docx);
+ WSection section = document.Sections[0];
+ WTable table = section.Tables[0] as WTable;
+ //Access the instance of the first row in the table
+ WTableRow row = table.Rows[0];
+ //Specify the row height
+ row.Height = 20;
+ //Specify the row height type
+ row.HeightType = TableRowHeightType.AtLeast;
+ //Access the instance of the first cell in the row
+ WTableCell cell = row.Cells[0];
+ //Specify the cell back ground color
+ cell.CellFormat.BackColor = Color.FromArgb(192, 192, 192);
+ //Specify the same padding as table option as false to preserve current cell padding
+ cell.CellFormat.SamePaddingsAsTable = false;
+ //Specify the left, right, top and bottom padding of the cell
+ cell.CellFormat.Paddings.Left = 5;
+ cell.CellFormat.Paddings.Right = 5;
+ cell.CellFormat.Paddings.Top = 5;
+ cell.CellFormat.Paddings.Bottom = 5;
+ //Specify the vertical alignment of content of text
+ cell.CellFormat.VerticalAlignment = VerticalAlignment.Middle;
+ //Access the instance of the second cell in the row
+ cell = row.Cells[1];
+ cell.CellFormat.BackColor = Color.FromArgb(192, 192, 192);
+ cell.CellFormat.SamePaddingsAsTable = false;
+ //Specify the left, right, top and bottom padding of the cell
+ cell.CellFormat.Paddings.All = 5;
+ cell.CellFormat.VerticalAlignment = VerticalAlignment.Middle;
+ document.Save("TableCellFormatting.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ Dim document As New WordDocument()
+ document.Open("Table.docx", FormatType.Docx)
+ Dim section As WSection = document.Sections(0)
+ Dim table As WTable = TryCast(section.Tables(0), WTable)
+ 'Access the instance of the first row in the table
+ Dim row As WTableRow = table.Rows(0)
+ 'Specify the row height
+ row.Height = 20
+ 'Specify the row height type
+ row.HeightType = TableRowHeightType.AtLeast
+ 'Access the instance of the first cell in the row
+ Dim cell As WTableCell = row.Cells(0)
+ 'Specify the cell back ground color
+ cell.CellFormat.BackColor = Color.FromArgb(192, 192, 192)
+ 'Specify the same padding as table option as false to preserve current cell padding
+ cell.CellFormat.SamePaddingsAsTable = False
+ 'Specify the left, right, top and bottom padding of the cell
+ cell.CellFormat.Paddings.Left = 5
+ cell.CellFormat.Paddings.Right = 5
+ cell.CellFormat.Paddings.Top = 5
+ cell.CellFormat.Paddings.Bottom = 5
+ 'Specify the vertical alignment of content of text
+ cell.CellFormat.VerticalAlignment = VerticalAlignment.Middle
+ 'Access the instance of the second cell in the row
+ cell = row.Cells(1)
+ cell.CellFormat.BackColor = Color.FromArgb(192, 192, 192)
+ cell.CellFormat.SamePaddingsAsTable = False
+ 'Specify the left, right, top and bottom padding of the cell
+ cell.CellFormat.Paddings.All = 5
+ cell.CellFormat.VerticalAlignment = VerticalAlignment.Middle
+ document.Save("TableCellFormatting.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ Gets the style from document styles collection
+ Style style = document.Styles.FindByName("ParaStyle") as Style;
+ Link the styles
+ style.LinkedStyleName = "CharStyle";
+ Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+
+
+ 'Load an existing Word document into DocIO instance
+ Dim document As WordDocument = New WordDocument("Template.docx")
+ 'Gets the style from document styles collection
+ Dim style As Style = TryCast(document.Styles.FindByName("ParaStyle"), Style)
+ 'Link the styles
+ style.LinkedStyleName = "CharStyle"
+ 'Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add new text to the paragraph
+ IWTextRange text = paragraph.AppendText("Text with All caps.");
+ //All Caps
+ text.CharacterFormat.AllCaps = true;
+ paragraph = section.AddParagraph();
+ text = paragraph.AppendText("Right to left text.");
+ //Right to left text with bold and italic styles.
+ text.CharacterFormat.Bidi = true;
+ text.CharacterFormat.FontNameBidi = "Times New Roman";
+ text.CharacterFormat.FontSizeBidi = 14;
+ text.CharacterFormat.BoldBidi = true;
+ text.CharacterFormat.ItalicBidi = true;
+ paragraph = section.AddParagraph();
+ //Bold
+ text = paragraph.AppendText("Bold text.");
+ text.CharacterFormat.Bold = true;
+ paragraph = section.AddParagraph();
+ text = paragraph.AppendText("Text with border.");
+ //Borders
+ text.CharacterFormat.Border.BorderType = BorderStyle.DotDash;
+ text.CharacterFormat.Border.LineWidth = 0.5f;
+ text.CharacterFormat.Border.Color = Color.Blue;
+ paragraph = section.AddParagraph();
+ text = paragraph.AppendText("Character spacing.");
+ text.CharacterFormat.CharacterSpacing = 1;
+ paragraph = section.AddParagraph();
+ text = paragraph.AppendText("Double strike.");
+ //Double strike
+ text.CharacterFormat.DoubleStrike = true;
+ paragraph = section.AddParagraph();
+ text = paragraph.AppendText("Emboss.");
+ //Emboss
+ text.CharacterFormat.Emboss = true;
+ paragraph = section.AddParagraph();
+ text = paragraph.AppendText("Engrave.");
+ //Engrave
+ text.CharacterFormat.Engrave = true;
+ paragraph = section.AddParagraph();
+ text = paragraph.AppendText("Font name.");
+ //Font name
+ text.CharacterFormat.FontName = "Algerian";
+ paragraph = section.AddParagraph();
+ text = paragraph.AppendText("Font size.");
+ //Font size
+ text.CharacterFormat.FontSize = 10;
+ paragraph = section.AddParagraph();
+ text = paragraph.AppendText("Highlight color.");
+ //Highlight color
+ text.CharacterFormat.HighlightColor = Color.Gray;
+ paragraph = section.AddParagraph();
+ text = paragraph.AppendText("Italic.");
+ //Italic
+ text.CharacterFormat.Italic = true;
+ paragraph = section.AddParagraph();
+ text = paragraph.AppendText("Outline.");
+ //Outline
+ text.CharacterFormat.OutLine = true;
+ paragraph = section.AddParagraph();
+ paragraph.AppendText("Position Property with text");
+ text = paragraph.AppendText("raised by 10 points.");
+ //Position
+ text.CharacterFormat.Position = 10;
+ paragraph = section.AddParagraph();
+ text = paragraph.AppendText("Shadow.");
+ //Shadow
+ text.CharacterFormat.Shadow = true;
+ paragraph = section.AddParagraph();
+ text = paragraph.AppendText("SmallCaps.");
+ //SmallCaps
+ text.CharacterFormat.SmallCaps = true;
+ paragraph = section.AddParagraph();
+ text = paragraph.AppendText("Strikeout.");
+ //Strikeout
+ text.CharacterFormat.Strikeout = true;
+ paragraph = section.AddParagraph();
+ paragraph.AppendText("Text");
+ text = paragraph.AppendText("Subscript.");
+ //Subscript
+ text.CharacterFormat.SubSuperScript = SubSuperScript.SubScript;
+ paragraph = section.AddParagraph();
+ paragraph.AppendText("Text");
+ text = paragraph.AppendText("Superscript.");
+ //Superscript
+ text.CharacterFormat.SubSuperScript = SubSuperScript.SuperScript;
+ paragraph = section.AddParagraph();
+ text = paragraph.AppendText("TextBackgroundColor.");
+ //TextBackgroundColor
+ text.CharacterFormat.TextBackgroundColor = Color.LightSkyBlue;
+ paragraph = section.AddParagraph();
+ text = paragraph.AppendText("TextColor.");
+ //TextColor
+ text.CharacterFormat.TextColor = Color.Green;
+ paragraph = section.AddParagraph();
+ text = paragraph.AppendText("UnderlineStyle.");
+ //UnderlineStyle
+ text.CharacterFormat.UnderlineStyle = UnderlineStyle.Dash;
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add new text to the paragraph
+ Dim text As IWTextRange = paragraph.AppendText("Text with All caps.")
+ 'All Caps
+ text.CharacterFormat.AllCaps = True
+ paragraph = section.AddParagraph()
+ text = paragraph.AppendText("Right to left text.")
+ 'Right to left text with bold and italic styles.
+ text.CharacterFormat.Bidi = True
+ text.CharacterFormat.FontNameBidi = "Times New Roman"
+ text.CharacterFormat.FontSizeBidi = 14
+ text.CharacterFormat.BoldBidi = True
+ text.CharacterFormat.ItalicBidi = True
+ paragraph = section.AddParagraph()
+ 'Bold
+ text = paragraph.AppendText("Bold text.")
+ text.CharacterFormat.Bold = True
+ paragraph = section.AddParagraph()
+ text = paragraph.AppendText("Text with border.")
+ 'Borders
+ text.CharacterFormat.Border.BorderType = BorderStyle.DotDash
+ text.CharacterFormat.Border.LineWidth = 0.5F
+ text.CharacterFormat.Border.Color = Color.Blue
+ paragraph = section.AddParagraph()
+ text = paragraph.AppendText("Character spacing.")
+ text.CharacterFormat.CharacterSpacing = 1
+ paragraph = section.AddParagraph()
+ text = paragraph.AppendText("Double strike.")
+ 'Double strike
+ text.CharacterFormat.DoubleStrike = True
+ paragraph = section.AddParagraph()
+ text = paragraph.AppendText("Emboss.")
+ 'Emboss
+ text.CharacterFormat.Emboss = True
+ paragraph = section.AddParagraph()
+ text = paragraph.AppendText("Engrave.")
+ 'Engrave
+ text.CharacterFormat.Engrave = True
+ paragraph = section.AddParagraph()
+ text = paragraph.AppendText("Font name.")
+ 'Font name
+ text.CharacterFormat.FontName = "Algerian"
+ paragraph = section.AddParagraph()
+ text = paragraph.AppendText("Font size.")
+ 'Font size
+ text.CharacterFormat.FontSize = 10
+ paragraph = section.AddParagraph()
+ text = paragraph.AppendText("Highlight color.")
+ 'Highlight color
+ text.CharacterFormat.HighlightColor = Color.Gray
+ paragraph = section.AddParagraph()
+ text = paragraph.AppendText("Italic.")
+ 'Italic
+ text.CharacterFormat.Italic = True
+ paragraph = section.AddParagraph()
+ text = paragraph.AppendText("Outline.")
+ 'Outline
+ text.CharacterFormat.OutLine = True
+ paragraph = section.AddParagraph()
+ paragraph.AppendText("Position Property with text")
+ text = paragraph.AppendText("raised by 10 points.")
+ 'Position
+ text.CharacterFormat.Position = 10
+ paragraph = section.AddParagraph()
+ text = paragraph.AppendText("Shadow.")
+ 'Shadow
+ text.CharacterFormat.Shadow = True
+ paragraph = section.AddParagraph()
+ text = paragraph.AppendText("SmallCaps.")
+ 'SmallCaps
+ text.CharacterFormat.SmallCaps = True
+ paragraph = section.AddParagraph()
+ text = paragraph.AppendText("Strikeout.")
+ 'Strikeout
+ text.CharacterFormat.Strikeout = True
+ paragraph = section.AddParagraph()
+ paragraph.AppendText("Text")
+ text = paragraph.AppendText("Subscript.")
+ 'Subscript
+ text.CharacterFormat.SubSuperScript = SubSuperScript.SubScript
+ paragraph = section.AddParagraph()
+ paragraph.AppendText("Text")
+ text = paragraph.AppendText("Superscript.")
+ 'Superscript
+ text.CharacterFormat.SubSuperScript = SubSuperScript.SuperScript
+ paragraph = section.AddParagraph()
+ text = paragraph.AppendText("TextBackgroundColor.")
+ 'TextBackgroundColor
+ text.CharacterFormat.TextBackgroundColor = Color.LightSkyBlue
+ paragraph = section.AddParagraph()
+ text = paragraph.AppendText("TextColor.")
+ 'TextColor
+ text.CharacterFormat.TextColor = Color.Green
+ paragraph = section.AddParagraph()
+ text = paragraph.AppendText("UnderlineStyle.")
+ 'UnderlineStyle
+ text.CharacterFormat.UnderlineStyle = UnderlineStyle.Dash
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add new text
+ IWTextRange text = paragraph.AppendText("Text to describe LocaleIdBidi text");
+ //Set right to left layout for text
+ text.CharacterFormat.Bidi = true;
+ //Set language identifier for right to left or complex script characters
+ text.CharacterFormat.LocaleIdBidi = (short)LocaleIDs.he_IL;
+ paragraph = section.AddParagraph();
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+
+
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add new text
+ Dim text As IWTextRange = paragraph.AppendText("Text to describe LocaleIdBidi text")
+ 'Set right to left layout for text
+ text.CharacterFormat.Bidi = True
+ 'Set language identifier for right to left or complex script characters
+ text.CharacterFormat.LocaleIdBidi = CType(LocaleIDs.he_IL, Short)
+ paragraph = section.AddParagraph()
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add new text
+ IWTextRange text = paragraph.AppendText("Text to describe contextual alternates");
+ text.CharacterFormat.FontName = "Segoe Script";
+ //Set contextual alternates
+ text.CharacterFormat.UseContextualAlternates = true;
+ paragraph = section.AddParagraph();
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add new text
+ Dim text As IWTextRange = paragraph.AppendText("Text to describe contextual alternates")
+ text.CharacterFormat.FontName = "Segoe Script"
+ 'Set contextual alternates
+ text.CharacterFormat.UseContextualAlternates = True
+ paragraph = section.AddParagraph()
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add new text
+ IWTextRange text = paragraph.AppendText("Text to describe discretional ligatures");
+ //Set ligature type
+ text.CharacterFormat.Ligatures = LigatureType.Discretional;
+ text.CharacterFormat.FontName = "Arial";
+ paragraph = section.AddParagraph();
+ text = paragraph.AppendText("Text to describe contextual ligatures");
+ text.CharacterFormat.Ligatures = LigatureType.Contextual;
+ text.CharacterFormat.FontName = "Arial";
+ paragraph = section.AddParagraph();
+ text = paragraph.AppendText("Text to describe historical ligatures");
+ text.CharacterFormat.Ligatures = LigatureType.Historical;
+ text.CharacterFormat.FontName = "Arial";
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add new text
+ Dim text As IWTextRange = paragraph.AppendText("Text to describe discretional ligatures")
+ 'Set ligature type as Discretional
+ text.CharacterFormat.Ligatures = LigatureType.Discretional
+ text.CharacterFormat.FontName = "Arial"
+ paragraph = section.AddParagraph()
+ text = paragraph.AppendText("Text to describe contextual ligatures")
+ 'Set ligature type as Contextual
+ text.CharacterFormat.Ligatures = LigatureType.Contextual
+ text.CharacterFormat.FontName = "Arial"
+ paragraph = section.AddParagraph()
+ text = paragraph.AppendText("Text to describe historical ligatures")
+ 'Set ligature type as Historical
+ text.CharacterFormat.Ligatures = LigatureType.Historical
+ text.CharacterFormat.FontName = "Arial"
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add new text
+ IWTextRange text = paragraph.AppendText("Numbers to describe oldstyle number form 0123456789");
+ text.CharacterFormat.FontName = "Calibri";
+ //Set number style
+ text.CharacterFormat.NumberForm = NumberFormType.OldStyle;
+ paragraph = section.AddParagraph();
+ text = paragraph.AppendText("Numbers to describe lining number form 0123456789");
+ text.CharacterFormat.FontName = "Calibri";
+ //Set number style
+ text.CharacterFormat.NumberForm = NumberFormType.Lining;
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add new text
+ Dim text As IWTextRange = paragraph.AppendText("Numbers to describe oldstyle number form 0123456789")
+ text.CharacterFormat.FontName = "Calibri"
+ 'Set number style
+ text.CharacterFormat.NumberForm = NumberFormType.OldStyle
+ paragraph = section.AddParagraph()
+ text = paragraph.AppendText("Numbers to describe lining number form 0123456789")
+ text.CharacterFormat.FontName = "Calibri"
+ 'Set number style
+ text.CharacterFormat.NumberForm = NumberFormType.Lining
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add new text
+ IWTextRange text = paragraph.AppendText("Numbers to describe tabular number spacing 0123456789");
+ text.CharacterFormat.FontName = "Calibri";
+ //Set number spacing
+ text.CharacterFormat.NumberSpacing = NumberSpacingType.Tabular;
+ paragraph = section.AddParagraph();
+ text = paragraph.AppendText("Numbers to describe proportional number spacing 0123456789");
+ text.CharacterFormat.FontName = "Calibri";
+ //Set number spacing
+ text.CharacterFormat.NumberSpacing = NumberSpacingType.Proportional;
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add new text
+ Dim text As IWTextRange = paragraph.AppendText("Numbers to describe tabular number spacing 0123456789")
+ text.CharacterFormat.FontName = "Calibri"
+ 'Set number spacing
+ text.CharacterFormat.NumberSpacing = NumberSpacingType.Tabular
+ paragraph = section.AddParagraph()
+ text = paragraph.AppendText("Numbers to describe proportional number spacing 0123456789")
+ text.CharacterFormat.FontName = "Calibri"
+ 'Set number spacing
+ text.CharacterFormat.NumberSpacing = NumberSpacingType.Proportional
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add new text
+ IWTextRange text = paragraph.AppendText("Text to describe stylistic sets");
+ text.CharacterFormat.FontName = "Gabriola";
+ //Set stylistic set
+ text.CharacterFormat.StylisticSet = StylisticSetType.StylisticSet06;
+ paragraph = section.AddParagraph();
+ //Add new text
+ text = paragraph.AppendText("Text to describe stylistic sets");
+ text.CharacterFormat.FontName = "Gabriola";
+ //Set stylistic set
+ text.CharacterFormat.StylisticSet = StylisticSetType.StylisticSet15;
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add new text
+ Dim text As IWTextRange = paragraph.AppendText("Text to describe stylistic sets")
+ text.CharacterFormat.FontName = "Gabriola"
+ 'Set stylistic set
+ text.CharacterFormat.StylisticSet = StylisticSetType.StylisticSet06
+ paragraph = section.AddParagraph()
+ 'Add new text
+ text = paragraph.AppendText("Text to describe stylistic sets")
+ text.CharacterFormat.FontName = "Gabriola"
+ 'Set stylistic set
+ text.CharacterFormat.StylisticSet = StylisticSetType.StylisticSet15
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add new text to the paragraph
+ paragraph.AppendText("Paragraphs are the basic elements of the Word document. It can contain text and images. " +
+ "Paragraphs are the basic elements of the Word document. It can contain text and images. Paragraphs are the basic elements of the Word document. It can contain text and images.");
+ //After spacing, back color, borders, contextual spacing
+ paragraph.ParagraphFormat.AfterSpacing = 18f;
+ paragraph.ParagraphFormat.BackColor = Color.LightGray;
+ paragraph.ParagraphFormat.Bidi = true;
+ paragraph.ParagraphFormat.Borders.BorderType = BorderStyle.Dot;
+ paragraph.ParagraphFormat.Borders.Color = Color.Maroon;
+ paragraph.ParagraphFormat.Borders.LineWidth = 0.5f;
+ paragraph.ParagraphFormat.ContextualSpacing = true;
+ paragraph = section.AddParagraph();
+ paragraph.AppendText("Paragraphs are the basic elements of the Word document. It can contain text and images. " +
+ "Paragraphs are the basic elements of the Word document. It can contain text and images. Paragraphs are the basic elements of the Word document. It can contain text and images.");
+ //column break, firstline indent, alignment
+ paragraph.ParagraphFormat.ColumnBreakAfter = true;
+ paragraph.ParagraphFormat.FirstLineIndent = 12;
+ paragraph.ParagraphFormat.HorizontalAlignment = HorizontalAlignment.JustifyHigh;
+ paragraph = section.AddParagraph();
+ paragraph.AppendText("Paragraphs are the basic elements of the Word document. It can contain text and images. " +
+ "Paragraphs are the basic elements of the Word document. It can contain text and images. Paragraphs are the basic elements of the Word document. It can contain text and images.");
+ //Hanging indent, keep, left indent, line spacing, keep follow
+ paragraph.ParagraphFormat.FirstLineIndent = -12;
+ paragraph.ParagraphFormat.Keep = true;
+ paragraph.ParagraphFormat.LeftIndent = 10;
+ paragraph.ParagraphFormat.LineSpacing = 2;
+ paragraph.ParagraphFormat.LineSpacingRule = LineSpacingRule.AtLeast;
+ paragraph.ParagraphFormat.KeepFollow = true;
+ paragraph = section.AddParagraph();
+ paragraph.AppendText("Paragraphs are the basic elements of the Word document. It can contain text and images. " +
+ "Paragraphs are the basic elements of the Word document. It can contain text and images. Paragraphs are the basic elements of the Word document. It can contain text and images.");
+ //Mirror indent, outline level, page break
+ paragraph.ParagraphFormat.MirrorIndents = true;
+ paragraph.ParagraphFormat.OutlineLevel = OutlineLevel.Level2;
+ paragraph.ParagraphFormat.PageBreakAfter = true;
+ paragraph = section.AddParagraph();
+ paragraph.AppendText("Paragraphs are the basic elements of the Word document. It can contain text and images. " +
+ "Paragraphs are the basic elements of the Word document. It can contain text and images. Paragraphs are the basic elements of the Word document. It can contain text and images.");
+ //Right indent, auto spacing
+ paragraph.ParagraphFormat.RightIndent = 10;
+ paragraph.ParagraphFormat.SpaceAfterAuto = true;
+ paragraph.ParagraphFormat.SpaceBeforeAuto = true;
+ paragraph = section.AddParagraph();
+ paragraph.AppendText("Paragraphs are the basic elements of the Word document. It can contain text and images. " +
+ "Paragraphs are the basic elements of the Word document. It can contain text and images. Paragraphs are the basic elements of the Word document. It can contain text and images.");
+ //Auto hyphens, window control, before spacing, page break
+ paragraph.ParagraphFormat.SuppressAutoHyphens = true;
+ paragraph.ParagraphFormat.WidowControl = true;
+ paragraph.ParagraphFormat.BeforeSpacing = 18f;
+ paragraph.ParagraphFormat.PageBreakBefore = true;
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add new text to the paragraph
+ paragraph.AppendText("Paragraphs are the basic elements of the Word document. It can contain text and images. " & "Paragraphs are the basic elements of the Word document. It can contain text and images. Paragraphs are the basic elements of the Word document. It can contain text and images.")
+ 'After spacing, back color, borders, contextual spacing
+ paragraph.ParagraphFormat.AfterSpacing = 18.0F
+ paragraph.ParagraphFormat.BackColor = Color.LightGray
+ paragraph.ParagraphFormat.Bidi = True
+ paragraph.ParagraphFormat.Borders.BorderType = BorderStyle.Dot
+ paragraph.ParagraphFormat.Borders.Color = Color.Maroon
+ paragraph.ParagraphFormat.Borders.LineWidth = 0.5F
+ paragraph.ParagraphFormat.ContextualSpacing = True
+ paragraph = section.AddParagraph()
+ paragraph.AppendText("Paragraphs are the basic elements of the Word document. It can contain text and images. " & "Paragraphs are the basic elements of the Word document. It can contain text and images. Paragraphs are the basic elements of the Word document. It can contain text and images.")
+ 'column break, firstline indent, alignment
+ paragraph.ParagraphFormat.ColumnBreakAfter = True
+ paragraph.ParagraphFormat.FirstLineIndent = 12
+ paragraph.ParagraphFormat.HorizontalAlignment = HorizontalAlignment.JustifyHigh
+ paragraph = section.AddParagraph()
+ paragraph.AppendText("Paragraphs are the basic elements of the Word document. It can contain text and images. " & "Paragraphs are the basic elements of the Word document. It can contain text and images. Paragraphs are the basic elements of the Word document. It can contain text and images.")
+ 'Hanging indent, keep, left indent, line spacing, keep follow
+ paragraph.ParagraphFormat.FirstLineIndent = -12
+ paragraph.ParagraphFormat.Keep = True
+ paragraph.ParagraphFormat.LeftIndent = 10
+ paragraph.ParagraphFormat.LineSpacing = 2
+ paragraph.ParagraphFormat.LineSpacingRule = LineSpacingRule.AtLeast
+ paragraph.ParagraphFormat.KeepFollow = True
+ paragraph = section.AddParagraph()
+ paragraph.AppendText("Paragraphs are the basic elements of the Word document. It can contain text and images. " & "Paragraphs are the basic elements of the Word document. It can contain text and images. Paragraphs are the basic elements of the Word document. It can contain text and images.")
+ 'Mirror indent, outline level, page break
+ paragraph.ParagraphFormat.MirrorIndents = True
+ paragraph.ParagraphFormat.OutlineLevel = OutlineLevel.Level2
+ paragraph.ParagraphFormat.PageBreakAfter = True
+ paragraph = section.AddParagraph()
+ paragraph.AppendText("Paragraphs are the basic elements of the Word document. It can contain text and images. " & "Paragraphs are the basic elements of the Word document. It can contain text and images. Paragraphs are the basic elements of the Word document. It can contain text and images.")
+ 'Right indent, auto spacing
+ paragraph.ParagraphFormat.RightIndent = 10
+ paragraph.ParagraphFormat.SpaceAfterAuto = True
+ paragraph.ParagraphFormat.SpaceBeforeAuto = True
+ paragraph = section.AddParagraph()
+ paragraph.AppendText("Paragraphs are the basic elements of the Word document. It can contain text and images. " & "Paragraphs are the basic elements of the Word document. It can contain text and images. Paragraphs are the basic elements of the Word document. It can contain text and images.")
+ 'Auto hyphens, window control, before spacing, page break
+ paragraph.ParagraphFormat.SuppressAutoHyphens = True
+ paragraph.ParagraphFormat.WidowControl = True
+ paragraph.ParagraphFormat.BeforeSpacing = 18.0F
+ paragraph.ParagraphFormat.PageBreakBefore = True
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create an instance of WordDocument class (Empty Word Document)
+ WordDocument document = new WordDocument();
+ //Open an existing Word document into DocIO instance
+ document.Open("Table.docx", FormatType.Docx);
+ //Access the instance of the first section in the Word document
+ WSection section = document.Sections[0];
+ //Access the instance of the first table in the section
+ WTable table = section.Tables[0] as WTable;
+ //Specify the title for the table
+ table.Title ="PriceDetails";
+ //Specify the description of the table
+ table.Description = "This table shows the price details of various fruits";
+ //Specify the left indent of the table
+ table.IndentFromLeft = 50;
+ //Specify the background color of the table
+ table.TableFormat.BackColor = Color.FromArgb(192, 192, 192);
+ //Specify the horizontal alignment of the table
+ table.TableFormat.HorizontalAlignment = RowAlignment.Left;
+ //Specify the left, right, top and bottom padding of all the cells in the table
+ table.TableFormat.Paddings.All = 10;
+ //Specify the auto resize of table to automatically resize all cell width based on its content
+ table.TableFormat.IsAutoResized = true;
+ //Specify the table top, bottom, left and right border line width
+ table.TableFormat.Borders.LineWidth = 2f;
+ //Specify the table horizontal border line width
+ table.TableFormat.Borders.Horizontal.LineWidth = 2f;
+ //Specify the table vertical border line width
+ table.TableFormat.Borders.Vertical.LineWidth = 2f;
+ //Specify the tables top, bottom, left and right border color
+ table.TableFormat.Borders.Color = Color.Red;
+ //Specify the table Horizontal border color
+ table.TableFormat.Borders.Horizontal.Color = Color.Red;
+ //Specify the table vertical border color
+ table.TableFormat.Borders.Vertical.Color = Color.Red;
+ //Specify the table borders border type
+ table.TableFormat.Borders.BorderType = BorderStyle.Double;
+ //Access the instance of the first row in the table
+ WTableRow row = table.Rows[0];
+ //Specify the row height
+ row.Height = 20;
+ //Specify the row height type
+ row.HeightType = TableRowHeightType.AtLeast;
+ document.Save("TableFormatting.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create an instance of WordDocument class (Empty Word Document)
+ Dim document As New WordDocument()
+ 'Open an existing Word document into DocIO instance
+ document.Open("Table.docx", FormatType.Docx)
+ 'Access the instance of the first section in the Word document
+ Dim section As WSection = document.Sections(0)
+ 'Access the instance of the first table in the section
+ Dim table As WTable = TryCast(section.Tables(0), WTable)
+ 'Specify the title for the table
+ table.Title = "PriceDetails"
+ 'Specify the description of the table
+ table.Description = "This table shows the price details of various fruits"
+ 'Specify the left indent of the table
+ table.IndentFromLeft = 50
+ 'Specify the background color of the table
+ table.TableFormat.BackColor = Color.FromArgb(192, 192, 192)
+ 'Specify the horizontal alignment of the table
+ table.TableFormat.HorizontalAlignment = RowAlignment.Left
+ 'Specify the left, right, top and bottom padding of all the cells in the table
+ table.TableFormat.Paddings.All = 10
+ 'Specify the auto resize of table to automatically resize all cell width based on its content
+ table.TableFormat.IsAutoResized = True
+ 'Specify the table top, bottom, left and right border line width
+ table.TableFormat.Borders.LineWidth = 2.0F
+ 'Specify the table horizontal border line width
+ table.TableFormat.Borders.Horizontal.LineWidth = 2.0F
+ 'Specify the table vertical border line width
+ table.TableFormat.Borders.Vertical.LineWidth = 2.0F
+ 'Specify the tables top, bottom, left and right border color
+ table.TableFormat.Borders.Color = Color.Red
+ 'Specify the table Horizontal border color
+ table.TableFormat.Borders.Horizontal.Color = Color.Red
+ 'Specify the table vertical border color
+ table.TableFormat.Borders.Vertical.Color = Color.Red
+ 'Specify the table borders border type
+ table.TableFormat.Borders.BorderType = BorderStyle.[Double]
+ 'Access the instance of the first row in the table
+ Dim row As WTableRow = table.Rows(0)
+ 'Specify the row height
+ row.Height = 20
+ 'Specify the row height type
+ row.HeightType = TableRowHeightType.AtLeast
+ document.Save("TableFormatting.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ WordDocument document = new WordDocument("Template.docx");
+ WSection section = document.Sections[0];
+ WTable table = section.Tables[0] as WTable;
+ //Disable breaking across pages for all rows in the table.
+ foreach (WTableRow row in table.Rows)
+ row.RowFormat.IsBreakAcrossPages = false;
+ document.Save("Result.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ Dim document As New WordDocument("Template.docx")
+ Dim section As WSection = document.Sections(0)
+ Dim table As WTable = TryCast(section.Tables(0), WTable)
+ 'Disable breaking across pages for all rows in the table.
+ For Each row As WTableRow In table.Rows
+ row.RowFormat.IsBreakAcrossPages = False
+ Next
+ document.Save("Result.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create an instance of WordDocument class (Empty Word Document)
+ WordDocument document = new WordDocument();
+ //Open an existing Word document into DocIO instance
+ document.Open("Table.docx", FormatType.Docx);
+ //Access the instance of the first section in the Word document
+ WSection section = document.Sections[0];
+ //Access the instance of the first table in the section
+ WTable table = section.Tables[0] as WTable;
+ //Specify the table positioning options
+ table.TableFormat.Positioning.HorizPositionAbs = HorizontalPosition.Right;
+ table.TableFormat.Positioning.HorizRelationTo = HorizontalRelation.Margin;
+ table.TableFormat.Positioning.VertPositionAbs = VerticalPosition.Center;
+ table.TableFormat.Positioning.VertRelationTo = VerticalRelation.Page;
+ table.TableFormat.Positioning.DistanceFromBottom = 10;
+ table.TableFormat.Positioning.DistanceFromLeft = 10;
+ table.TableFormat.Positioning.DistanceFromRight = 10;
+ table.TableFormat.Positioning.DistanceFromTop = 10;
+ //Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create an instance of WordDocument class (Empty Word Document)
+ Dim document As New WordDocument()
+ 'Open an existing Word document into DocIO instance
+ document.Open("Table.docx", FormatType.Docx)
+ 'Access the instance of the first section in the Word document
+ Dim section As WSection = document.Sections(0)
+ 'Access the instance of the first table in the section
+ Dim table As WTable = TryCast(section.Tables(0), WTable)
+ 'Specify the table positioning options
+ table.TableFormat.Positioning.HorizPositionAbs = HorizontalPosition.Right
+ table.TableFormat.Positioning.HorizRelationTo = HorizontalRelation.Margin
+ table.TableFormat.Positioning.VertPositionAbs = VerticalPosition.Center
+ table.TableFormat.Positioning.VertRelationTo = VerticalRelation.Page
+ table.TableFormat.Positioning.DistanceFromBottom = 10
+ table.TableFormat.Positioning.DistanceFromLeft = 10
+ table.TableFormat.Positioning.DistanceFromRight = 10
+ table.TableFormat.Positioning.DistanceFromTop = 10
+ 'Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Append new textbox to the paragraph
+ IWTextBox textbox = paragraph.AppendTextBox(150, 75);
+ //Add new text to the textbox body
+ IWParagraph textboxParagraph = textbox.TextBoxBody.AddParagraph();
+ textboxParagraph.AppendText("Text inside text box");
+ //Set fill color, line width, line dashing and line style for textbox
+ textbox.TextBoxFormat.FillColor = Color.LightGreen;
+ textbox.TextBoxFormat.LineWidth = 2;
+ textbox.TextBoxFormat.LineDashing = LineDashing.Dash;
+ textbox.TextBoxFormat.LineStyle = TextBoxLineStyle.Double;
+ //Apply textbox text direction
+ textbox.TextBoxFormat.TextDirection = Syncfusion.DocIO.DLS.TextDirection.VerticalTopToBottom;
+ //Set text wrapping style and type
+ textbox.TextBoxFormat.TextWrappingStyle = TextWrappingStyle.InFrontOfText;
+ textbox.TextBoxFormat.TextWrappingType = TextWrappingType.Right;
+ //Set horizontal and vertical position
+ textbox.TextBoxFormat.HorizontalPosition = 200;
+ textbox.TextBoxFormat.VerticalPosition = 200;
+ //Set horizontal and vertical origin
+ textbox.TextBoxFormat.VerticalOrigin = VerticalOrigin.Margin;
+ textbox.TextBoxFormat.HorizontalOrigin = HorizontalOrigin.Page;
+ //Set top and bottom margin values
+ textbox.TextBoxFormat.InternalMargin.Bottom = 5f;
+ textbox.TextBoxFormat.InternalMargin.Top = 5f;
+ //Set horizontal and vertical alignment
+ textbox.TextBoxFormat.VerticalAlignment = ShapeVerticalAlignment.Bottom;
+ textbox.TextBoxFormat.HorizontalAlignment = ShapeHorizontalAlignment.Center;
+ //Save and close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Append new textbox to the paragraph
+ Dim textbox As IWTextBox = paragraph.AppendTextBox(150, 75)
+ 'Add new text to the textbox body
+ Dim textboxParagraph As IWParagraph = textbox.TextBoxBody.AddParagraph()
+ textboxParagraph.AppendText("Text inside text box")
+ 'Set fill color, line width, line dashing and line style for textbox
+ textbox.TextBoxFormat.FillColor = Color.LightGreen
+ textbox.TextBoxFormat.LineWidth = 2
+ textbox.TextBoxFormat.LineDashing = LineDashing.Dash
+ textbox.TextBoxFormat.LineStyle = TextBoxLineStyle.[Double]
+ 'Apply textbox text direction
+ textbox.TextBoxFormat.TextDirection = Syncfusion.DocIO.DLS.TextDirection.VerticalTopToBottom
+ 'Set text wrapping style and type
+ textbox.TextBoxFormat.TextWrappingStyle = TextWrappingStyle.InFrontOfText
+ textbox.TextBoxFormat.TextWrappingType = TextWrappingType.Right
+ 'Set horizontal and vertical position
+ textbox.TextBoxFormat.HorizontalPosition = 200
+ textbox.TextBoxFormat.VerticalPosition = 200
+ 'Set horizontal and vertical origin
+ textbox.TextBoxFormat.VerticalOrigin = VerticalOrigin.Margin
+ textbox.TextBoxFormat.HorizontalOrigin = HorizontalOrigin.Page
+ 'Set top and bottom margin values
+ textbox.TextBoxFormat.InternalMargin.Bottom = 5.0F
+ textbox.TextBoxFormat.InternalMargin.Top = 5.0F
+ 'Set horizontal and vertical alignment
+ textbox.TextBoxFormat.VerticalAlignment = ShapeVerticalAlignment.Bottom
+ textbox.TextBoxFormat.HorizontalAlignment = ShapeHorizontalAlignment.Center
+ 'Save and close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ //Creates a new Word document
+ WordDocument document = new WordDocument();
+ //Adds new section to the document
+ IWSection section = document.AddSection();
+ //Adds new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Appends new textbox to the paragraph
+ IWTextBox textbox = paragraph.AppendTextBox(150, 50);
+ //Adds new text to the textbox body
+ IWParagraph textboxParagraph = textbox.TextBoxBody.AddParagraph();
+ textboxParagraph.AppendText("Text inside text box");
+ //Sets vertical alignment of the text
+ textbox.TextBoxFormat.TextVerticalAlignment = VerticalAlignment.Bottom;
+ //Save and close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+
+
+ 'Creates a new Word document
+ Dim document As New WordDocument()
+ 'Adds new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Adds new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Appends new textbox to the paragraph
+ Dim textbox As IWTextBox = paragraph.AppendTextBox(150, 50)
+ 'Adds new text to the textbox body
+ Dim textboxParagraph As IWParagraph = textbox.TextBoxBody.AddParagraph()
+ textboxParagraph.AppendText("Text inside text box")
+ 'Sets vertical alignment of the text
+ textbox.TextBoxFormat.TextVerticalAlignment = VerticalAlignment.Bottom
+ 'Save and close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ //Creates a new Word document
+ WordDocument document = new WordDocument();
+ //Adds new section to the document
+ IWSection section = document.AddSection();
+ //Adds new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Appends new textbox to the paragraph
+ IWTextBox textbox = paragraph.AppendTextBox(150, 75);
+ //Adds new text to the textbox body
+ IWParagraph textboxParagraph = textbox.TextBoxBody.AddParagraph();
+ textboxParagraph.AppendText("Text inside text box");
+ //Sets textbox rotation in degree
+ textbox.TextBoxFormat.Rotation = 90;
+ //Saves and closes the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+
+
+ 'Creates a new Word document
+ Dim document As WordDocument = New WordDocument
+ 'Adds new section to the document
+ Dim section As IWSection = document.AddSection
+ 'Adds new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph
+ 'Appends new textbox to the paragraph
+ Dim textbox As IWTextBox = paragraph.AppendTextBox(150, 75)
+ 'Adds new text to the textbox body
+ Dim textboxParagraph As IWParagraph = textbox.TextBoxBody.AddParagraph
+ textboxParagraph.AppendText("Text inside text box")
+ 'Sets textbox rotation in degree
+ textbox.TextBoxFormat.Rotation = 90
+ 'Saves and closes the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ //Creates a new Word document
+ WordDocument document = new WordDocument();
+ //Adds new section to the document
+ IWSection section = document.AddSection();
+ //Adds new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Appends new textbox to the paragraph
+ IWTextBox textbox = paragraph.AppendTextBox(150, 75);
+ //Adds new text to the textbox body
+ IWParagraph textboxParagraph = textbox.TextBoxBody.AddParagraph();
+ textboxParagraph.AppendText("Text inside text box");
+ //Sets horizontal flip to the textbox
+ textbox.TextBoxFormat.FlipHorizontal = true;
+ //Saves and closes the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+
+
+ 'Creates a new Word document
+ Dim document As WordDocument = New WordDocument
+ 'Adds new section to the document
+ Dim section As IWSection = document.AddSection
+ 'Adds new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph
+ 'Appends new textbox to the paragraph
+ Dim textbox As IWTextBox = paragraph.AppendTextBox(150, 75)
+ 'Adds new text to the textbox body
+ Dim textboxParagraph As IWParagraph = textbox.TextBoxBody.AddParagraph
+ textboxParagraph.AppendText("Text inside text box")
+ 'Sets horizontal flip to the textbox
+ textbox.TextBoxFormat.FlipHorizontal = True
+ 'Saves and closes the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ //Creates a new Word document
+ WordDocument document = new WordDocument();
+ //Adds new section to the document
+ IWSection section = document.AddSection();
+ //Adds new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Appends new textbox to the paragraph
+ IWTextBox textbox = paragraph.AppendTextBox(150, 75);
+ //Adds new text to the textbox body
+ IWParagraph textboxParagraph = textbox.TextBoxBody.AddParagraph();
+ textboxParagraph.AppendText("Text inside text box");
+ //Sets vertical flip to the textbox
+ textbox.TextBoxFormat.FlipVertical = true;
+ //Saves and closes the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+
+
+ 'Creates a new Word document
+ Dim document As WordDocument = New WordDocument
+ 'Adds new section to the document
+ Dim section As IWSection = document.AddSection
+ 'Adds new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph
+ 'Appends new textbox to the paragraph
+ Dim textbox As IWTextBox = paragraph.AppendTextBox(150, 75)
+ 'Adds new text to the textbox body
+ Dim textboxParagraph As IWParagraph = textbox.TextBoxBody.AddParagraph
+ textboxParagraph.AppendText("Text inside text box")
+ 'Sets vertical flip to the textbox
+ textbox.TextBoxFormat.FlipVertical = True
+ 'Saves and closes the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ //Creates a new Word document
+ WordDocument document = new WordDocument();
+ //Adds new section to the document
+ IWSection section = document.AddSection();
+ //Adds new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Appends new textbox to the paragraph
+ IWTextBox textbox = paragraph.AppendTextBox(150, 50);
+ //Adds new text to the textbox body
+ IWParagraph textboxParagraph = textbox.TextBoxBody.AddParagraph();
+ textboxParagraph.AppendText("Text inside text box text inside text box text inside text box.");
+ //Resize the textbox based on its contents
+ textbox.TextBoxFormat.AutoFit = true;
+ //Save and close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+
+
+ 'Creates a new Word document
+ Dim document As New WordDocument()
+ 'Adds new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Adds new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Appends new textbox to the paragraph
+ Dim textbox As IWTextBox = paragraph.AppendTextBox(150, 50)
+ 'Adds new text to the textbox body
+ Dim textboxParagraph As IWParagraph = textbox.TextBoxBody.AddParagraph()
+ textboxParagraph.AppendText("Text inside text box text inside text box text inside text box.")
+ 'Resize the textbox based on its contents
+ textbox.TextBoxFormat.AutoFit = True
+ 'Save and close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ //Creates a new Word document
+ WordDocument document = new WordDocument();
+ //Adds new section to the document
+ IWSection section = document.AddSection();
+ //Adds new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Appends new textbox to the paragraph
+ IWTextBox textbox = paragraph.AppendTextBox(150, 50);
+ //Adds new text to the textbox body
+ IWParagraph textboxParagraph = textbox.TextBoxBody.AddParagraph();
+ textboxParagraph.AppendText("Text inside text box text inside text box text inside text box.");
+ //Allow the textbox to overlap other textboxes
+ textbox.TextBoxFormat.AllowOverlap = true;
+ //Save and close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+
+
+ 'Creates a new Word document
+ Dim document As New WordDocument()
+ 'Adds new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Adds new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Appends new textbox to the paragraph
+ Dim textbox As IWTextBox = paragraph.AppendTextBox(150, 50)
+ 'Adds new text to the textbox body
+ Dim textboxParagraph As IWParagraph = textbox.TextBoxBody.AddParagraph()
+ textboxParagraph.AppendText("Text inside text box text inside text box text inside text box.")
+ 'Allow the textbox to overlap other textboxes
+ textbox.TextBoxFormat.AllowOverlap = True
+ 'Save and close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ WordDocument document = new WordDocument();
+ //Adds new section to the document
+ IWSection section = document.AddSection();
+ IBlockContentControl control = section.Body.AddBlockContentControl(ContentControlType.RichText);
+ //Adds new paragraph to the section.
+ WParagraph paragraph = new WParagraph(control.Document);
+ //Adds new text to the content control.
+ paragraph.AppendText("Block content control");
+ //Adds pagagraph into the Block content control.
+ control.TextBody.ChildEntities.Add(paragraph);
+ //Sets title of the block content control.
+ control.ContentControlProperties.Title = "Rich text content control";
+ //Adds content control into the document.
+ document.LastSection.Body.ChildEntities.Add(control);
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ Dim document As New WordDocument()
+ 'Adds new section to the document
+ Dim section As IWSection = document.AddSection()
+ Dim control As New BlockContentControl(document, ContentControlType.RichText)
+ 'Adds new paragraph to the section.
+ Dim paragraph As New WParagraph(control.Document)
+ 'Adds new text to the content control.
+ paragraph.AppendText("Block content control")
+ 'Adds pagagraph into the Block content control.
+ control.TextBody.ChildEntities.Add(paragraph)
+ 'Sets title of the block content control.
+ control.ContentControlProperties.Title = "Rich text content control"
+ 'Adds content control into the document.
+ document.LastSection.Body.ChildEntities.Add(control)
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ WordDocument document = new WordDocument();
+ //Adds new section to the document
+ IWSection section = document.AddSection();
+ IBlockContentControl control = section.Body.AddBlockContentControl(ContentControlType.RichText);
+ //Adds new paragraph to the section.
+ WParagraph paragraph = new WParagraph(control.Document);
+ //Adds new text to the content control.
+ paragraph.AppendText("Block content control");
+ //Adds pagagraph into the Block content control.
+ control.TextBody.ChildEntities.Add(paragraph);
+ //Adds content control into the document.
+ document.LastSection.Body.ChildEntities.Add(control);
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ Dim document As New WordDocument()
+ 'Adds new section to the document
+ Dim section As IWSection = document.AddSection()
+ Dim control As New BlockContentControl(document, ContentControlType.RichText)
+ 'Adds new paragraph to the section.
+ Dim paragraph As New WParagraph(control.Document)
+ 'Adds new text to the content control.
+ paragraph.AppendText("Block content control")
+ 'Adds pagagraph into the Block content control.
+ control.TextBody.ChildEntities.Add(paragraph)
+ 'Adds content control into the document.
+ document.LastSection.Body.ChildEntities.Add(control)
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ WordDocument document = new WordDocument();
+ //Adds new section to the document
+ IWSection section = document.AddSection();
+ //Adds new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Adds new rich text content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.RichText);
+ //Adds new text to the content control
+ WTextRange textRange = new WTextRange(document);
+ textRange.Text = "Rich Text Content Control";
+ (paragraph.Items.LastItem as IInlineContentControl).ParagraphItems.Add(textRange);
+ IInlineContentControl richTextControl = paragraph.Items.LastItem as IInlineContentControl;
+ richTextControl.ParagraphItems.Add(textRange);
+ // Sets Title property of the content control.
+ richTextControl.ContentControlProperties.Title = "Rich text content control";
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ Dim document As New WordDocument()
+ 'Adds new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Adds new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Adds new rich text content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.RichText)
+ 'Adds new text to the content control
+ Dim textRange As New WTextRange(document)
+ textRange.Text = "Rich Text Content Control"
+ TryCast(paragraph.Items.LastItem, IInlineContentControl).ParagraphItems.Add(textRange)
+ Dim richTextControl As IInlineContentControl = TryCast(paragraph.Items.LastItem, IInlineContentControl)
+ richTextControl.ParagraphItems.Add(textRange)
+ ' Sets Title property of the content control.
+ richTextControl.ContentControlProperties.Title = "Rich text content control"
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ WordDocument document = new WordDocument();
+ //Adds new section to the document
+ IWSection section = document.AddSection();
+ //Adds new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Adds new rich text content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.RichText);
+ //Adds new text to the content control
+ WTextRange textRange = new WTextRange(document);
+ textRange.Text = "Rich Text Content Control";
+ (paragraph.Items.LastItem as IInlineContentControl).ParagraphItems.Add(textRange);
+ IInlineContentControl richTextControl = paragraph.Items.LastItem as IInlineContentControl;
+ richTextControl.ParagraphItems.Add(textRange);
+ // Sets Title property of the content control.
+ richTextControl.ContentControlProperties.Title = "Rich text content control";
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ Dim document As New WordDocument()
+ 'Adds new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Adds new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Adds new rich text content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.RichText)
+ 'Adds new text to the content control
+ Dim textRange As New WTextRange(document)
+ textRange.Text = "Rich Text Content Control"
+ TryCast(paragraph.Items.LastItem, IInlineContentControl).ParagraphItems.Add(textRange)
+ Dim richTextControl As IInlineContentControl = TryCast(paragraph.Items.LastItem, IInlineContentControl)
+ richTextControl.ParagraphItems.Add(textRange)
+ ' Sets Title property of the content control.
+ richTextControl.ContentControlProperties.Title = "Rich text content control"
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ document.EnsureMinimal();
+ //Add new text
+ IWTextRange text = document.LastParagraph.AppendText("Hello world");
+ //Initialize character format
+ WCharacterFormat characterformat = new WCharacterFormat(document);
+ characterformat.Bold = true;
+ characterformat.Italic = true;
+ characterformat.TextColor = Color.Blue;
+ //Apply character format
+ text.ApplyCharacterFormat(characterformat);
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ document.EnsureMinimal()
+ 'Add new text
+ Dim text As IWTextRange = document.LastParagraph.AppendText("Hello world")
+ 'Initialize character format
+ Dim characterformat As New WCharacterFormat(document)
+ characterformat.Bold = True
+ characterformat.Italic = True
+ characterformat.TextColor = Color.Blue
+ 'Apply character format
+ text.ApplyCharacterFormat(characterformat)
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Initialize new picture
+ WPicture picture = new WPicture(document);
+ //Load image from the file
+ picture.LoadImage(Image.FromFile("Image.png"));
+ //Set width and height
+ picture.Height = 100;
+ picture.Width = 150;
+ //Add picture to the paragraph
+ paragraph.Items.Add(picture);
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Initialize new picture
+ Dim picture As New WPicture(document)
+ 'Load image from the file
+ picture.LoadImage(Image.FromFile("Image.png"))
+ 'Set width and height
+ picture.Height = 100
+ picture.Width = 150
+ 'Add picture to the paragraph
+ paragraph.Items.Add(picture)
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Get the image and convert to byte array
+ Image image = Image.FromFile("Image.png");
+ MemoryStream imageStream = new MemoryStream();
+ image.Save(imageStream, System.Drawing.Imaging.ImageFormat.Png);
+ byte[] imageBytes = imageStream.ToArray();
+ //Initialize new picture
+ WPicture picture = new WPicture(document);
+ //Load image from the byte array
+ picture.LoadImage(imageBytes);
+ //Set width and height
+ picture.Height = 100;
+ picture.Width = 150;
+ //Add picture to the paragraph
+ paragraph.Items.Add(picture);
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Get the image and convert to byte array
+ Dim image__1 As Image = Image.FromFile("Image.png")
+ Dim imageStream As New MemoryStream()
+ image__1.Save(imageStream, System.Drawing.Imaging.ImageFormat.Png)
+ Dim imageBytes As Byte() = imageStream.ToArray()
+ 'Initialize new picture
+ Dim picture As New WPicture(document)
+ 'Load image from the byte array
+ picture.LoadImage(imageBytes)
+ 'Set width and height
+ picture.Height = 100
+ picture.Width = 150
+ 'Add picture to the paragraph
+ paragraph.Items.Add(picture)
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Get the SVG image as byte array.
+ byte[] imageBytes = File.ReadAllBytes("Image.png");
+ //Get the SVG image as byte array.
+ byte[] svgData = File.ReadAllBytes("Image.svg");
+ //Initialize new picture
+ WPicture picture = new WPicture(document);
+ //Load both fallback and SVG image from the byte array
+ picture.LoadImage(svgData, imageBytes);
+ //Set width and height
+ picture.Height = 100;
+ picture.Width = 150;
+ //Add picture to the paragraph
+ paragraph.Items.Add(picture);
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Get the image byte array
+ Dim imageBytes As Byte() = File.ReadAllBytes("Image.png")
+ 'Get the SVG image as byte array.
+ Dim svgData As Byte() = File.ReadAllBytes("Image.svg")
+ 'Initialize new picture
+ Dim picture As New WPicture(document)
+ 'Load both fallback and SVG image from the byte array
+ picture.LoadImage(svgData, imageBytes)
+ 'Set width and height
+ picture.Height = 100
+ picture.Width = 150
+ 'Add picture to the paragraph
+ paragraph.Items.Add(picture)
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ paragraph.AppendText("This paragraph has picture. ");
+ //Append new picture to the paragraph
+ IWPicture picture = paragraph.AppendPicture(Image.FromFile("Image.png"));
+ //Set width and height for the paragraph
+ picture.Width = 150;
+ picture.Height = 100;
+ //Set caption for picture
+ picture.AddCaption("Figure 1.1", CaptionNumberingFormat.Number, CaptionPosition.AboveImage);
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ paragraph.AppendText("This paragraph has picture. ")
+ 'Append new picture to the paragraph
+ Dim picture As IWPicture = paragraph.AppendPicture(Image.FromFile("Image.png"))
+ 'Set width and height for the paragraph
+ picture.Width = 150
+ picture.Height = 100
+ 'Set caption for picture
+ picture.AddCaption("Figure 1.1", CaptionNumberingFormat.Number, CaptionPosition.AboveImage)
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ //Creates a new Word document
+ WordDocument document = new WordDocument();
+ //Adds new section to the document
+ IWSection section = document.AddSection();
+ //Adds new text to the paragraph
+ IWParagraph paragraph = section.AddParagraph();
+ //Gets the image and convert to byte array
+ Image image = Image.FromFile("Image.png");
+ MemoryStream imageStream = new MemoryStream();
+ image.Save(imageStream, System.Drawing.Imaging.ImageFormat.Png);
+ byte[] imageBytes = imageStream.ToArray();
+ //Initializes new picture
+ WPicture picture = new WPicture(document);
+ //Loads an image from the byte array
+ picture.LoadImage(imageBytes);
+ //Sets height and width for the image
+ picture.Height = 100;
+ picture.Width = 150;
+ //Sets horizontal flip to the picture
+ picture.FlipHorizontal = true;
+ //Adds image to the paragraph
+ paragraph.Items.Add(picture);
+ //Saves the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Closes the document
+ document.Close();
+
+
+ 'Creates a New Word document
+ Dim document As WordDocument = New WordDocument
+ 'Adds new section to the document
+ Dim section As IWSection = document.AddSection
+ 'Adds new text to the paragraph
+ Dim paragraph As IWParagraph = section.AddParagraph
+ 'Gets the image and convert to byte array
+ Dim image As Image = Image.FromFile("Image.png")
+ Dim imageStream As MemoryStream = New MemoryStream
+ image.Save(imageStream, System.Drawing.Imaging.ImageFormat.Png)
+ Dim imageBytes() As Byte = imageStream.ToArray
+ 'Initializes new picture
+ Dim picture As WPicture = New WPicture(document)
+ 'Loads an image from the byte array
+ picture.LoadImage(imageBytes)
+ 'Sets height and width for the image
+ picture.Height = 100
+ picture.Width = 150
+ 'Sets horizontal flip to the picture
+ picture.FlipHorizontal = True
+ 'Adds image to the paragraph
+ paragraph.Items.Add(picture)
+ 'Saves the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Closes the document
+ document.Close()
+
+
+ //Creates a new Word document
+ WordDocument document = new WordDocument();
+ //Adds new section to the document
+ IWSection section = document.AddSection();
+ //Adds new text to the paragraph
+ IWParagraph paragraph = section.AddParagraph();
+ //Gets the image and convert to byte array
+ Image image = Image.FromFile("Image.png");
+ MemoryStream imageStream = new MemoryStream();
+ image.Save(imageStream, System.Drawing.Imaging.ImageFormat.Png);
+ byte[] imageBytes = imageStream.ToArray();
+ //Initializes new picture
+ WPicture picture = new WPicture(document);
+ //Loads an image from the byte array
+ picture.LoadImage(imageBytes);
+ //Sets height and width for the image
+ picture.Height = 100;
+ picture.Width = 150;
+ //Sets vertical flip to the picture
+ picture.FlipVertical = true;
+ //Adds image to the paragraph
+ paragraph.Items.Add(picture);
+ //Saves the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Closes the document
+ document.Close();
+
+
+ 'Creates a New Word document
+ Dim document As WordDocument = New WordDocument
+ 'Adds new section to the document
+ Dim section As IWSection = document.AddSection
+ 'Adds new text to the paragraph
+ Dim paragraph As IWParagraph = section.AddParagraph
+ 'Gets the image and convert to byte array
+ Dim image As Image = Image.FromFile("Image.png")
+ Dim imageStream As MemoryStream = New MemoryStream
+ image.Save(imageStream, System.Drawing.Imaging.ImageFormat.Png)
+ Dim imageBytes() As Byte = imageStream.ToArray
+ 'Initializes new picture
+ Dim picture As WPicture = New WPicture(document)
+ 'Loads an image from the byte array
+ picture.LoadImage(imageBytes)
+ 'Sets height and width for the image
+ picture.Height = 100
+ picture.Width = 150
+ 'Sets vertical flip to the picture
+ picture.FlipVertical = True
+ 'Adds image to the paragraph
+ paragraph.Items.Add(picture)
+ 'Saves the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Closes the document
+ document.Close()
+
+
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add the section into the Word document
+ IWSection section = document.AddSection();
+ string paraText = "Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula";
+ //Add the paragraph into the created section
+ IWParagraph paragraph = section.AddParagraph();
+ //Append the TOC field with LowerHeadingLevel and UpperHeadingLevel to determines the TOC entries
+ paragraph.AppendTOC(1, 3);
+ //Add the section into the Word document
+ section = document.AddSection();
+ //Add the paragraph into the created section
+ paragraph = section.AddParagraph();
+ //Add the text for the headings
+ paragraph.AppendText("First Chapter");
+ //Set a build in heading style.
+ paragraph.ApplyStyle(BuiltinStyle.Heading1);
+ //Add the text into the paragraph
+ section.AddParagraph().AppendText(paraText);
+ //Add the section into the Word document
+ section = document.AddSection();
+ //Add the paragraph into the created section
+ paragraph = section.AddParagraph();
+ //Add the text for the headings
+ paragraph.AppendText("Second Chapter");
+ //Set a build in heading style.
+ paragraph.ApplyStyle(BuiltinStyle.Heading2);
+ //Add the text into the paragraph
+ section.AddParagraph().AppendText(paraText);
+ //Add the section into the Word document
+ section = document.AddSection();
+ //Add the paragraph into the created section
+ paragraph = section.AddParagraph();
+ //Add the text into the headings
+ paragraph.AppendText("Third Chapter");
+ //Set a build in heading style
+ paragraph.ApplyStyle(BuiltinStyle.Heading3);
+ //Add the text into the paragraph.
+ section.AddParagraph().AppendText(paraText);
+ //Update the table of contents
+ document.UpdateTableOfContents();
+ //Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+
+
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add the section into the Word document
+ Dim section As IWSection = document.AddSection()
+ Dim paraText As String = "Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula"
+ 'Add the paragraph into the created section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Append the TOC field with LowerHeadingLevel and UpperHeadingLevel to determines the TOC entries
+ paragraph.AppendTOC(1, 3)
+ 'Add the section into the Word document
+ section = document.AddSection()
+ 'Add the paragraph into the created section
+ paragraph = section.AddParagraph()
+ 'Add the text for the headings
+ paragraph.AppendText("First Chapter")
+ 'Set a build in heading style
+ paragraph.ApplyStyle(BuiltinStyle.Heading1)
+ 'Add the text into the paragraph.
+ section.AddParagraph().AppendText(paraText)
+ 'Add the section into the Word document
+ section = document.AddSection()
+ 'Add the paragraph into the created section
+ paragraph = section.AddParagraph()
+ 'Add the text for the headings
+ paragraph.AppendText("Second Chapter")
+ 'Set a build in heading style
+ paragraph.ApplyStyle(BuiltinStyle.Heading2)
+ 'Add the text into the paragraph
+ section.AddParagraph().AppendText(paraText)
+ 'Add the section into the Word document
+ section = document.AddSection()
+ 'Add the paragraph into the created section
+ paragraph = section.AddParagraph()
+ 'Add the text into the headings
+ paragraph.AppendText("Third Chapter")
+ 'Set a build in heading style
+ paragraph.ApplyStyle(BuiltinStyle.Heading3)
+ 'Add the text into the paragraph
+ section.AddParagraph().AppendText(paraText)
+ 'Update the table of contents
+ document.UpdateTableOfContents()
+ 'Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Create a new custom styles
+ Style style = (WParagraphStyle)document.AddParagraphStyle("Mystyle");
+ style.CharacterFormat.Bold = true;
+ style.CharacterFormat.FontName = "Verdana";
+ style.CharacterFormat.FontSize = 25;
+ //Add the section into the Word document
+ IWSection section = document.AddSection();
+ string paraText = "Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula";
+ //Add the paragraph into the created section
+ IWParagraph paragraph = section.AddParagraph();
+ //Append the TOC field with LowerHeadingLevel and UpperHeadingLevel to determines the TOC entries
+ TableOfContent toc = paragraph.AppendTOC(1, 3);
+ toc.UseHeadingStyles = false;
+ //Set the TOC level style based on which the TOC should be created
+ toc.SetTOCLevelStyle(2, "Mystyle");
+ //Add the section into the Word document
+ section = document.AddSection();
+ //Add the paragraph into the created section
+ paragraph = section.AddParagraph();
+ //Add the text for the headings
+ paragraph.AppendText("First Chapter");
+ //Set the build in heading style
+ paragraph.ApplyStyle("Mystyle");
+ //Add the text into the paragraph
+ section.AddParagraph().AppendText(paraText);
+ //Add the section into the Word document
+ section = document.AddSection();
+ //Add the paragraph into the created section
+ paragraph = section.AddParagraph();
+ //Add the text for the headings
+ paragraph.AppendText("Second Chapter");
+ //Set the build in heading style
+ paragraph.ApplyStyle(BuiltinStyle.Heading1);
+ //Add the text to the paragraph
+ section.AddParagraph().AppendText(paraText);
+ //Add the section into Word document
+ section = document.AddSection();
+ //Add a paragraph to created section
+ paragraph = section.AddParagraph();
+ //Add the text for the headings
+ paragraph.AppendText("Third Chapter");
+ //Set the build in heading style
+ paragraph.ApplyStyle("Mystyle");
+ //Add the text to the paragraph
+ section.AddParagraph().AppendText(paraText);
+ //Update the table of contents
+ document.UpdateTableOfContents();
+ //Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+
+
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Create a new custom styles
+ Dim style As Style = DirectCast(document.AddParagraphStyle("Mystyle"), WParagraphStyle)
+ style.CharacterFormat.Bold = True
+ style.CharacterFormat.FontName = "Verdana"
+ style.CharacterFormat.FontSize = 25
+ 'Add the section into the Word document
+ Dim section As IWSection = document.AddSection()
+ Dim paraText As String = "Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet.Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula"
+ 'Add the paragraph into the created section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Append the TOC field with LowerHeadingLevel and UpperHeadingLevel to determine the TOC entries
+ Dim toc As TableOfContent = paragraph.AppendTOC(1, 3)
+ toc.UseHeadingStyles = False
+ 'Set the TOC level style based on which the TOC should be created
+ toc.SetTOCLevelStyle(2, "Mystyle")
+ 'Add the section into the Word document
+ section = document.AddSection()
+ 'Add the paragraph into the created section
+ paragraph = section.AddParagraph()
+ 'Add the text for the headings
+ paragraph.AppendText("First Chapter")
+ 'Set the build in heading style
+ paragraph.ApplyStyle("Mystyle")
+ 'Add the text into the paragraph
+ section.AddParagraph().AppendText(paraText)
+ 'Add the section into the Word document
+ section = document.AddSection()
+ 'Add the paragraph into the created section
+ paragraph = section.AddParagraph()
+ 'Add the text for the headings
+ paragraph.AppendText("Second Chapter")
+ 'Set the build in heading style
+ paragraph.ApplyStyle(BuiltinStyle.Heading1)
+ 'Add the text to the paragraph
+ section.AddParagraph().AppendText(paraText)
+ 'Add the section into Word document
+ section = document.AddSection()
+ 'Add a paragraph to created section
+ paragraph = section.AddParagraph()
+ 'Add the text for the headings
+ paragraph.AppendText("Third Chapter")
+ 'Set the build in heading style
+ paragraph.ApplyStyle("Mystyle")
+ 'Add the text to the paragraph
+ section.AddParagraph().AppendText(paraText)
+ 'Update the table of contents
+ document.UpdateTableOfContents()
+ 'Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ //Load a Word document
+ WordDocument document = new WordDocument("Template.docx");
+ WTextBody textBody = document.Sections[0].Body;
+ WParagraph paragraph = textBody.Paragraphs[0];
+ //Get the TOC item from the paragraph
+ TableOfContent toc = paragraph.ChildEntities[0] as TableOfContent;
+ //Gets the style name for the specified level
+ string styleName = toc.GetTOCLevelStyle(1);
+ WParagraphStyle style = document.Styles.FindByName(styleName) as WParagraphStyle;
+ //Modify the character format of the style
+ style.CharacterFormat.HighlightColor = Color.LightGray;
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ 'Load a Word document
+ Dim document As New WordDocument("Template.docx")
+ Dim textBody As WTextBody = document.Sections(0).Body
+ Dim paragraph As WParagraph = textBody.Paragraphs(0)
+ 'Get the TOC item from the paragraph
+ Dim toc As TableOfContent = TryCast(paragraph.ChildEntities(0), TableOfContent)
+ 'Gets the style name for the specified level
+ Dim styleName As String = toc.GetTOCLevelStyle(1)
+ Dim style As WParagraphStyle = TryCast(document.Styles.FindByName(styleName), WParagraphStyle)
+ 'Modify the character format of the style
+ style.CharacterFormat.HighlightColor = Color.LightGray
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ //Create a new Word document.
+ using (WordDocument document = new WordDocument())
+ {
+ //Add a new section to the document.
+ IWSection section = document.AddSection();
+ //Add a paragraph to the section.
+ IWParagraph paragraph = section.AddParagraph();
+ //Append the TOC field with LowerHeadingLevel and UpperHeadingLevel to determine the TOC entries.
+ TableOfContent tableOfContent = paragraph.AppendTOC(1, 3);
+ //Set the name of SEQ field identifier for table of figures.
+ tableOfContent.TableOfFiguresLabel = "Figure";
+ //Add a paragraph to the section.
+ paragraph = section.AddParagraph();
+ //Add image to the paragraph.
+ FileStream imageStream = new FileStream(@"Image.png", FileMode.Open, FileAccess.ReadWrite);
+ IWPicture picture = paragraph.AppendPicture(imageStream);
+ //Add Image caption.
+ IWParagraph paragraph1 = picture.AddCaption("Figure", CaptionNumberingFormat.Number, CaptionPosition.AfterImage);
+ //Add text to the paragraph.
+ paragraph1.AppendText(" Icon.");
+ //Update the fields in Word document.
+ document.UpdateDocumentFields();
+ //Update the table of contents.
+ document.UpdateTableOfContents();
+ //Saves the Word document to MemoryStream.
+ MemoryStream stream = new MemoryStream();
+ document.Save(stream, FormatType.Docx);
+ }
+
+
+ 'Create a new Word document.
+ Dim document As WordDocument = New WordDocument()
+ 'Add a new section to the document.
+ Dim section As IWSection = document.AddSection()
+ 'Add a paragraph to the section.
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Append the TOC field with LowerHeadingLevel and UpperHeadingLevel to determine the TOC entries.
+ Dim tableOfContent As TableOfContent = paragraph.AppendTOC(1, 3)
+ 'Set the name of SEQ field identifier for table of figures.
+ tableOfContent.TableOfFiguresLabel = "Figure"
+ 'Add a paragraph to the section.
+ paragraph = section.AddParagraph()
+ 'Add image to the paragraph.
+ Dim imageStream As FileStream = New FileStream("Image.png", FileMode.Open, FileAccess.ReadWrite)
+ Dim picture As IWPicture = paragraph.AppendPicture(imageStream)
+ 'Add Image caption.
+ Dim paragraph1 As IWParagraph = picture.AddCaption("Figure", CaptionNumberingFormat.Number, CaptionPosition.AfterImage)
+ 'Add text to the paragraph.
+ paragraph1.AppendText(" Icon.")
+ 'Update the fields in Word document.
+ document.UpdateDocumentFields()
+ 'Update the table of contents.
+ document.UpdateTableOfContents()
+ 'Save the document.
+ document.Save("Result.docx")
+ document.Close()
+
+
+ //Create a new Word document.
+ using (WordDocument document = new WordDocument())
+ {
+ //Add a new section to the document.
+ IWSection section = document.AddSection();
+ //Add a paragraph to the section.
+ IWParagraph paragraph = section.AddParagraph();
+ //Append the TOC field with LowerHeadingLevel and UpperHeadingLevel to determine the TOC entries.
+ TableOfContent tableOfContent = paragraph.AppendTOC(1, 3);
+ //Set the name of SEQ field identifier for table of figures.
+ tableOfContent.TableOfFiguresLabel = "Figure";
+ //Disable the flag, to exclude caption's label and number in TOC entries.
+ tableOfContent.IncludeCaptionLabelsAndNumbers = false;
+ //Add a paragraph to the section.
+ paragraph = section.AddParagraph();
+ //Add image to the paragraph.
+ FileStream imageStream = new FileStream(@"Image.png", FileMode.Open, FileAccess.ReadWrite);
+ IWPicture picture = paragraph.AppendPicture(imageStream);
+ //Add Image caption.
+ IWParagraph paragraph1 = picture.AddCaption("Figure", CaptionNumberingFormat.Number, CaptionPosition.AfterImage);
+ //Add text to the paragraph.
+ paragraph1.AppendText(" Icon.");
+ //Update the fields in Word document.
+ document.UpdateDocumentFields();
+ //Update the table of contents.
+ document.UpdateTableOfContents();
+ //Saves the Word document to MemoryStream.
+ MemoryStream stream = new MemoryStream();
+ document.Save(stream, FormatType.Docx);
+ }
+
+
+ 'Create a new Word document.
+ Dim document As WordDocument = New WordDocument()
+ 'Add a new section to the document.
+ Dim section As IWSection = document.AddSection()
+ 'Add a paragraph to the section.
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Append the TOC field with LowerHeadingLevel and UpperHeadingLevel to determine the TOC entries.
+ Dim tableOfContent As TableOfContent = paragraph.AppendTOC(1, 3)
+ 'Set the name of SEQ field identifier for table of figures.
+ tableOfContent.TableOfFiguresLabel = "Figure"
+ 'Disable the flag, to exclude caption's label and number in TOC entries.
+ tableOfContent.IncludeCaptionLabelsAndNumbers = False
+ 'Add a paragraph to the section.
+ paragraph = section.AddParagraph()
+ 'Add image to the paragraph.
+ Dim imageStream As FileStream = New FileStream("Image.png", FileMode.Open, FileAccess.ReadWrite)
+ Dim picture As IWPicture = paragraph.AppendPicture(imageStream)
+ 'Add Image caption.
+ Dim paragraph1 As IWParagraph = picture.AddCaption("Figure", CaptionNumberingFormat.Number, CaptionPosition.AfterImage)
+ 'Add text to the paragraph.
+ paragraph1.AppendText(" Icon.")
+ 'Update the fields in Word document.
+ document.UpdateDocumentFields()
+ 'Update the table of contents.
+ document.UpdateTableOfContents()
+ 'Save the document.
+ document.Save("Result.docx")
+ document.Close()
+
+
+ //Create a Word document.
+ WordDocument document = new WordDocument();
+ //Adds the section into the Word document.
+ IWSection section = document.AddSection();
+ //Adds the paragraph into the created section.
+ IWParagraph tocParagraph = section.AddParagraph();
+ //Append the TOC field with LowerHeadingLevel and UpperHeadingLevel to determine the TOC entries.
+ TableOfContent tableOfContent = tocParagraph.AppendTOC(1, 3);
+ //Enables the property IncludeNewLineCharacters to preserve newline characters in the TableOfContent.
+ tableOfContent.IncludeNewLineCharacters = true;
+ //Adds the paragraph into the section.
+ WParagraph paragraph = section.AddParagraph() as WParagraph;
+ //Adds the text and breaks the headings.
+ paragraph.AppendText("First ");
+ paragraph.AppendBreak(BreakType.LineBreak);
+ paragraph.AppendText("Chapter");
+ //Sets a built-in heading style.
+ paragraph.ApplyStyle(BuiltinStyle.Heading1);
+ //Adds the text into the new paragraph of the section.
+ section.AddParagraph().AppendText("AdventureWorks Cycles, the fictitious company on which the AdventureWorks sample databases are based, is a large, multinational manufacturing company.");
+ //Updated the table of content.
+ document.UpdateTableOfContents();
+ //Saves the document.
+ document.Save("Result.docx");
+ document.Close();
+
+
+ 'Create a Word document.
+ Dim document As WordDocument = New WordDocument()
+ 'Add the section into the Word document.
+ Dim section As IWSection = document.AddSection()
+ 'Add the paragraph into the created section.
+ Dim tocParagraph As IWParagraph = section.AddParagraph()
+ 'Append the TOC field with LowerHeadingLevel and UpperHeadingLevel to determine the TOC entries.
+ Dim tableOfContent As TableOfContent = tocParagraph.AppendTOC(1, 3)
+ 'Enable the property IncludeNewLineCharacters to preserve newline characters in TableOfContent.
+ tableOfContent.IncludeNewLineCharacters = True
+ 'Add the paragraph into the section.
+ Dim paragraph As WParagraph = TryCast(section.AddParagraph(), WParagraph)
+ 'Add the text and break the headings.
+ paragraph.AppendText("First ")
+ paragraph.AppendBreak(BreakType.LineBreak)
+ paragraph.AppendText("Chapter")
+ 'Set a built-in heading style.
+ paragraph.ApplyStyle(BuiltinStyle.Heading1)
+ 'Add the text into the new paragraph of the section.
+ section.AddParagraph().AppendText("AdventureWorks Cycles, the fictitious company on which the AdventureWorks sample databases are based, is a large, multinational manufacturing company.")
+ 'Updated the table of content.
+ document.UpdateTableOfContents()
+ 'Save the document.
+ document.Save("Result.docx")
+ document.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ WParagraph paragraph = section.AddParagraph() as WParagraph;
+ paragraph.AppendText("Gender\t");
+ //Append new Checkbox
+ WCheckBox checkbox = paragraph.AppendCheckBox();
+ checkbox.Checked = false;
+ //Set Checkbox size
+ checkbox.CheckBoxSize = 10;
+ checkbox.CalculateOnExit = true;
+ //Set help text
+ checkbox.Help = "Help text";
+ paragraph.AppendText("Male\t");
+ checkbox = paragraph.AppendCheckBox();
+ checkbox.Checked = false;
+ checkbox.CheckBoxSize = 10;
+ checkbox.CalculateOnExit = true;
+ paragraph.AppendText("Female");
+ //Save the Word document
+ document.Save("Checkbox.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Initialize new text range instance
+ IWTextRange textrange = new WTextRange(document);
+ //Add text and its formatting
+ textrange.Text = "A new text is added";
+ textrange.CharacterFormat.FontSize = 14;
+ textrange.CharacterFormat.Bold = true;
+ textrange.CharacterFormat.TextColor = Color.Green;
+ //Add text range to the paragraph
+ paragraph.Items.Add(textrange);
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Initialize new text range instance
+ Dim textrange As IWTextRange = New WTextRange(document)
+ 'Add text and its formatting
+ textrange.Text = "A new text is added"
+ text.CharacterFormat.FontSize = 14
+ text.CharacterFormat.Bold = True
+ text.CharacterFormat.TextColor = Color.Green
+ 'Add text range to the paragraph
+ paragraph.Items.Add(textrange)
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ document.EnsureMinimal();
+ //Add new text
+ IWTextRange text = document.LastParagraph.AppendText("Hello world");
+ //Initialize character format
+ WCharacterFormat characterformat = new WCharacterFormat(document);
+ characterformat.Bold = true;
+ characterformat.Italic = true;
+ characterformat.TextColor = Color.Blue;
+ //Apply character format
+ text.ApplyCharacterFormat(characterformat);
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ document.EnsureMinimal()
+ 'Add new text
+ Dim text As IWTextRange = document.LastParagraph.AppendText("Hello world")
+ 'Initialize character format
+ Dim characterformat As New WCharacterFormat(document)
+ characterformat.Bold = True
+ characterformat.Italic = True
+ characterformat.TextColor = Color.Blue
+ 'Apply character format
+ text.ApplyCharacterFormat(characterformat)
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ //Creates an instance of WordDocument class
+ WordDocument document = new WordDocument();
+ //Adds a new section into the Word Document
+ IWSection section = document.AddSection();
+ //Adds a new paragraph into Word document and appends text into paragraph
+ IWParagraph paragraph = section.AddParagraph();
+ paragraph.AppendText("Today's Date: ");
+ //Adds the new Date field in Word document with field name and its type
+ WField field = paragraph.AppendField("Date", FieldType.FieldDate) as WField;
+ //Updates the field
+ field.Update();
+ //Unlink the field
+ field.Unlink();
+ //Saves the document in the given name and format
+ document.Save("Sample.docx", FormatType.Docx);
+ //Releases the resources occupied by WordDocument instance
+ document.Close();
+
+
+ 'Creates an instance of WordDocument class
+ Dim document As WordDocument = New WordDocument()
+ 'Adds a new section into the Word Document
+ Dim section As IWSection = document.AddSection()
+ 'Adds a new paragraph into Word document and appends text into paragraph
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ paragraph.AppendText("Today's Date: ")
+ 'Adds the new Date field in Word document with field name and its type
+ Dim field As WField = CType(paragraph.AppendField("Date", FieldType.FieldDate), WField)
+ 'Updates the field
+ field.Update()
+ 'Unlink the field
+ field.Unlink()
+ 'Saves the document in the given name and format
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Releases the resources occupied by WordDocument instance
+ document.Close()
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add section to the document
+ Dim sec As IWSection = document.AddSection()
+ 'Add paragraph to the section
+ Dim paragraph As IWParagraph = sec.AddParagraph()
+ 'Input data for chart
+ Dim data As Object()() = New Object(5)() {}
+ For i As Integer = 0 To 5
+ data(i) = New Object(2) {}
+ Next
+ data(0)(0) = ""
+ data(1)(0) = "Gravad lax"
+ data(2)(0) = "Louisiana Hot spiced Okara"
+ data(3)(0) = "Mascarpone Fabioli"
+ data(4)(0) = "Wimmers gute SemmelKnodel"
+ data(5)(0) = "Maxilaku"
+ data(0)(1) = "Sum of Purchases"
+ data(1)(1) = 286
+ data(2)(1) = 680
+ data(3)(1) = 288
+ data(4)(1) = 200
+ data(5)(1) = 731
+ data(0)(2) = "Sum of Future Expenses"
+ data(1)(2) = 1300
+ data(2)(2) = 700
+ data(3)(2) = 1280
+ data(4)(2) = 1200
+ data(5)(2) = 2660
+ 'Create and Append chart to the paragraph
+ Dim chart As WChart = paragraph.AppendChart(data, 470, 300)
+ 'Set chart type and title
+ chart.ChartType = OfficeChartType.Column_Clustered
+ chart.ChartTitle = "Purchase Details"
+ chart.ChartTitleArea.FontName = "Calibri"
+ chart.ChartTitleArea.Size = 14
+ chart.ChartArea.Border.LinePattern = OfficeChartLinePattern.None
+ chart.PrimaryCategoryAxis.Title = "Products"
+ chart.PrimaryValueAxis.Title = "In Dollars"
+ 'Set position of legend
+ chart.Legend.Position = OfficeLegendPosition.Bottom
+ 'Save the document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ //Open the template document.
+ WordDocument document = new WordDocument("Template.docx");
+ //Get the paragraph.
+ WParagraph paragraph = document.LastParagraph;
+ //Get the chart entity.
+ WChart chart = paragraph.ChildEntities[0] as WChart;
+ //Replaces the chart data with the worksheet data.
+ chart.Refresh(true);
+ //Save and close the document
+ document.Save("Sample.docx");
+ document.Close();
+
+
+ 'Open the template document.
+ Dim document As WordDocument = New WordDocument("Template.docx")
+ 'Get the paragraph.
+ Dim paragraph As WParagraph = document.LastParagraph
+ 'Get the chart entity.
+ Dim chart As WChart = TryCast(paragraph.ChildEntities(0), WChart)
+ 'Replaces the chart data with the worksheet data..
+ chart.Refresh(True)
+ 'Save and close the document
+ document.Save("Sample.docx")
+ document.Close()
+
+
+ //Loads the template document
+ WordDocument document = new WordDocument("Template.docx");
+ //Gets the last paragraph
+ WParagraph paragraph = document.LastParagraph;
+ //Gets the chart entity from the paragraph items
+ WChart chart = paragraph.ChildEntities[0] as WChart;
+ //Modifies the external data file path of chart
+ chart.ExternalDataPath = @"Data\Excel_Template.xlsx";
+ //Saves and closes the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+
+
+ 'Loads the template document
+ Dim document As New WordDocument("Template.docx")
+ 'Gets the last paragraph
+ Dim paragraph As WParagraph = document.LastParagraph
+ 'Gets the chart entity from the paragraph items
+ Dim chart As WChart = TryCast(paragraph.ChildEntities(0), WChart)
+ 'Modifies the external data file path of chart
+ chart.ExternalDataPath = "Data\Excel_Template.xlsx"
+ 'Saves and closes the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load the template document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ //Get the paragraph
+ WParagraph paragraph = document.LastParagraph;
+ //Get the chart entity
+ WChart chart = paragraph.ChildEntities[1] as WChart;
+ //Format chart area.
+ IOfficeChartFrameFormat chartArea = chart.ChartArea;
+ //Set border line pattern, color, line weight
+ chartArea.Border.LinePattern = OfficeChartLinePattern.Solid;
+ chartArea.Border.LineColor = Color.Blue;
+ chartArea.Border.LineWeight = OfficeChartLineWeight.Hairline;
+ //Set fill type and fill colors
+ chartArea.Fill.FillType = OfficeFillType.Gradient;
+ chartArea.Fill.GradientColorType = OfficeGradientColor.TwoColor;
+ chartArea.Fill.BackColor = Color.FromArgb(205, 217, 234);
+ chartArea.Fill.ForeColor = Color.White;
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load the template document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ 'Get the paragraph
+ Dim paragraph As WParagraph = document.LastParagraph
+ 'Get the chart entity
+ Dim chart As WChart = TryCast(paragraph.ChildEntities(1), WChart)
+ 'Format chart area.
+ Dim chartArea As IOfficeChartFrameFormat = chart.ChartArea
+ 'Set border line pattern, color, line weight
+ chartArea.Border.LinePattern = OfficeChartLinePattern.Solid
+ chartArea.Border.LineColor = Color.Blue
+ chartArea.Border.LineWeight = OfficeChartLineWeight.Hairline
+ 'Set fill type and fill colors
+ chartArea.Fill.FillType = OfficeFillType.Gradient
+ chartArea.Fill.GradientColorType = OfficeGradientColor.TwoColor
+ chartArea.Fill.BackColor = Color.FromArgb(205, 217, 234)
+ chartArea.Fill.ForeColor = Color.White
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load the template document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ WParagraph paragraph = document.LastParagraph;
+ //Get the chart entity
+ WChart chart = paragraph.ChildEntities[0] as WChart;
+ //Set border settings - line color, pattern, weight, transparency
+ chart.PlotArea.Border.AutoFormat = false;
+ chart.PlotArea.Border.IsAutoLineColor = false;
+ chart.PlotArea.Border.LineColor = Color.Blue;
+ chart.PlotArea.Border.LinePattern = OfficeChartLinePattern.DashDot;
+ chart.PlotArea.Border.LineWeight = OfficeChartLineWeight.Wide;
+ chart.PlotArea.Border.Transparency = 0.6;
+ //Set the plot area’s fill type, color
+ chart.PlotArea.Fill.FillType = OfficeFillType.SolidColor;
+ chart.PlotArea.Fill.ForeColor = Color.LightPink;
+ //Set the plot area shadow presence
+ chart.PlotArea.Shadow.ShadowInnerPresets = Office2007ChartPresetsInner.InsideDiagonalTopLeft;
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load the template document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ Dim paragraph As WParagraph = document.LastParagraph
+ 'Get the chart entity
+ Dim chart As WChart = TryCast(paragraph.ChildEntities(0), WChart)
+ 'Set border settings - line color, pattern, weight, transparency
+ chart.PlotArea.Border.AutoFormat = False
+ chart.PlotArea.Border.IsAutoLineColor = False
+ chart.PlotArea.Border.LineColor = Color.Blue
+ chart.PlotArea.Border.LinePattern = OfficeChartLinePattern.DashDot
+ chart.PlotArea.Border.LineWeight = OfficeChartLineWeight.Wide
+ chart.PlotArea.Border.Transparency = 0.6
+ 'Set the plot area’s fill type, color
+ chart.PlotArea.Fill.FillType = OfficeFillType.SolidColor
+ chart.PlotArea.Fill.ForeColor = Color.LightPink
+ 'Set the plot area shadow presence
+ chart.PlotArea.Shadow.ShadowInnerPresets = Office2007ChartPresetsInner.InsideDiagonalTopLeft
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add section to the document
+ IWSection sec = document.AddSection();
+ //Add paragraph to the section
+ IWParagraph paragraph = sec.AddParagraph();
+ //Load the excel file as stream
+ Stream excelStream = File.OpenRead("Excel_Template.xlsx");
+ //Create and Append chart to the paragraph with excel stream as parameter
+ WChart chart = paragraph.AppendChart(excelStream, 1, "B2:C6", 470, 300);
+ //Set chart type and title
+ chart.ChartType = OfficeChartType.Column_Clustered_3D;
+ chart.ChartTitle = "Purchase Details";
+ chart.ChartTitleArea.FontName = "Calibri";
+ chart.ChartTitleArea.Size = 14;
+ chart.ChartArea.Border.LinePattern = OfficeChartLinePattern.None;
+ //Set name to chart series
+ chart.Series[0].Name = "Sum of Purchases";
+ chart.Series[1].Name = "Sum of Future Expenses";
+ chart.PrimaryCategoryAxis.Title = "Products";
+ chart.PrimaryValueAxis.Title = "In Dollars";
+ //Set position of legend
+ chart.Legend.Position = OfficeLegendPosition.Bottom;
+ //Set roatation and elevation values
+ chart.Rotation = 20;
+ chart.Elevation = 15;
+ //Set side wall properties
+ chart.SideWall.Fill.FillType = OfficeFillType.SolidColor;
+ chart.SideWall.Fill.ForeColor = Color.White;
+ chart.SideWall.Fill.BackColor = Color.White;
+ chart.SideWall.Border.LineColor = System.Drawing.Color.Beige;
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add section to the document
+ Dim sec As IWSection = document.AddSection()
+ 'Add paragraph to the section
+ Dim paragraph As IWParagraph = sec.AddParagraph()
+ 'Load the excel file as stream
+ Dim excelStream As Stream = File.OpenRead("Excel_Template.xlsx")
+ 'Create and Append chart to the paragraph with excel stream as parameter
+ Dim chart As WChart = paragraph.AppendChart(excelStream, 1, "B2:C6", 470, 300)
+ 'Set chart type and title
+ chart.ChartType = OfficeChartType.Column_Clustered_3D
+ chart.ChartTitle = "Purchase Details"
+ chart.ChartTitleArea.FontName = "Calibri"
+ chart.ChartTitleArea.Size = 14
+ chart.ChartArea.Border.LinePattern = OfficeChartLinePattern.None
+ 'Set name to chart series
+ chart.Series(0).Name = "Sum of Purchases"
+ chart.Series(1).Name = "Sum of Future Expenses"
+ chart.PrimaryCategoryAxis.Title = "Products"
+ chart.PrimaryValueAxis.Title = "In Dollars"
+ 'Set position of legend
+ chart.Legend.Position = OfficeLegendPosition.Bottom
+ 'Set rotation and elevation values
+ chart.Rotation = 20
+ chart.Elevation = 15
+ 'Set side wall properties
+ chart.SideWall.Fill.FillType = OfficeFillType.SolidColor
+ chart.SideWall.Fill.ForeColor = Color.White
+ chart.SideWall.Fill.BackColor = Color.White
+ chart.SideWall.Border.LineColor = System.Drawing.Color.Beige
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add section to the document
+ IWSection sec = document.AddSection();
+ //Add paragraph to the section
+ IWParagraph paragraph = sec.AddParagraph();
+ //Load the excel file as stream
+ Stream excelStream = File.OpenRead("Excel_Template.xlsx");
+ //Create and Append chart to the paragraph with excel stream as parameter
+ WChart chart = paragraph.AppendChart(excelStream, 1, "B2:C6", 470, 300);
+ //Set chart type and title
+ chart.ChartType = OfficeChartType.Column_Clustered_3D;
+ chart.ChartTitle = "Purchase Details";
+ chart.ChartTitleArea.FontName = "Calibri";
+ chart.ChartTitleArea.Size = 14;
+ chart.ChartArea.Border.LinePattern = OfficeChartLinePattern.None;
+ //Set name to chart series
+ chart.Series[0].Name = "Sum of Purchases";
+ chart.Series[1].Name = "Sum of Future Expenses";
+ chart.PrimaryCategoryAxis.Title = "Products";
+ chart.PrimaryValueAxis.Title = "In Dollars";
+ //Set position of legend
+ chart.Legend.Position = OfficeLegendPosition.Bottom;
+ //Set roatation and elevation values
+ chart.Rotation = 20;
+ chart.Elevation = 15;
+ //Set the Backwall fill option.
+ chart.BackWall.Fill.FillType = OfficeFillType.Gradient;
+ //Set the Texture Type.
+ chart.BackWall.Fill.GradientColorType = OfficeGradientColor.TwoColor;
+ chart.BackWall.Fill.GradientStyle = OfficeGradientStyle.Diagonl_Down;
+ chart.BackWall.Fill.ForeColor = Color.WhiteSmoke;
+ chart.BackWall.Fill.BackColor = Color.LightBlue;
+ //Set the Border Linecolor.
+ chart.BackWall.Border.LineColor = System.Drawing.Color.Wheat;
+ //Set the Picture Type.
+ chart.BackWall.PictureUnit = OfficeChartPictureType.stretch;
+ //Set the Backwall thickness.
+ chart.BackWall.Thickness = 10;
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add section to the document
+ Dim sec As IWSection = document.AddSection()
+ 'Add paragraph to the section
+ Dim paragraph As IWParagraph = sec.AddParagraph()
+ 'Load the excel file as stream
+ Dim excelStream As Stream = File.OpenRead("Excel_Template.xlsx")
+ 'Create and Append chart to the paragraph with excel stream as parameter
+ Dim chart As WChart = paragraph.AppendChart(excelStream, 1, "B2:C6", 470, 300)
+ 'Set chart type and title
+ chart.ChartType = OfficeChartType.Column_Clustered_3D
+ chart.ChartTitle = "Purchase Details"
+ chart.ChartTitleArea.FontName = "Calibri"
+ chart.ChartTitleArea.Size = 14
+ chart.ChartArea.Border.LinePattern = OfficeChartLinePattern.None
+ 'Set name to chart series
+ chart.Series(0).Name = "Sum of Purchases"
+ chart.Series(1).Name = "Sum of Future Expenses"
+ chart.PrimaryCategoryAxis.Title = "Products"
+ chart.PrimaryValueAxis.Title = "In Dollars"
+ 'Set position of legend
+ chart.Legend.Position = OfficeLegendPosition.Bottom
+ 'Set rotation and elevation values
+ chart.Rotation = 20
+ chart.Elevation = 15
+ 'Set the Backwall fill option.
+ chart.BackWall.Fill.FillType = OfficeFillType.Gradient
+ 'Set the Texture Type.
+ chart.BackWall.Fill.GradientColorType = OfficeGradientColor.TwoColor
+ chart.BackWall.Fill.GradientStyle = OfficeGradientStyle.Diagonl_Down
+ chart.BackWall.Fill.ForeColor = Color.WhiteSmoke
+ chart.BackWall.Fill.BackColor = Color.LightBlue
+ 'Set the Border Linecolor.
+ chart.BackWall.Border.LineColor = System.Drawing.Color.Wheat
+ 'Set the Picture Type.
+ chart.BackWall.PictureUnit = OfficeChartPictureType.stretch
+ 'Set the Backwall thickness.
+ chart.BackWall.Thickness = 10
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add section to the document
+ IWSection sec = document.AddSection();
+ //Add paragraph to the section
+ IWParagraph paragraph = sec.AddParagraph();
+ //Load the excel file as stream
+ Stream excelStream = File.OpenRead("Excel_Template.xlsx");
+ //Create and Append chart to the paragraph with excel stream as parameter
+ WChart chart = paragraph.AppendChart(excelStream, 1, "B2:C6", 470, 300);
+ //Set chart type and title
+ chart.ChartType = OfficeChartType.Column_Clustered;
+ chart.ChartTitle = "Purchase Details";
+ chart.ChartTitleArea.FontName = "Calibri";
+ chart.ChartTitleArea.Size = 14;
+ chart.ChartArea.Border.LinePattern = OfficeChartLinePattern.None;
+ //Set name to chart series
+ chart.Series[0].Name = "Sum of Purchases";
+ chart.Series[1].Name = "Sum of Future Expenses";
+ //Display data table
+ chart.HasDataTable = true;
+ chart.PrimaryCategoryAxis.Title = "Products";
+ chart.PrimaryValueAxis.Title = "In Dollars";
+ //Set position of legend
+ chart.Legend.Position = OfficeLegendPosition.Bottom;
+ //Save the document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add section to the document
+ Dim sec As IWSection = document.AddSection()
+ 'Add paragraph to the section
+ Dim paragraph As IWParagraph = sec.AddParagraph()
+ 'Load the excel file as stream
+ Dim excelStream As Stream = File.OpenRead("Excel_Template.xlsx")
+ 'Create and Append chart to the paragraph with excel stream as parameter
+ Dim chart As WChart = paragraph.AppendChart(excelStream, 1, "B2:C6", 470, 300)
+ 'Set chart type and title
+ chart.ChartType = OfficeChartType.Column_Clustered
+ chart.ChartTitle = "Purchase Details"
+ chart.ChartTitleArea.FontName = "Calibri"
+ chart.ChartTitleArea.Size = 14
+ chart.ChartArea.Border.LinePattern = OfficeChartLinePattern.None
+ 'Set name to chart series
+ chart.Series(0).Name = "Sum of Purchases"
+ chart.Series(1).Name = "Sum of Future Expenses"
+ chart.PrimaryCategoryAxis.Title = "Products"
+ chart.PrimaryValueAxis.Title = "In Dollars"
+ 'Set position of legend
+ chart.Legend.Position = OfficeLegendPosition.Bottom
+ 'Display data table
+ chart.HasDataTable = True
+ 'Save the document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load the template document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ WParagraph paragraph = document.LastParagraph;
+ //Get the chart entity
+ WChart chart = paragraph.ChildEntities[0] as WChart;
+ //Set the legend position
+ chart.Legend.Position = OfficeLegendPosition.Left;
+ //Set the layout inclusion
+ chart.Legend.IncludeInLayout = true;
+ //Set the legend border format - color, pattern, weight
+ chart.Legend.FrameFormat.Border.AutoFormat = false;
+ chart.Legend.FrameFormat.Border.IsAutoLineColor = false;
+ chart.Legend.FrameFormat.Border.LineColor = Color.Blue;
+ chart.Legend.FrameFormat.Border.LinePattern = OfficeChartLinePattern.DashDot;
+ chart.Legend.FrameFormat.Border.LineWeight = OfficeChartLineWeight.Wide;
+ //Set the legend's text area formatting - font name, weight, color, size
+ chart.Legend.TextArea.Bold = true;
+ chart.Legend.TextArea.Color = OfficeKnownColors.Bright_green;
+ chart.Legend.TextArea.FontName = "Times New Roman";
+ chart.Legend.TextArea.Size = 20;
+ chart.Legend.TextArea.Strikethrough = true;
+ //Modify the legend entry
+ chart.Legend.LegendEntries[0].IsDeleted = true;
+ //Modify the legend layout - height, left, top, width
+ chart.Legend.Layout.Height = 50;
+ chart.Legend.Layout.HeightMode = LayoutModes.factor;
+ chart.Legend.Layout.Left = 10;
+ chart.Legend.Layout.LeftMode = LayoutModes.factor;
+ chart.Legend.Layout.Top = 30;
+ chart.Legend.Layout.TopMode = LayoutModes.factor;
+ chart.Legend.Layout.Width = 100;
+ chart.Legend.Layout.WidthMode = LayoutModes.factor;
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load the template document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ Dim paragraph As WParagraph = document.LastParagraph
+ 'Get the chart entity
+ Dim chart As WChart = TryCast(paragraph.ChildEntities(0), WChart)
+ 'Set the legend position
+ chart.Legend.Position = OfficeLegendPosition.Left
+ 'Set the layout inclusion
+ chart.Legend.IncludeInLayout = True
+ 'Set the legend border format - color, pattern, weight
+ chart.Legend.FrameFormat.Border.AutoFormat = False
+ chart.Legend.FrameFormat.Border.IsAutoLineColor = False
+ chart.Legend.FrameFormat.Border.LineColor = Color.Blue
+ chart.Legend.FrameFormat.Border.LinePattern = OfficeChartLinePattern.DashDot
+ chart.Legend.FrameFormat.Border.LineWeight = OfficeChartLineWeight.Wide
+ 'Set the legend's text area formatting - font name, weight, color, size
+ chart.Legend.TextArea.Bold = True
+ chart.Legend.TextArea.Color = OfficeKnownColors.Bright_green
+ chart.Legend.TextArea.FontName = "Times New Roman"
+ chart.Legend.TextArea.Size = 20
+ chart.Legend.TextArea.Strikethrough = True
+ 'Modify the legend entry
+ chart.Legend.LegendEntries(0).IsDeleted = True
+ 'Modify the legend layout - height, left, top, width
+ chart.Legend.Layout.Height = 50
+ chart.Legend.Layout.HeightMode = LayoutModes.factor
+ chart.Legend.Layout.Left = 10
+ chart.Legend.Layout.LeftMode = LayoutModes.factor
+ chart.Legend.Layout.Top = 30
+ chart.Legend.Layout.TopMode = LayoutModes.factor
+ chart.Legend.Layout.Width = 100
+ chart.Legend.Layout.WidthMode = LayoutModes.factor
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add section to the document
+ IWSection sec = document.AddSection();
+ //Add paragraph to the section
+ IWParagraph paragraph = sec.AddParagraph();
+ //Load the excel file as stream
+ Stream excelStream = File.OpenRead("Excel_Template.xlsx");
+ //Create and Append chart to the paragraph with excel stream as parameter
+ WChart chart = paragraph.AppendChart(excelStream, 1, "B2:C6", 470, 300);
+ //Set chart type and title
+ chart.ChartType = OfficeChartType.Column_Clustered_3D;
+ chart.ChartTitle = "Purchase Details";
+ chart.ChartTitleArea.FontName = "Calibri";
+ chart.ChartTitleArea.Size = 14;
+ chart.ChartArea.Border.LinePattern = OfficeChartLinePattern.None;
+ //Set name to chart series
+ chart.Series[0].Name = "Sum of Purchases";
+ chart.Series[1].Name = "Sum of Future Expenses";
+ chart.PrimaryCategoryAxis.Title = "Products";
+ chart.PrimaryValueAxis.Title = "In Dollars";
+ //Set position of legend
+ chart.Legend.Position = OfficeLegendPosition.Bottom;
+ //Set roatation and elevation values
+ chart.Rotation = 20;
+ chart.Elevation = 15;
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add section to the document
+ Dim sec As IWSection = document.AddSection()
+ 'Add paragraph to the section
+ Dim paragraph As IWParagraph = sec.AddParagraph()
+ 'Load the excel file as stream
+ Dim excelStream As Stream = File.OpenRead("Excel_Template.xlsx")
+ 'Create and Append chart to the paragraph with excel stream as parameter
+ Dim chart As WChart = paragraph.AppendChart(excelStream, 1, "B2:C6", 470, 300)
+ 'Set chart type and title
+ chart.ChartType = OfficeChartType.Column_Clustered_3D
+ chart.ChartTitle = "Purchase Details"
+ chart.ChartTitleArea.FontName = "Calibri"
+ chart.ChartTitleArea.Size = 14
+ chart.ChartArea.Border.LinePattern = OfficeChartLinePattern.None
+ 'Set name to chart series
+ chart.Series(0).Name = "Sum of Purchases"
+ chart.Series(1).Name = "Sum of Future Expenses"
+ chart.PrimaryCategoryAxis.Title = "Products"
+ chart.PrimaryValueAxis.Title = "In Dollars"
+ 'Set position of legend
+ chart.Legend.Position = OfficeLegendPosition.Bottom
+ 'Set rotation and elevation values
+ chart.Rotation = 20
+ chart.Elevation = 15
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ Get the Ancestor comment
+ WComment ancestorComment = document.Comments[1].Ancestor;
+ Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+
+
+ 'Load an existing Word document into DocIO instance
+ Dim document As WordDocument = New WordDocument("Template.docx")
+ 'Get the Ancestor comment
+ Dim ancestorComment As WComment = document.Comments(1).Ancestor
+ 'Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ // Load an existing Word document into DocIO instance
+ using (WordDocument document = new WordDocument("Template.docx"))
+ {
+ // Checks whether the comment is resolved or not
+ bool done = document.Comments[0].Done;
+ // Saves the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ }
+
+
+ 'Load an existing Word document into DocIO instance
+ Dim document As WordDocument = New WordDocument("Template.docx")
+ 'Checks whether the comment is resolved or not
+ Dim done As Boolean = document.Comments(0).Done
+ 'Save and Close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ WordDocument document = new WordDocument();
+ IWSection section = document.AddSection();
+ IWParagraph paragraph = section.AddParagraph();
+ paragraph.AppendText("If field which uses string of characters in expression");
+ paragraph = section.AddParagraph();
+ //Create the new instance of IF field
+ WIfField field = paragraph.AppendField("If", FieldType.FieldIf) as WIfField;
+ //Specify the expression, true and false statement in field code
+ field.FieldCode = "IF \"True\" = \"True\" \"The given statement is Correct\" \"The given statement is Wrong\"";
+ paragraph = section.AddParagraph();
+ paragraph.AppendText("If field which uses numbers in expression");
+ paragraph = section.AddParagraph();
+ //Create the new instance of IF field
+ field = paragraph.AppendField("If", FieldType.FieldIf) as WIfField;
+ //Specify the expression, true and false statement in field code
+ field.FieldCode = "IF 100 >= 1000 \"The given statement is Correct\" \"The given statement is Wrong\"";
+ //Update the document fields
+ document.UpdateDocumentFields();
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ Dim document As New WordDocument()
+ Dim section As IWSection = document.AddSection()
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ paragraph.AppendText("If field which uses string of characters in expression")
+ paragraph = section.AddParagraph()
+ 'Create the new instance of IF field
+ Dim field As WIfField = TryCast(paragraph.AppendField("If", FieldType.FieldIf), WIfField)
+ 'Specify the expression, true and false statement in field code
+ field.FieldCode = "IF ""True"" = ""True"" ""The given statement is Correct"" ""The given statement is Wrong"""
+ paragraph = section.AddParagraph()
+ paragraph.AppendText("If field which uses numbers in expression")
+ paragraph = section.AddParagraph()
+ 'Create the new instance of IF field
+ field = TryCast(paragraph.AppendField("If", FieldType.FieldIf), WIfField)
+ 'Specify the expression, true and false statement in field code
+ field.FieldCode = "IF 100 >= 1000 ""The given statement is Correct"" ""The given statement is Wrong"""
+ 'Update the document fields
+ document.UpdateDocumentFields()
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ paragraph.AppendText("This paragraph has picture. ");
+ //Append new picture to the paragraph
+ IWPicture picture = paragraph.AppendPicture(Image.FromFile("Image.png"));
+ //Set width and height for the paragraph
+ picture.Width = 150;
+ picture.Height = 100;
+ //Set text wrapping style – When the wrapping style is inline the images will not be absolutely positioned. It will be added next to the textrange.
+ picture.TextWrappingStyle = TextWrappingStyle.Square;
+ picture.TextWrappingType = TextWrappingType.Largest;
+ //Set horizontal and vertical origin
+ picture.HorizontalOrigin = HorizontalOrigin.Page;
+ picture.VerticalOrigin = VerticalOrigin.Paragraph;
+ //Set horizontal and vertical position for the picture
+ picture.HorizontalPosition = 200;
+ picture.VerticalPosition = 150;
+ //Set horizontal and vertical alignments
+ picture.HorizontalAlignment = ShapeHorizontalAlignment.Center;
+ picture.VerticalAlignment = ShapeVerticalAlignment.Bottom;
+ //Set name, title, alternate text.
+ picture.Title = "PictureTitle";
+ picture.Name = "PictureName";
+ picture.IsBelowText = true;
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ paragraph.AppendText("This paragraph has picture. ")
+ 'Append new picture to the paragraph
+ Dim picture As IWPicture = paragraph.AppendPicture(Image.FromFile("Image.png"))
+ 'Set width and height for the paragraph
+ picture.Width = 150
+ picture.Height = 100
+ 'Set text wrapping style – When the wrapping style is inline the images will not be absolutely positioned. It will be added next to the textrange.
+ picture.TextWrappingStyle = TextWrappingStyle.Square
+ picture.TextWrappingType = TextWrappingType.Largest
+ 'Set horizontal and vertical origin
+ picture.HorizontalOrigin = HorizontalOrigin.Page
+ picture.VerticalOrigin = VerticalOrigin.Paragraph
+ 'Set horizontal and vertical position for the picture
+ picture.HorizontalPosition = 200
+ picture.VerticalPosition = 150
+ 'Set horizontal and vertical alignments
+ picture.HorizontalAlignment = ShapeHorizontalAlignment.Center
+ picture.VerticalAlignment = ShapeVerticalAlignment.Bottom
+ 'Set name, title, alternate text.
+ picture.Title = "PictureTitle"
+ picture.Name = "PictureName"
+ picture.IsBelowText = True
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Get the image and convert to byte array
+ Image image = Image.FromFile("Image.png");
+ MemoryStream imageStream = new MemoryStream();
+ image.Save(imageStream, System.Drawing.Imaging.ImageFormat.Png);
+ byte[] imageBytes = imageStream.ToArray();
+ //Initialize new picture
+ WPicture picture = new WPicture(document);
+ //Load image from the byte array
+ picture.LoadImage(imageBytes);
+ //Set width and height
+ picture.Height = 100;
+ picture.Width = 150;
+ //Add picture to the paragraph
+ paragraph.Items.Add(picture);
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Get the image and convert to byte array
+ Dim image__1 As Image = Image.FromFile("Image.png")
+ Dim imageStream As New MemoryStream()
+ image__1.Save(imageStream, System.Drawing.Imaging.ImageFormat.Png)
+ Dim imageBytes As Byte() = imageStream.ToArray()
+ 'Initialize new picture
+ Dim picture As New WPicture(document)
+ 'Load image from the byte array
+ picture.LoadImage(imageBytes)
+ 'Set width and height
+ picture.Height = 100
+ picture.Width = 150
+ 'Add picture to the paragraph
+ paragraph.Items.Add(picture)
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Get the SVG image as byte array.
+ byte[] imageBytes = File.ReadAllBytes("Image.png");
+ //Get the SVG image as byte array.
+ byte[] svgData = File.ReadAllBytes("Image.svg");
+ //Initialize new picture
+ WPicture picture = new WPicture(document);
+ //Load both fallback and SVG image from the byte array
+ picture.LoadImage(svgData, imageBytes);
+ //Set width and height
+ picture.Height = 100;
+ picture.Width = 150;
+ //Add picture to the paragraph
+ paragraph.Items.Add(picture);
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Get the image byte array
+ Dim imageBytes As Byte() = File.ReadAllBytes("Image.png")
+ 'Get the SVG image as byte array.
+ Dim svgData As Byte() = File.ReadAllBytes("Image.svg")
+ 'Initialize new picture
+ Dim picture As New WPicture(document)
+ 'Load both fallback and SVG image from the byte array
+ picture.LoadImage(svgData, imageBytes)
+ 'Set width and height
+ picture.Height = 100
+ picture.Width = 150
+ 'Add picture to the paragraph
+ paragraph.Items.Add(picture)
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Initialize new picture
+ WPicture picture = new WPicture(document);
+ //Load image from the file
+ picture.LoadImage(Image.FromFile("Image.png"));
+ //Set width and height
+ picture.Height = 100;
+ picture.Width = 150;
+ //Add picture to the paragraph
+ paragraph.Items.Add(picture);
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Initialize new picture
+ Dim picture As New WPicture(document)
+ 'Load image from the file
+ picture.LoadImage(Image.FromFile("Image.png"))
+ 'Set width and height
+ picture.Height = 100
+ picture.Width = 150
+ 'Add picture to the paragraph
+ paragraph.Items.Add(picture)
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ paragraph.AppendText("This paragraph has picture. ");
+ //Append new picture to the paragraph
+ IWPicture picture = paragraph.AppendPicture(Image.FromFile("Image.png"));
+ //Set width and height for the paragraph
+ picture.Width = 150;
+ picture.Height = 100;
+ //Set caption for picture
+ picture.AddCaption("Figure 1.1", CaptionNumberingFormat.Number, CaptionPosition.AboveImage);
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ paragraph.AppendText("This paragraph has picture. ")
+ 'Append new picture to the paragraph
+ Dim picture As IWPicture = paragraph.AppendPicture(Image.FromFile("Image.png"))
+ 'Set width and height for the paragraph
+ picture.Width = 150
+ picture.Height = 100
+ 'Set caption for picture
+ picture.AddCaption("Figure 1.1", CaptionNumberingFormat.Number, CaptionPosition.AboveImage)
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ //Creates a new Word document
+ WordDocument document = new WordDocument();
+ //Adds new section to the document
+ IWSection section = document.AddSection();
+ //Adds new text to the paragraph
+ IWParagraph paragraph = section.AddParagraph();
+ //Gets the image and convert to byte array
+ Image image = Image.FromFile("Image.png");
+ MemoryStream imageStream = new MemoryStream();
+ image.Save(imageStream, System.Drawing.Imaging.ImageFormat.Png);
+ byte[] imageBytes = imageStream.ToArray();
+ //Initializes new picture
+ WPicture picture = new WPicture(document);
+ //Loads an image from the byte array
+ picture.LoadImage(imageBytes);
+ //Sets height and width for the image
+ picture.Height = 100;
+ picture.Width = 150;
+ //Sets picture rotation in degree
+ picture.Rotation = 90;
+ //Adds image to the paragraph
+ paragraph.Items.Add(picture);
+ //Saves the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Closes the document
+ document.Close();
+
+
+ 'Creates a New Word document
+ Dim document As WordDocument = New WordDocument
+ 'Adds new section to the document
+ Dim section As IWSection = document.AddSection
+ 'Adds new text to the paragraph
+ Dim paragraph As IWParagraph = section.AddParagraph
+ 'Gets the image and convert to byte array
+ Dim image As Image = Image.FromFile("Image.png")
+ Dim imageStream As MemoryStream = New MemoryStream
+ image.Save(imageStream, System.Drawing.Imaging.ImageFormat.Png)
+ Dim imageBytes() As Byte = imageStream.ToArray
+ 'Initializes new picture
+ Dim picture As WPicture = New WPicture(document)
+ 'Loads an image from the byte array
+ picture.LoadImage(imageBytes)
+ 'Sets height and width for the image
+ picture.Height = 100
+ picture.Width = 150
+ 'Sets picture rotation in degree
+ picture.Rotation = 90
+ 'Adds image to the paragraph
+ paragraph.Items.Add(picture)
+ 'Saves the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Closes the document
+ document.Close()
+
+
+ //Creates a new Word document
+ WordDocument document = new WordDocument();
+ //Adds new section to the document
+ IWSection section = document.AddSection();
+ //Adds new text to the paragraph
+ IWParagraph paragraph = section.AddParagraph();
+ //Gets the image and convert to byte array
+ Image image = Image.FromFile("Image.png");
+ MemoryStream imageStream = new MemoryStream();
+ image.Save(imageStream, System.Drawing.Imaging.ImageFormat.Png);
+ byte[] imageBytes = imageStream.ToArray();
+ //Initializes new picture
+ WPicture picture = new WPicture(document);
+ //Loads an image from the byte array
+ picture.LoadImage(imageBytes);
+ //Sets height and width for the image
+ picture.Height = 100;
+ picture.Width = 150;
+ //Sets horizontal flip to the picture
+ picture.FlipHorizontal = true;
+ //Adds image to the paragraph
+ paragraph.Items.Add(picture);
+ //Saves the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Closes the document
+ document.Close();
+
+
+ 'Creates a New Word document
+ Dim document As WordDocument = New WordDocument
+ 'Adds new section to the document
+ Dim section As IWSection = document.AddSection
+ 'Adds new text to the paragraph
+ Dim paragraph As IWParagraph = section.AddParagraph
+ 'Gets the image and convert to byte array
+ Dim image As Image = Image.FromFile("Image.png")
+ Dim imageStream As MemoryStream = New MemoryStream
+ image.Save(imageStream, System.Drawing.Imaging.ImageFormat.Png)
+ Dim imageBytes() As Byte = imageStream.ToArray
+ 'Initializes new picture
+ Dim picture As WPicture = New WPicture(document)
+ 'Loads an image from the byte array
+ picture.LoadImage(imageBytes)
+ 'Sets height and width for the image
+ picture.Height = 100
+ picture.Width = 150
+ 'Sets horizontal flip to the picture
+ picture.FlipHorizontal = True
+ 'Adds image to the paragraph
+ paragraph.Items.Add(picture)
+ 'Saves the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Closes the document
+ document.Close()
+
+
+ //Creates a new Word document
+ WordDocument document = new WordDocument();
+ //Adds new section to the document
+ IWSection section = document.AddSection();
+ //Adds new text to the paragraph
+ IWParagraph paragraph = section.AddParagraph();
+ //Gets the image and convert to byte array
+ Image image = Image.FromFile("Image.png");
+ MemoryStream imageStream = new MemoryStream();
+ image.Save(imageStream, System.Drawing.Imaging.ImageFormat.Png);
+ byte[] imageBytes = imageStream.ToArray();
+ //Initializes new picture
+ WPicture picture = new WPicture(document);
+ //Loads an image from the byte array
+ picture.LoadImage(imageBytes);
+ //Sets height and width for the image
+ picture.Height = 100;
+ picture.Width = 150;
+ //Sets vertical flip to the picture
+ picture.FlipVertical = true;
+ //Adds image to the paragraph
+ paragraph.Items.Add(picture);
+ //Saves the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Closes the document
+ document.Close();
+
+
+ 'Creates a New Word document
+ Dim document As WordDocument = New WordDocument
+ 'Adds new section to the document
+ Dim section As IWSection = document.AddSection
+ 'Adds new text to the paragraph
+ Dim paragraph As IWParagraph = section.AddParagraph
+ 'Gets the image and convert to byte array
+ Dim image As Image = Image.FromFile("Image.png")
+ Dim imageStream As MemoryStream = New MemoryStream
+ image.Save(imageStream, System.Drawing.Imaging.ImageFormat.Png)
+ Dim imageBytes() As Byte = imageStream.ToArray
+ 'Initializes new picture
+ Dim picture As WPicture = New WPicture(document)
+ 'Loads an image from the byte array
+ picture.LoadImage(imageBytes)
+ 'Sets height and width for the image
+ picture.Height = 100
+ picture.Width = 150
+ 'Sets vertical flip to the picture
+ picture.FlipVertical = True
+ 'Adds image to the paragraph
+ paragraph.Items.Add(picture)
+ 'Saves the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Closes the document
+ document.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument("Bookmarks.docx");
+ //Add new paragraph to the section
+ WParagraph paragraph = document.Sections[0].AddParagraph() as WParagraph;
+ //Append sequence field to the paragraph
+ WSeqField field = (WSeqField)paragraph.AppendField("Sequence field", FieldType.FieldSequence);
+ //Set the bookmark name as caption and number format
+ field.CaptionName = "Northwind";
+ field.NumberFormat = CaptionNumberingFormat.Roman;
+ //Save and close the document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument("Bookmarks.docx")
+ 'Add new paragraph to the section
+ Dim paragraph As WParagraph = TryCast(document.Sections(0).AddParagraph(), WParagraph)
+ 'Append sequence field to the paragraph
+ Dim field As WSeqField = DirectCast(paragraph.AppendField("Sequence field", FieldType.FieldSequence), WSeqField)
+ 'Set the bookmark name as caption and number format
+ field.CaptionName = "Northwind"
+ field.NumberFormat = CaptionNumberingFormat.Roman
+ 'Save and close the document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ //Load an existing Word document into DocIO instance.
+ WordDocument document = new WordDocument("Template.docx");
+ //Add new paragraph to the section
+ WParagraph paragraph = document.Sections[0].AddParagraph() as WParagraph;
+ //Append sequence field to the paragraph
+ WSeqField field = (WSeqField)paragraph.AppendField("Sequence field", FieldType.FieldSequence);
+ //Set the NumberFormat of the SeqField.
+ field.NumberFormat = CaptionNumberingFormat.Number;
+ //Updates the document fields
+ document.UpdateDocumentFields();
+ //Save and Close the Word document.
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+
+
+ 'Load an existing Word document into DocIO instance.
+ Dim document As WordDocument = New WordDocument("Template.docx")
+ 'Add new paragraph to the section
+ Dim paragraph As WParagraph = TryCast(document.Sections(0).AddParagraph(), WParagraph)
+ 'Append sequence field to the paragraph
+ Dim field As WSeqField = CType(paragraph.AppendField("Sequence field", FieldType.FieldSequence), WSeqField)
+ 'Set the NumberFormat of the SeqField.
+ field.NumberFormat = CaptionNumberingFormat.Number
+ 'Updates the document fields
+ document.UpdateDocumentFields()
+ 'Save and Close the Word document.
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ //Load an existing Word document into DocIO instance.
+ WordDocument document = new WordDocument("Template.docx");
+ //Add new paragraph to the section
+ WParagraph paragraph = document.Sections[0].AddParagraph() as WParagraph;
+ //Append sequence field to the paragraph
+ WSeqField field = (WSeqField)paragraph.AppendField("Sequence field", FieldType.FieldSequence);
+ //Set the CaptionName of the SeqField.
+ field.CaptionName = "Test";
+ //Updates the document fields
+ document.UpdateDocumentFields();
+ //Save and Close the Word document.
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+
+
+ 'Load an existing Word document into DocIO instance.
+ Dim document As WordDocument = New WordDocument("Template.docx")
+ 'Add new paragraph to the section
+ Dim paragraph As WParagraph = TryCast(document.Sections(0).AddParagraph(), WParagraph)
+ 'Append sequence field to the paragraph
+ Dim field As WSeqField = CType(paragraph.AppendField("Sequence field", FieldType.FieldSequence), WSeqField)
+ 'Set the CaptionName of the SeqField.
+ field.CaptionName = "Test";
+ //Updates the document fields
+ document.UpdateDocumentFields()
+ 'Save and Close the Word document.
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ //Load an existing Word document into DocIO instance.
+ WordDocument document = new WordDocument("Template.docx");
+ //Add new paragraph to the section
+ WParagraph paragraph = document.Sections[0].AddParagraph() as WParagraph;
+ //Append sequence field to the paragraph
+ WSeqField field = (WSeqField)paragraph.AppendField("Sequence field", FieldType.FieldSequence);
+ //Set the BookmarkName of the SeqField.
+ field.BookmarkName = "Bookmark1";
+ //Updates the document fields
+ document.UpdateDocumentFields();
+ //Save and Close the Word document.
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+
+
+ 'Load an existing Word document into DocIO instance.
+ Dim document As WordDocument = New WordDocument("Template.docx")
+ 'Add new paragraph to the section
+ Dim paragraph As WParagraph = TryCast(document.Sections(0).AddParagraph(), WParagraph)
+ 'Append sequence field to the paragraph
+ Dim field As WSeqField = CType(paragraph.AppendField("Sequence field", FieldType.FieldSequence), WSeqField)
+ 'Set the BookmarkName of the SeqField.
+ field.BookmarkName = "Bookmark1"
+ 'Updates the document fields
+ document.UpdateDocumentFields()
+ 'Save and Close the Word document.
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ //Load an existing Word document into DocIO instance.
+ WordDocument document = new WordDocument("Template.docx");
+ //Add new paragraph to the section
+ WParagraph paragraph = document.Sections[0].AddParagraph() as WParagraph;
+ //Append sequence field to the paragraph
+ WSeqField field = (WSeqField)paragraph.AppendField("Sequence field", FieldType.FieldSequence);
+ //Set the InsertNextNumber of the SeqField.
+ field.InsertNextNumber = true;
+ //Updates the document fields
+ document.UpdateDocumentFields();
+ //Save and Close the Word document.
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+
+
+ Load an existing Word document into DocIO instance.
+ Dim document As WordDocument = New WordDocument("Template.docx")
+ 'Add new paragraph to the section
+ Dim paragraph As WParagraph = TryCast(document.Sections(0).AddParagraph(), WParagraph)
+ 'Append sequence field to the paragraph
+ Dim field As WSeqField = CType(paragraph.AppendField("Sequence field", FieldType.FieldSequence), WSeqField)
+ 'Set the InsertNextNumber of the SeqField.
+ field.InsertNextNumber = True
+ 'Updates the document fields
+ document.UpdateDocumentFields()
+ 'Save and Close the Word document.
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ //Load an existing Word document into DocIO instance.
+ WordDocument document = new WordDocument("Template.docx");
+ //Add new paragraph to the section
+ WParagraph paragraph = document.Sections[0].AddParagraph() as WParagraph;
+ //Append sequence field to the paragraph
+ WSeqField field = (WSeqField)paragraph.AppendField("Sequence field", FieldType.FieldSequence);
+ //Set the RepeatNearestNumber of the SeqField.
+ field.RepeatNearestNumber = true;
+ //Updates the document fields
+ document.UpdateDocumentFields();
+ //Save and Close the Word document.
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+
+
+ 'Load an existing Word document into DocIO instance.
+ Dim document As WordDocument = New WordDocument("Template.docx")
+ 'Add new paragraph to the section
+ Dim paragraph As WParagraph = TryCast(document.Sections(0).AddParagraph(), WParagraph)
+ 'Append sequence field to the paragraph
+ Dim field As WSeqField = CType(paragraph.AppendField("Sequence field", FieldType.FieldSequence), WSeqField)
+ 'Set the RepeatNearestNumber of the SeqField.
+ field.RepeatNearestNumber = True
+ 'Updates the document fields
+ document.UpdateDocumentFields()
+ 'Save and Close the Word document.
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ //Load an existing Word document into DocIO instance.
+ WordDocument document = new WordDocument("Template.docx");
+ //Add new paragraph to the section
+ WParagraph paragraph = document.Sections[0].AddParagraph() as WParagraph;
+ //Append sequence field to the paragraph
+ WSeqField field = (WSeqField)paragraph.AppendField("Sequence field", FieldType.FieldSequence);
+ //Set the HideResult of the SeqField.
+ field.HideResult = true;
+ //Updates the document fields
+ document.UpdateDocumentFields();
+ //Save and Close the Word document.
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+
+
+ Load an existing Word document into DocIO instance.
+ Dim document As WordDocument = New WordDocument("Template.docx")
+ //Add new paragraph to the section
+ Dim paragraph As WParagraph = TryCast(document.Sections(0).AddParagraph(), WParagraph)
+ //Append sequence field to the paragraph
+ Dim field As WSeqField = CType(paragraph.AppendField("Sequence field", FieldType.FieldSequence), WSeqField)
+ //Set the HideResult of the SeqField.
+ field.HideResult = True
+ //Updates the document fields
+ document.UpdateDocumentFields()
+ //Save and Close the Word document.
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ //Load an existing Word document into DocIO instance.
+ WordDocument document = new WordDocument("Template.docx");
+ //Add new paragraph to the section
+ WParagraph paragraph = document.Sections[0].AddParagraph() as WParagraph;
+ //Append sequence field to the paragraph
+ WSeqField field = (WSeqField)paragraph.AppendField("Sequence field", FieldType.FieldSequence);
+ //Set the ResetNumber of the SeqField.
+ field.ResetNumber = 7;
+ //Updates the document fields
+ document.UpdateDocumentFields();
+ //Save and Close the Word document.
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+
+
+ Load an existing Word document into DocIO instance.
+ Dim document As WordDocument = New WordDocument("Template.docx")
+ //Add new paragraph to the section
+ Dim paragraph As WParagraph = TryCast(document.Sections(0).AddParagraph(), WParagraph)
+ //Append sequence field to the paragraph
+ Dim field As WSeqField = CType(paragraph.AppendField("Sequence field", FieldType.FieldSequence), WSeqField)
+ //Set the ResetNumber of the SeqField.
+ field.ResetNumber = 7
+ //Updates the document fields
+ document.UpdateDocumentFields()
+ //Save and Close the Word document.
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ //Load an existing Word document into DocIO instance.
+ WordDocument document = new WordDocument("Template.docx");
+ //Add new paragraph to the section
+ WParagraph paragraph = document.Sections[0].AddParagraph() as WParagraph;
+ //Append sequence field to the paragraph
+ WSeqField field = (WSeqField)paragraph.AppendField("Sequence field", FieldType.FieldSequence);
+ //Set the ResetHeadingLevel of the SeqField.
+ field.ResetHeadingLevel = 1;
+ //Updates the document fields
+ document.UpdateDocumentFields();
+ //Save and Close the Word document.
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+
+
+ Load an existing Word document into DocIO instance.
+ Dim document As WordDocument = New WordDocument("Template.docx")
+ //Add new paragraph to the section
+ Dim paragraph As WParagraph = TryCast(document.Sections(0).AddParagraph(), WParagraph)
+ //Append sequence field to the paragraph
+ Dim field As WSeqField = CType(paragraph.AppendField("Sequence field", FieldType.FieldSequence), WSeqField)
+ //Set the ResetHeadingLevel of the SeqField.
+ field.ResetHeadingLevel = 1;
+ //Updates the document fields
+ document.UpdateDocumentFields()
+ //Save and Close the Word document.
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ paragraph.AppendText("Example of adding symbols to the paragraph: ");
+ //Insert symbol with character code 100
+ WSymbol symbol = paragraph.AppendSymbol(100);
+ symbol.FontName = "Windings";
+ //Save and close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ paragraph.AppendText("Example of adding symbols to the paragraph: ")
+ 'Insert symbol with character code 100
+ Dim symbol As WSymbol = paragraph.AppendSymbol(100)
+ symbol.FontName = "Windings"
+ 'Save and close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Append new textbox to the paragraph
+ IWTextBox textbox = paragraph.AppendTextBox(150, 75);
+ //Add new text to the textbox body
+ IWParagraph textboxParagraph = textbox.TextBoxBody.AddParagraph();
+ textboxParagraph.AppendText("Text inside text box");
+ textboxParagraph = textbox.TextBoxBody.AddParagraph();
+ //Add new picture to textbox body
+ IWPicture picture = textboxParagraph.AppendPicture(Image.FromFile(@"Image.png"));
+ picture.Height = 75;
+ picture.Width = 50;
+ //Save and close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Append new textbox to the paragraph
+ Dim textbox As IWTextBox = paragraph.AppendTextBox(150, 75)
+ 'Add new text to the textbox body
+ Dim textboxParagraph As IWParagraph = textbox.TextBoxBody.AddParagraph()
+ textboxParagraph.AppendText("Text inside text box")
+ textboxParagraph = textbox.TextBoxBody.AddParagraph()
+ 'Add new picture to textbox body
+ Dim picture As IWPicture = textboxParagraph.AppendPicture(Image.FromFile("Image.png"))
+ picture.Height = 75
+ picture.Width = 50
+ 'Save and close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ WParagraph paragraph = section.AddParagraph() as WParagraph;
+ paragraph.AppendText("General Information");
+ section.AddParagraph();
+ paragraph = section.AddParagraph() as WParagraph;
+ IWTextRange text = paragraph.AppendText("Name\t");
+ text.CharacterFormat.Bold = true;
+ //Append Text form field
+ WTextFormField textfield = paragraph.AppendTextFormField(null);
+ //Set type of Text form field
+ textfield.Type = TextFormFieldType.RegularText;
+ textfield.CharacterFormat.FontName = "Calibri";
+ textfield.CalculateOnExit = true;
+ section.AddParagraph();
+ paragraph = section.AddParagraph() as WParagraph;
+ text = paragraph.AppendText("Date of Birth\t");
+ text.CharacterFormat.Bold = true;
+ //Append Text form field
+ textfield = paragraph.AppendTextFormField("Date field", DateTime.Now.ToString("MM/DD/YY"));
+ textfield.StringFormat = "MM/DD/YY";
+ //Set Text form field type
+ textfield.Type = TextFormFieldType.DateText;
+ textfield.CalculateOnExit = true;
+ //Save the Word document
+ document.Save("Textfield.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As WParagraph = TryCast(section.AddParagraph(), WParagraph)
+ paragraph.AppendText("General Information")
+ section.AddParagraph()
+ paragraph = TryCast(section.AddParagraph(), WParagraph)
+ Dim text As IWTextRange = paragraph.AppendText("Name" & vbTab)
+ text.CharacterFormat.Bold = True
+ 'Append Text form field
+ Dim textfield As WTextFormField = paragraph.AppendTextFormField(Nothing)
+ 'Set type of Text form field
+ textfield.Type = TextFormFieldType.RegularText
+ textfield.CharacterFormat.FontName = "Calibri"
+ textfield.CalculateOnExit = True
+ section.AddParagraph()
+ paragraph = TryCast(section.AddParagraph(), WParagraph)
+ text = paragraph.AppendText("Date of Birth" & vbTab)
+ text.CharacterFormat.Bold = True
+ 'Append Text form field
+ textfield = paragraph.AppendTextFormField("Date field", DateTime.Now.ToString("MM/DD/YY"))
+ textfield.StringFormat = "MM/DD/YY"
+ 'Set Text form field type
+ textfield.Type = TextFormFieldType.DateText
+ textfield.CalculateOnExit = True
+ 'Save the Word document
+ document.Save("Textfield.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+ End Sub
+
+
+ //Load the template Word document.
+ WordDocument document = new WordDocument("Template.docx");
+ //Data source.
+ DataSet ds = new DataSet();
+ ds.Tables.Add();
+ //Define the columns
+ ds.Tables[0].TableName = "Employee";
+ ds.Tables[0].Columns.Add("NAME");
+ ds.Tables[0].Columns.Add("DESC");
+ //Set the values.
+ DataRow row;
+ row = ds.Tables["Employee"].NewRow();
+ row["NAME"] = "AAA";
+ row["DESC"] = null;
+ ds.Tables["Employee"].Rows.Add(row);
+ row = ds.Tables["Employee"].NewRow();
+ row["NAME"] = "BBB";
+ row["DESC"] = "";
+ ds.Tables["Employee"].Rows.Add(row);
+ row = ds.Tables["Employee"].NewRow();
+ row["NAME"] = "CCC";
+ row["DESC"] = "ccc";
+ ds.Tables["Employee"].Rows.Add(row);
+ //Enable a flag to start a new page for each group of records.
+ document.MailMerge.StartAtNewPage= true;
+ //Execute mail merge.
+ document.MailMerge.ExecuteGroup(ds.Tables["Employee"]);
+ //Save the Word document.
+ document.Save("Result.docx", FormatType.Docx);
+ //Close the Word document.
+ document.Close();
+
+
+ 'Load the template Word document.
+ Dim document As WordDocument = New WordDocument("Template.docx")
+ 'Data source.
+ Dim ds As DataSet = New DataSet
+ ds.Tables.Add
+ 'Define the columns.
+ ds.Tables(0).TableName = "Employee"
+ ds.Tables(0).Columns.Add("NAME")
+ ds.Tables(0).Columns.Add("DESC")
+ 'Set values.
+ Dim row As DataRow
+ row = ds.Tables("Employee").NewRow
+ row("NAME") = "AAA"
+ row("DESC") = Nothing
+ ds.Tables("Employee").Rows.Add(row)
+ row = ds.Tables("Employee").NewRow
+ row("NAME") = "BBB"
+ row("DESC") = ""
+ ds.Tables("Employee").Rows.Add(row)
+ row = ds.Tables("Employee").NewRow
+ row("NAME") = "CCC"
+ row("DESC") = "ccc"
+ ds.Tables("Employee").Rows.Add(row)
+ 'Enable a flag to start a new page for each group of records.
+ document.MailMerge.StartAtNewPage= true
+ 'Execute mail merge.
+ document.MailMerge.ExecuteGroup(ds.Tables("Employee"))
+ 'Save the Word document.
+ document.Save("Result.docx", FormatType.Docx)
+ 'Close the Word document.
+ document.Close
+
+
+ //Opens the template document.
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ //Set "InsertAsNew" as true to insert a new row for every group when group start and end present in the same table cell.
+ document.MailMerge.InsertAsNewRow = true;
+ //Performs the mail merge.
+ document.MailMerge.ExecuteGroup(DataTable);
+ //Saves and closes the WordDocument instance.
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+
+
+ 'Opens the template document.
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ 'Set "InsertAsNew" as true to insert a new row for every group when group start and end present in the same table cell.
+ document.MailMerge.InsertAsNewRow = True
+ 'Performs the mail merge.
+ document.MailMerge.ExecuteGroup(DataTable)
+ 'Saves and closes the WordDocument instance.
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ //Load an existing Word document into WordDocument instance.
+ WordDocument document = new WordDocument("Sample.docx", FormatType.Docx);
+ //Change the datasource property of the mail merge settings in the word document.
+ document.MailMerge.Settings.DataSource = "NewDataSource.txt";
+ //Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the WordDocument instance
+ document.Close();
+
+
+ 'Load an existing Word document into WordDocument instance
+ Dim document As New WordDocument("Sample.docx", FormatType.Docx)
+ 'Change the datasource property of the mail merge settings in the word document
+ document.MailMerge.Settings.DataSource = "NewDataSource.txt"
+ 'Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the WordDocument instance
+ document.Close()
+
+
+ //Load an existing Word document into WordDocument instance.
+ WordDocument document = new WordDocument("Sample.docx", FormatType.Docx);
+ //Removes the mail merge settings in the word document.
+ if (document.MailMerge.Settings.HasData)
+ document.MailMerge.Settings.RemoveData();
+ //Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the WordDocument instance
+ document.Close();
+
+
+ 'Load an existing Word document into WordDocument instance
+ Dim document As New WordDocument("Sample.docx", FormatType.Docx)
+ 'Removes the mail merge settings in the word document.
+ If document.MailMerge.Settings.HasData Then
+ document.MailMerge.Settings.RemoveData()
+ End If
+ 'Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the WordDocument instance
+ document.Close()
+
+
+ //Load an existing Word document into WordDocument instance.
+ WordDocument document = new WordDocument("Sample.docx", FormatType.Docx);
+ //Change the datasource property of the mail merge settings in the word document.
+ document.MailMerge.Settings.DataSource = "NewDataSource.txt";
+ //Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the WordDocument instance
+ document.Close();
+
+
+ 'Load an existing Word document into WordDocument instance
+ Dim document As New WordDocument("Sample.docx", FormatType.Docx)
+ 'Change the datasource property of the mail merge settings in the word document
+ document.MailMerge.Settings.DataSource = "NewDataSource.txt"
+ 'Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the WordDocument instance
+ document.Close()
+
+
+ //Load an existing Word document into WordDocument instance.
+ WordDocument document = new WordDocument("Sample.docx", FormatType.Docx);
+ //Removes the mail merge settings in the word document.
+ if (document.MailMerge.Settings.HasData)
+ document.MailMerge.Settings.RemoveData();
+ //Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the WordDocument instance
+ document.Close();
+
+
+ 'Load an existing Word document into WordDocument instance
+ Dim document As New WordDocument("Sample.docx", FormatType.Docx)
+ 'Removes the mail merge settings in the word document.
+ If document.MailMerge.Settings.HasData Then
+ document.MailMerge.Settings.RemoveData()
+ End If
+ 'Saves the specified document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the WordDocument instance
+ document.Close()
+
+
+ //Load an existing Word document into DocIO instance.
+ WordDocument document = new WordDocument("Template.docx");
+ //Get the revision from the revision collection and accepts.
+ document.Revisions[0].Accept();
+ //Save and Close the Word document.
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+
+
+ 'Load an existing Word document into DocIO instance.
+ Dim document As WordDocument = New WordDocument("Template.docx")
+ 'Get the revision from the revision collection and accepts.
+ document.Revisions(0).Accept()
+ 'Save and Close the Word document.
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ //Load an existing Word document into DocIO instance.
+ WordDocument document = new WordDocument("Template.docx");
+ //Get the revision from the revision collection and rejects.
+ document.Revisions[0].Reject();
+ //Save and Close the Word document.
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+
+
+ 'Load an existing Word document into DocIO instance.
+ Dim document As WordDocument = New WordDocument("Template.docx")
+ 'Get the revision from the revision collection and rejects.
+ document.Revisions(0).Reject()
+ 'Save and Close the Word document.
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ //Loads an existing Word document
+ WordDocument document = new WordDocument(@"Template.docx");
+ //If the author of current revision is same as expected author name, then accept it
+ if (document.Revisions[0].Author == "Syncfusion")
+ document.Revisions[0].Accept();
+ //Saves and closes the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+
+
+ 'Loads an existing Word document
+ Dim document As WordDocument = New WordDocument("Template.docx")
+ 'If the author of current revision is same as expected author name, then accept it
+ If document.Revisions(0).Author Is "Syncfusion" Then worddocument.Revisions(0).Accept()
+ 'Saves and closes the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ //Loads an existing Word document
+ WordDocument document = new WordDocument(@"Template.docx");
+ DateTime dateTime = DateTime.Parse("2020 - 05 - 28T20: 26:00");
+ //If the date of current revision same as expected date, then accepts it
+ if (document.Revisions[0].Date == dateTime)
+ document.Revisions[0].Accept();
+ //Saves and closes the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+
+
+ 'Loads an existing Word document
+ Dim document As WordDocument = New WordDocument("Template.docx")
+ Dim dateTime As Date = Date.Parse("2020 - 05 - 28T20: 26:00")
+ 'If the date of current revision same as expected date, then accepts it
+ If document.Revisions(0).[Date] Is dateTime Then wordDocument.Revisions(0).Accept()
+ 'Saves and closes the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ //Loads an existing Word document
+ WordDocument document = new WordDocument("Template.docx");
+ //If the revision is insertion type of revision, then accept it
+ if (document.Revisions[0].RevisionType == RevisionType.Insertions)
+ document.Revisions[0].Accept();
+ //Saves and closes the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+
+
+ 'Loads an existing Word document
+ Dim document As WordDocument = New WordDocument("C:\Users\TamilselvanMuralisun\Desktop\style formatting.docx")
+ 'If the revision is insertion type of revision, then accept it
+ If document.Revisions(0).RevisionType Is RevisionType.Insertions Then word.Revisions(0).Accept()
+ 'Saves and closes the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ WordDocument document = new WordDocument();
+ //Adds new section to the document
+ IWSection section = document.AddSection();
+ BlockContentControl control = new BlockContentControl(document);
+ //Adds new paragraph to the section.
+ WParagraph paragraph = new WParagraph(control.Document);
+ //Adds new text to the content control.
+ paragraph.AppendText("Block content control");
+ //Adds pagagraph into the Block content control.
+ control.TextBody.ChildEntities.Add(paragraph);
+ //Sets title of the block content control.
+ control.ContentControlProperties.Title = "Rich text content control";
+ //Adds content control into the document.
+ document.LastSection.Body.ChildEntities.Add(control);
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ Dim document As New WordDocument()
+ 'Adds new section to the document
+ Dim section As IWSection = document.AddSection()
+ Dim control As New BlockContentControl(document)
+ 'Adds new paragraph to the section.
+ Dim paragraph As New WParagraph(control.Document)
+ 'Adds new text to the content control.
+ paragraph.AppendText("Block content control")
+ 'Adds paragraph into the Block content control.
+ control.TextBody.ChildEntities.Add(paragraph)
+ 'Sets title of the block content control.
+ control.ContentControlProperties.Title = "Rich text content control"
+ 'Adds content control into the document.
+ document.LastSection.Body.ChildEntities.Add(control)
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ WordDocument document = new WordDocument();
+ //Adds new section to the document
+ IWSection section = document.AddSection();
+ BlockContentControl control = new BlockContentControl(document, ContentControlType.RichText);
+ //Adds new paragraph to the section.
+ WParagraph paragraph = new WParagraph(control.Document);
+ //Adds new text to the content control.
+ paragraph.AppendText(@"the security requirements are met, the CLR performs just in time (JIT) compilation to convert the IL code to native machine instructions.");
+ //Adds pagagraph into the Block content control.
+ control.TextBody.ChildEntities.Add(paragraph);
+ //Find the text based on regex.
+ TextSelection text = control.Find(new Regex("instructions"));
+ //Replaces all entries of given string with replace string.
+ control.Replace(new Regex(@"requirements"), text);
+ //Adds content control into the document.
+ document.LastSection.Body.ChildEntities.Add(control);
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ Dim document As New WordDocument()
+ 'Adds new section to the document
+ Dim section As IWSection = document.AddSection()
+ Dim control As New BlockContentControl(document, ContentControlType.RichText)
+ 'Adds new paragraph to the section.
+ Dim paragraph As New WParagraph(control.Document)
+ 'Adds new text to the content control.
+ paragraph.AppendText("the security requirements are met, the CLR performs just in time (JIT) compilation to convert the IL code to native machine instructions.")
+ 'Adds pagagraph into the Block content control.
+ control.TextBody.ChildEntities.Add(paragraph)
+ 'Find the text based on regex.
+ Dim text As TextSelection = control.Find(New Regex("instructions"))
+ 'Replaces all entries of given string with replace string.
+ control.Replace(New Regex("requirements"), text)
+ 'Adds content control into the document.
+ document.LastSection.Body.ChildEntities.Add(control)
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ WordDocument document = new WordDocument();
+ //Adds new section to the document
+ IWSection section = document.AddSection();
+ BlockContentControl control = new BlockContentControl(document, ContentControlType.RichText);
+ //Adds new paragraph to the section.
+ WParagraph paragraph = new WParagraph(control.Document);
+ //Adds new text to the content control.
+ paragraph.AppendText(@"the security requirements are met, the CLR performs just in time (JIT) compilation to convert the IL code to native machine instructions.");
+ //Adds pagagraph into the Block content control.
+ control.TextBody.ChildEntities.Add(paragraph);
+ //Find the text based on regex.
+ TextSelection text = control.Find(new Regex("instructions"));
+ //Replaces all entries of given string with replace string.
+ control.Replace(new Regex(@"requirements"), text);
+ //Adds content control into the document.
+ document.LastSection.Body.ChildEntities.Add(control);
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ Dim document As New WordDocument()
+ 'Adds new section to the document
+ Dim section As IWSection = document.AddSection()
+ Dim control As New BlockContentControl(document, ContentControlType.RichText)
+ 'Adds new paragraph to the section.
+ Dim paragraph As New WParagraph(control.Document)
+ 'Adds new text to the content control.
+ paragraph.AppendText("the security requirements are met, the CLR performs just in time (JIT) compilation to convert the IL code to native machine instructions.")
+ 'Adds pagagraph into the Block content control.
+ control.TextBody.ChildEntities.Add(paragraph)
+ 'Find the text based on regex.
+ Dim text As TextSelection = control.Find(New Regex("instructions"))
+ 'Replaces all entries of given string with replace string.
+ control.Replace(New Regex("requirements"), text)
+ 'Adds content control into the document.
+ document.LastSection.Body.ChildEntities.Add(control)
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ WordDocument document = new WordDocument();
+ //Adds new section to the document
+ IWSection section = document.AddSection();
+ BlockContentControl control = new BlockContentControl(document, ContentControlType.RichText);
+ //Adds new paragraph to the section.
+ WParagraph paragraph = new WParagraph(control.Document);
+ //Adds new text to the content control.
+ paragraph.AppendText(@"the security requirements are met, the CLR performs just in time (JIT) compilation to convert the IL code to native machine instructions.");
+ //Adds pagagraph into the Block content control.
+ control.TextBody.ChildEntities.Add(paragraph);
+ //Find the text based on regex.
+ TextSelection text = control.Find(new Regex("instructions"));
+ //Replaces all entries of given string with replace string.
+ control.Replace(new Regex(@"requirements"), text, true);
+ //Adds content control into the document.
+ document.LastSection.Body.ChildEntities.Add(control);
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ Dim document As New WordDocument()
+ 'Adds new section to the document
+ Dim section As IWSection = document.AddSection()
+ Dim control As New BlockContentControl(document, ContentControlType.RichText)
+ 'Adds new paragraph to the section.
+ Dim paragraph As New WParagraph(control.Document)
+ 'Adds new text to the content control.
+ paragraph.AppendText("the security requirements are met, the CLR performs just in time (JIT) compilation to convert the IL code to native machine instructions.")
+ 'Adds pagagraph into the Block content control.
+ control.TextBody.ChildEntities.Add(paragraph)
+ 'Find the text based on regex.
+ Dim text As TextSelection = control.Find(New Regex("instructions"))
+ 'Replaces all entries of given string with replace string.
+ control.Replace(New Regex("requirements"), text, true)
+ 'Adds content control into the document.
+ document.LastSection.Body.ChildEntities.Add(control)
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ WordDocument document = new WordDocument();
+ //Adds new section to the document
+ IWSection section = document.AddSection();
+ BlockContentControl control = new BlockContentControl(document, ContentControlType.RichText);
+ //Adds new paragraph to the section.
+ WParagraph paragraph = new WParagraph(control.Document);
+ //Adds new text to the content control.
+ paragraph.AppendText(@"the security requirements are met, the CLR performs just in time (JIT) compilation to convert the IL code to native machine instructions.");
+ //Adds pagagraph into the Block content control.
+ control.TextBody.ChildEntities.Add(paragraph);
+ //Find the text based on regex.
+ TextSelection text = control.Find(new Regex("instructions"));
+ //Replaces all entries of given string with replace string.
+ control.Replace("requirements", text, false, true, true);
+ //Adds content control into the document.
+ document.LastSection.Body.ChildEntities.Add(control);
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ Dim document As New WordDocument()
+ 'Adds new section to the document
+ Dim section As IWSection = document.AddSection()
+ Dim control As New BlockContentControl(document, ContentControlType.RichText)
+ 'Adds new paragraph to the section.
+ Dim paragraph As New WParagraph(control.Document)
+ 'Adds new text to the content control.
+ paragraph.AppendText("the security requirements are met, the CLR performs just in time (JIT) compilation to convert the IL code to native machine instructions.")
+ 'Adds pagagraph into the Block content control.
+ control.TextBody.ChildEntities.Add(paragraph)
+ 'Find the text based on regex.
+ Dim text As TextSelection = control.Find(New Regex("instructions"))
+ 'Replaces all entries of given string with replace string.
+ control.Replace(New Regex("requirements"), text, false, true, true)
+ 'Adds content control into the document.
+ document.LastSection.Body.ChildEntities.Add(control)
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ WordDocument document = new WordDocument();
+ //Adds new section to the document
+ IWSection section = document.AddSection();
+ BlockContentControl control = new BlockContentControl(document, ContentControlType.RichText);
+ //Adds new paragraph to the section.
+ WParagraph paragraph = new WParagraph(control.Document);
+ //Adds new text to the content control.
+ paragraph.AppendText(@"the security requirements are met, the CLR performs just in time (JIT) compilation to convert the IL code to native machine instructions.");
+ //Adds pagagraph into the Block content control.
+ control.TextBody.ChildEntities.Add(paragraph);
+ //Find the text based on regex.
+ TextSelection text = control.Find(new Regex("instructions"));
+ //Replaces all entries of given string with replace string.
+ control.Replace(new Regex(@"requirements"), text);
+ //Adds content control into the document.
+ document.LastSection.Body.ChildEntities.Add(control);
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ Dim document As New WordDocument()
+ 'Adds new section to the document
+ Dim section As IWSection = document.AddSection()
+ Dim control As New BlockContentControl(document, ContentControlType.RichText)
+ 'Adds new paragraph to the section.
+ Dim paragraph As New WParagraph(control.Document)
+ 'Adds new text to the content control.
+ paragraph.AppendText("the security requirements are met, the CLR performs just in time (JIT) compilation to convert the IL code to native machine instructions.")
+ 'Adds pagagraph into the Block content control.
+ control.TextBody.ChildEntities.Add(paragraph)
+ 'Find the text based on regex.
+ Dim text As TextSelection = control.Find(New Regex("instructions"))
+ 'Replaces all entries of given string with replace string.
+ control.Replace(New Regex("requirements"), text)
+ 'Adds content control into the document.
+ document.LastSection.Body.ChildEntities.Add(control)
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ WordDocument document = new WordDocument();
+ //Adds new section to the document
+ IWSection section = document.AddSection();
+ BlockContentControl control = new BlockContentControl(document, ContentControlType.RichText);
+ //Adds new paragraph to the section.
+ WParagraph paragraph = new WParagraph(control.Document);
+ //Adds new text to the content control.
+ paragraph.AppendText("Block content control");
+ //Adds pagagraph into the Block content control.
+ control.TextBody.ChildEntities.Add(paragraph);
+ //Adds content control into the document.
+ document.LastSection.Body.ChildEntities.Add(control);
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ Dim document As New WordDocument()
+ 'Adds new section to the document
+ Dim section As IWSection = document.AddSection()
+ Dim control As New BlockContentControl(document, ContentControlType.RichText)
+ 'Adds new paragraph to the section.
+ Dim paragraph As New WParagraph(control.Document)
+ 'Adds new text to the content control.
+ paragraph.AppendText("Block content control")
+ 'Adds pagagraph into the Block content control.
+ control.TextBody.ChildEntities.Add(paragraph)
+ 'Adds content control into the document.
+ document.LastSection.Body.ChildEntities.Add(control)
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ WordDocument document = new WordDocument();
+ //Adds new section to the document
+ IWSection section = document.AddSection();
+ BlockContentControl control = new BlockContentControl(document, ContentControlType.RichText);
+ //Adds new paragraph to the section.
+ WParagraph paragraph = new WParagraph(control.Document);
+ //Adds new text to the content control.
+ paragraph.AppendText("Block content control");
+ //Adds pagagraph into the Block content control.
+ control.TextBody.ChildEntities.Add(paragraph);
+ //Sets title of the block content control.
+ control.ContentControlProperties.Title = "Rich text content control";
+ //Adds content control into the document.
+ document.LastSection.Body.ChildEntities.Add(control);
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ Dim document As New WordDocument()
+ 'Adds new section to the document
+ Dim section As IWSection = document.AddSection()
+ Dim control As New BlockContentControl(document, ContentControlType.RichText)
+ 'Adds new paragraph to the section.
+ Dim paragraph As New WParagraph(control.Document)
+ 'Adds new text to the content control.
+ paragraph.AppendText("Block content control")
+ 'Adds paragraph into the Block content control.
+ control.TextBody.ChildEntities.Add(paragraph)
+ 'Sets title of the block content control.
+ control.ContentControlProperties.Title = "Rich text content control"
+ 'Adds content control into the document.
+ document.LastSection.Body.ChildEntities.Add(control)
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ WordDocument document = new WordDocument();
+ //Adds new section to the document
+ IWSection section = document.AddSection();
+ BlockContentControl control = new BlockContentControl(document, ContentControlType.RichText);
+ //Adds new paragraph to the section.
+ WParagraph paragraph = new WParagraph(control.Document);
+ //Adds new text to the content control.
+ paragraph.AppendText("Block content control");
+ //Adds pagagraph into the Block content control.
+ control.TextBody.ChildEntities.Add(paragraph);
+ //Sets title of the block content control.
+ control.ContentControlProperties.Title = "Rich text content control";
+ //Adds content control into the document.
+ document.LastSection.Body.ChildEntities.Add(control);
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ Dim document As New WordDocument()
+ 'Adds new section to the document
+ Dim section As IWSection = document.AddSection()
+ Dim control As New BlockContentControl(document, ContentControlType.RichText)
+ 'Adds new paragraph to the section.
+ Dim paragraph As New WParagraph(control.Document)
+ 'Adds new text to the content control.
+ paragraph.AppendText("Block content control")
+ 'Adds paragraph into the Block content control.
+ control.TextBody.ChildEntities.Add(paragraph)
+ 'Sets title of the block content control.
+ control.ContentControlProperties.Title = "Rich text content control"
+ 'Adds content control into the document.
+ document.LastSection.Body.ChildEntities.Add(control)
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ WordDocument document = new WordDocument();
+ //Adds new section to the document.
+ IWSection section = document.AddSection();
+ //Adds new table to the section.
+ IWTable table = section.AddTable();
+ //Adds new row to the table.
+ WTableRow tableRow = table.AddRow();
+ //Adds new cell to the row.
+ WTableCell tableCell = tableRow.AddCell();
+ tableCell.Width = 100;
+ //Adds new paragraph to the cell.
+ IWParagraph paragraph = tableCell.AddParagraph();
+ //Adds new text to the paragraph.
+ paragraph.AppendText("Content Control");
+ //Create the Row Content Control for the document.
+ RowContentControl control = new RowContentControl(document);
+ //Change the color value in Content Control properties.
+ control.ContentControlProperties.Color = System.Drawing.Color.Blue;
+ // Sets it to the row content control.
+ tableRow.ContentControl = control;
+ //Save the Word document.
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document.
+ document.Close();
+
+
+ Dim document As New WordDocument()
+ 'Adds new section to the document.
+ Dim section As IWSection = document.AddSection()
+ 'Adds new table to the section.
+ Dim table As IWTable = section.AddTable()
+ 'Adds new row to the table.
+ Dim tableRow As WTableRow = table.AddRow()
+ 'Adds new cell to the row.
+ Dim tableCell As WTableCell = tableRow.AddCell()
+ tableCell.Width = 100
+ 'Adds new paragraph to the cell.
+ Dim paragraph As IWParagraph = tableCell.AddParagraph()
+ 'Adds new text to the paragraph.
+ paragraph.AppendText("Content Control")
+ 'Create the Row Content Control for the document.
+ Dim control As New RowContentControl(document)
+ 'Change the color value in Content Control properties.
+ control.ContentControlProperties.Color = System.Drawing.Color.Blue
+ ' Sets it to the row content control.
+ tableRow.ContentControl = control
+ 'Save the Word document.
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document.
+ document.Close()
+
+
+ WordDocument document = new WordDocument();
+ //Adds new section to the document.
+ IWSection section = document.AddSection();
+ //Adds new table to the section.
+ IWTable table = section.AddTable();
+ //Adds new row to the table.
+ WTableRow tableRow = table.AddRow();
+ //Adds new cell to the row.
+ WTableCell tableCell = tableRow.AddCell();
+ tableCell.Width = 100;
+ //Adds new paragraph to the cell.
+ IWParagraph paragraph = tableCell.AddParagraph();
+ //Adds new text to the paragraph.
+ paragraph.AppendText("Content Control");
+ //Create the Row Content Control for the document.
+ RowContentControl control = new RowContentControl(document);
+ //Change the color value in Content Control properties.
+ control.ContentControlProperties.Color = System.Drawing.Color.Blue;
+ // Sets it to the row content control.
+ tableRow.ContentControl = control;
+ //Save the Word document.
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document.
+ document.Close();
+
+
+ Dim document As New WordDocument()
+ 'Adds new section to the document.
+ Dim section As IWSection = document.AddSection()
+ 'Adds new table to the section.
+ Dim table As IWTable = section.AddTable()
+ 'Adds new row to the table.
+ Dim tableRow As WTableRow = table.AddRow()
+ 'Adds new cell to the row.
+ Dim tableCell As WTableCell = tableRow.AddCell()
+ tableCell.Width = 100
+ 'Adds new paragraph to the cell.
+ Dim paragraph As IWParagraph = tableCell.AddParagraph()
+ 'Adds new text to the paragraph.
+ paragraph.AppendText("Content Control")
+ 'Create the Row Content Control for the document.
+ Dim control As New RowContentControl(document)
+ 'Change the color value in Content Control properties.
+ control.ContentControlProperties.Color = System.Drawing.Color.Blue
+ ' Sets it to the row content control.
+ tableRow.ContentControl = control
+ 'Save the Word document.
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document.
+ document.Close()
+
+
+ WordDocument document = new WordDocument();
+ //Adds new section to the document.
+ IWSection section = document.AddSection();
+ //Adds new table to the section.
+ IWTable table = section.AddTable();
+ //Adds new row to the table.
+ WTableRow tableRow = table.AddRow();
+ //Adds new cell to the row.
+ WTableCell tableCell = tableRow.AddCell();
+ tableCell.Width = 100;
+ //Adds new paragraph to the cell.
+ IWParagraph paragraph = tableCell.AddParagraph();
+ //Adds new text to the paragraph.
+ paragraph.AppendText("Content Control");
+ //Create the Cell Content Control for the document.
+ CellContentControl control = new CellContentControl(document);
+ //Change the color value in Content Control properties.
+ control.ContentControlProperties.Color = System.Drawing.Color.Green;
+ //Set it to the row content control.
+ tableCell.ContentControl = control;
+ //Save the Word document.
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document.
+ document.Close();
+
+
+ Dim document As New WordDocument()
+ 'Adds new section to the document.
+ Dim section As IWSection = document.AddSection()
+ 'Adds new table to the section.
+ Dim table As IWTable = section.AddTable()
+ 'Adds new row to the table.
+ Dim tableRow As WTableRow = table.AddRow()
+ 'Adds new cell to the row.
+ Dim tableCell As WTableCell = tableRow.AddCell()
+ tableCell.Width = 100
+ 'Adds new paragraph to the cell.
+ Dim paragraph As IWParagraph = tableCell.AddParagraph()
+ 'Adds new text to the paragraph.
+ paragraph.AppendText("Content Control")
+ 'Create the Cell Content Control for the document.
+ Dim control As New CellContentControl(document)
+ 'Change the color value in Content Control properties.
+ control.ContentControlProperties.Color = System.Drawing.Color.Green
+ ' Set it to the row content control.
+ tableCell.ContentControl = control
+ 'Save the Word document.
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document.
+ document.Close()
+
+
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Adds new section to the document
+ IWSection section = document.AddSection();
+ //Adds new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Adds new rich text content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.RichText);
+ //Adds new text to the content control
+ WTextRange textRange = new WTextRange(document);
+ textRange.Text = "Rich Text Content Control";
+ (paragraph.Items.LastItem as InlineContentControl).ParagraphItems.Add(textRange);
+ InlineContentControl richTextControl = paragraph.Items.LastItem as InlineContentControl;
+ richTextControl.ParagraphItems.Add(textRange);
+ // Sets Title property of the content control.
+ richTextControl.ContentControlProperties.Title = "Rich text content control";
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Adds new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Adds new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Adds new rich text content control to the last paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.RichText)
+ Dim textRange As New WTextRange(document)
+ textRange.Text = "Rich Text Content Control"
+ Dim richTextControl As InlineContentControl = section.LastParagraph.LastItem
+ richTextControl.ParagraphItems.Add(textRange)
+ 'Sets Title property of the content control.
+ richTextControl.ContentControlProperties.Title = "Rich text content control"
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Adds new section to the document
+ IWSection section = document.AddSection();
+ //Adds new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Adds new rich text content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.RichText);
+ //Adds new text to the content control
+ WTextRange textRange = new WTextRange(document);
+ textRange.Text = "Rich Text Content Control";
+ (paragraph.Items.LastItem as InlineContentControl).ParagraphItems.Add(textRange);
+ InlineContentControl richTextControl = paragraph.Items.LastItem as InlineContentControl;
+ richTextControl.ParagraphItems.Add(textRange);
+ // Sets Title property of the content control.
+ richTextControl.ContentControlProperties.Title = "Rich text content control";
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Adds new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Adds new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Adds new rich text content control to the last paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.RichText)
+ Dim textRange As New WTextRange(document)
+ textRange.Text = "Rich Text Content Control"
+ Dim richTextControl As InlineContentControl = section.LastParagraph.LastItem
+ richTextControl.ParagraphItems.Add(textRange)
+ 'Sets Title property of the content control.
+ richTextControl.ContentControlProperties.Title = "Rich text content control"
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Adds new section to the document
+ IWSection section = document.AddSection();
+ //Adds new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Adds new rich text content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.RichText);
+ //Adds new text to the content control
+ WTextRange textRange = new WTextRange(document);
+ textRange.Text = "Rich Text Content Control";
+ (paragraph.Items.LastItem as InlineContentControl).ParagraphItems.Add(textRange);
+ InlineContentControl richTextControl = paragraph.Items.LastItem as InlineContentControl;
+ richTextControl.ParagraphItems.Add(textRange);
+ // Sets Title property of the content control.
+ richTextControl.ContentControlProperties.Title = "Rich text content control";
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Adds new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Adds new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Adds new rich text content control to the last paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.RichText)
+ Dim textRange As New WTextRange(document)
+ textRange.Text = "Rich Text Content Control"
+ Dim richTextControl As InlineContentControl = section.LastParagraph.LastItem
+ richTextControl.ParagraphItems.Add(textRange)
+ 'Sets Title property of the content control.
+ richTextControl.ContentControlProperties.Title = "Rich text content control"
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add new drop down list content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.DropDownList);
+ //Add new text to the content control
+ WTextRange textRange = new WTextRange(document);
+ textRange.Text = "Drop down Content Control";
+ InlineContentControl dropDownList = paragraph.Items.LastItem as InlineContentControl;
+ dropDownList.ParagraphItems.Add(textRange);
+ ContentControlListItem item = new ContentControlListItem();
+ item.Value = "1";
+ item.DisplayText = "Ice cream";
+ dropDownList.ContentControlProperties.ContentControlListItems.Add(item);
+ item = new ContentControlListItem();
+ item.Value = "2";
+ item.DisplayText = "Cool drinks";
+ dropDownList.ContentControlProperties.ContentControlListItems.Add(item);
+ dropDownList.ContentControlProperties.Tag = "Drop down";
+ dropDownList.ContentControlProperties.Title = "Drop down list items";
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add new drop down list content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.DropDownList)
+ 'Add new text to the content control
+ Dim textRange As New WTextRange(document)
+ textRange.Text = "Drop down Content Control"
+ Dim dropDownList As InlineContentControl = TryCast(paragraph.Items.LastItem, InlineContentControl)
+ Dim item As New ContentControlListItem()
+ dropDownList.ParagraphItems.Add(textRange);
+ item.Value = "1"
+ item.DisplayText = "Ice cream"
+ dropDownList.ContentControlProperties.ContentControlListItems.Add(item)
+ item = New ContentControlListItem()
+ item.Value = "2"
+ item.DisplayText = "Cool drinks"
+ dropDownList.ContentControlProperties.ContentControlListItems.Add(item)
+ dropDownList.ContentControlProperties.Tag = "Drop down"
+ dropDownList.ContentControlProperties.Title = "Drop down list items"
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add new drop down list content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.DropDownList);
+ //Add new text to the content control
+ WTextRange textRange = new WTextRange(document);
+ textRange.Text = "Drop down Content Control";
+ InlineContentControl dropDownList = paragraph.Items.LastItem as InlineContentControl;
+ dropDownList.ParagraphItems.Add(textRange);
+ ContentControlListItem item = new ContentControlListItem();
+ item.Value = "1";
+ item.DisplayText = "Ice cream";
+ dropDownList.ContentControlProperties.ContentControlListItems.Add(item);
+ item = new ContentControlListItem();
+ item.Value = "2";
+ item.DisplayText = "Cool drinks";
+ dropDownList.ContentControlProperties.ContentControlListItems.Add(item);
+ dropDownList.ContentControlProperties.Tag = "Drop down";
+ dropDownList.ContentControlProperties.Title = "Drop down list items";
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add new drop down list content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.DropDownList)
+ 'Add new text to the content control
+ Dim textRange As New WTextRange(document)
+ textRange.Text = "Drop down Content Control"
+ Dim dropDownList As InlineContentControl = TryCast(paragraph.Items.LastItem, InlineContentControl)
+ dropDownList.ParagraphItems.Add(textRange)
+ Dim item As New ContentControlListItem()
+ item.Value = "1"
+ item.DisplayText = "Ice cream"
+ dropDownList.ContentControlProperties.ContentControlListItems.Add(item)
+ item = New ContentControlListItem()
+ item.Value = "2"
+ item.DisplayText = "Cool drinks"
+ dropDownList.ContentControlProperties.ContentControlListItems.Add(item)
+ dropDownList.ContentControlProperties.Tag = "Drop down"
+ dropDownList.ContentControlProperties.Title = "Drop down list items"
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ WSection section = document.AddSection() as WSection;
+ //Add new combo box content control
+ BlockContentControl block = section.Body.AddBlockContentControl(ContentControlType.ComboBox) as BlockContentControl;
+ block.TextBody.AddParagraph();
+ block.TextBody.LastParagraph.AppendText("Block Content control");
+ ContentControlListItem item1 = new ContentControlListItem();
+ item1.DisplayText = "Animals";
+ item1.Value = "Animals";
+ ContentControlListItem item2 = new ContentControlListItem();
+ item2.DisplayText = "Fruits";
+ item2.Value = "Fruits";
+ block.ContentControlProperties.ContentControlListItems.Add(item1);
+ //Insert specific item to collection using index
+ block.ContentControlProperties.ContentControlListItems.Insert(1, item2);
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As WSection = TryCast(document.AddSection(), WSection)
+ 'Add new combo box content control
+ Dim block As BlockContentControl = TryCast(section.Body.AddBlockContentControl(ContentControlType.ComboBox), BlockContentControl)
+ block.TextBody.AddParagraph();
+ block.TextBody.LastParagraph.AppendText("Block Content control")
+ Dim item1 As New ContentControlListItem()
+ item1.DisplayText = "Animals"
+ item1.Value = "Animals"
+ Dim item2 As New ContentControlListItem()
+ item2.DisplayText = "Fruits"
+ item2.Value = "Fruits"
+ block.ContentControlProperties.ContentControlListItems.Add(item1)
+ 'Insert specific item to collection using index
+ block.ContentControlProperties.ContentControlListItems.Insert(1, item2)
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ WSection section = document.AddSection() as WSection;
+ //Add new combo box content control
+ BlockContentControl block = section.Body.AddBlockContentControl(ContentControlType.ComboBox) as BlockContentControl;
+ block.TextBody.AddParagraph();
+ block.TextBody.LastParagraph.AppendText("Block Content control");
+ ContentControlListItem item1 = new ContentControlListItem();
+ item1.DisplayText = "Animals";
+ item1.Value = "Animals";
+ ContentControlListItem item2 = new ContentControlListItem();
+ item2.DisplayText = "Fruits";
+ item2.Value = "Fruits";
+ block.ContentControlProperties.ContentControlListItems.Add(item1);
+ block.ContentControlProperties.ContentControlListItems.Add(item2);
+ //Remove specific item from collection
+ block.ContentControlProperties.ContentControlListItems.Remove(item1);
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As WSection = TryCast(document.AddSection(), WSection)
+ 'Add new combo box content control
+ Dim block As BlockContentControl = TryCast(section.Body.AddBlockContentControl(ContentControlType.ComboBox), BlockContentControl)
+ block.TextBody.AddParagraph()
+ block.TextBody.LastParagraph.AppendText("Block Content control")
+ Dim item1 As New ContentControlListItem()
+ item1.DisplayText = "Animals"
+ item1.Value = "Animals"
+ Dim item2 As New ContentControlListItem()
+ item2.DisplayText = "Fruits"
+ item2.Value = "Fruits"
+ block.ContentControlProperties.ContentControlListItems.Add(item1)
+ block.ContentControlProperties.ContentControlListItems.Add(item2)
+ 'Remove specific item from collection
+ block.ContentControlProperties.ContentControlListItems.Remove(item1)
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ WSection section = document.AddSection() as WSection;
+ //Add new combo box content control
+ BlockContentControl block = section.Body.AddBlockContentControl(ContentControlType.ComboBox) as BlockContentControl;
+ block.TextBody.AddParagraph();
+ block.TextBody.LastParagraph.AppendText("Block Content control");
+ ContentControlListItem item1 = new ContentControlListItem();
+ item1.DisplayText = "Animals";
+ item1.Value = "Animals";
+ ContentControlListItem item2 = new ContentControlListItem();
+ item2.DisplayText = "Fruits";
+ item2.Value = "Fruits";
+ block.ContentControlProperties.ContentControlListItems.Add(item1);
+ block.ContentControlProperties.ContentControlListItems.Add(item2);
+ //Remove specific item from collection
+ block.ContentControlProperties.ContentControlListItems.RemoveAt(0);
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As WSection = TryCast(document.AddSection(), WSection)
+ 'Add new combo box content control
+ Dim block As BlockContentControl = TryCast(section.Body.AddBlockContentControl(ContentControlType.ComboBox), BlockContentControl)
+ block.TextBody.AddParagraph()
+ block.TextBody.LastParagraph.AppendText("Block Content control");
+ Dim item1 As New ContentControlListItem()
+ item1.DisplayText = "Animals"
+ item1.Value = "Animals"
+ Dim item2 As New ContentControlListItem()
+ item2.DisplayText = "Fruits"
+ item2.Value = "Fruits"
+ block.ContentControlProperties.ContentControlListItems.Add(item1)
+ block.ContentControlProperties.ContentControlListItems.Add(item2)
+ 'Remove specific item from collection
+ block.ContentControlProperties.ContentControlListItems.RemoveAt(0)
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ WSection section = document.AddSection() as WSection;
+ //Add new combo box content control
+ BlockContentControl block = section.Body.AddBlockContentControl(ContentControlType.ComboBox) as BlockContentControl;
+ block.TextBody.AddParagraph();
+ block.TextBody.LastParagraph.AppendText("Block Content control");
+ ContentControlListItem item1 = new ContentControlListItem();
+ item1.DisplayText = "Animals";
+ item1.Value = "Animals";
+ ContentControlListItem item2 = new ContentControlListItem();
+ block.ContentControlProperties.ContentControlListItems.Add(item1);
+ //Insert specific item to collection using index
+ block.ContentControlProperties.ContentControlListItems.Insert(1, item2);
+ //Get the ContentControlListItem from the collection
+ block.ContentControlProperties.ContentControlListItems[1].DisplayText = "Fruits";
+ block.ContentControlProperties.ContentControlListItems[1].Value = "Fruits";
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As WSection = TryCast(document.AddSection(), WSection)
+ 'Add new combo box content control
+ Dim block As BlockContentControl = TryCast(section.Body.AddBlockContentControl(ContentControlType.ComboBox), BlockContentControl)
+ block.TextBody.AddParagraph()
+ block.TextBody.LastParagraph.AppendText("Block Content control")
+ Dim item1 As New ContentControlListItem()
+ item1.DisplayText = "Animals"
+ item1.Value = "Animals"
+ Dim item2 As New ContentControlListItem()
+ block.ContentControlProperties.ContentControlListItems.Add(item1)
+ 'Insert specific item to collection using index
+ block.ContentControlProperties.ContentControlListItems.Insert(1, item2);
+ 'Get the ContentControlListItem from the collection
+ block.ContentControlProperties.ContentControlListItems(1).DisplayText = "Fruits"
+ block.ContentControlProperties.ContentControlListItems(1).Value = "Fruits"
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ WSection section = document.AddSection() as WSection;
+ //Add new combo box content control
+ BlockContentControl block = section.Body.AddBlockContentControl(ContentControlType.ComboBox) as BlockContentControl;
+ block.TextBody.AddParagraph();
+ block.TextBody.LastParagraph.AppendText("Block Content control");
+ ContentControlListItem item1 = new ContentControlListItem();
+ item1.DisplayText = "Animals";
+ item1.Value = "Animals";
+ ContentControlListItem item2 = new ContentControlListItem();
+ item2.DisplayText = "Fruits";
+ item2.Value = "Fruits";
+ block.ContentControlProperties.ContentControlListItems.Add(item1);
+ block.ContentControlProperties.ContentControlListItems.Add(item2);
+ //Get the count of content control list items
+ int count = block.ContentControlProperties.ContentControlListItems.Count;
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As WSection = TryCast(document.AddSection(), WSection)
+ 'Add new combo box content control
+ Dim block As BlockContentControl = TryCast(section.Body.AddBlockContentControl(ContentControlType.ComboBox), BlockContentControl)
+ block.TextBody.AddParagraph()
+ block.TextBody.LastParagraph.AppendText("Block Content control")
+ Dim item1 As New ContentControlListItem()
+ item1.DisplayText = "Animals"
+ item1.Value = "Animals"
+ Dim item2 As New ContentControlListItem()
+ item2.DisplayText = "Fruits"
+ item2.Value = "Fruits"
+ block.ContentControlProperties.ContentControlListItems.Add(item1)
+ block.ContentControlProperties.ContentControlListItems.Add(item2)
+ 'Get the count of content control list items
+ Dim count As Integer = block.ContentControlProperties.ContentControlListItems.Count
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add new drop down list content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.DropDownList);
+ //Add new text to the content control
+ WTextRange textRange = new WTextRange(document);
+ textRange.Text = "Drop down Content Control";
+ InlineContentControl dropDownList = paragraph.Items.LastItem as InlineContentControl;
+ dropDownList.ParagraphItems.Add(textRange);
+ ContentControlListItem item = new ContentControlListItem();
+ item.Value = "1";
+ item.DisplayText = "Ice cream";
+ dropDownList.ContentControlProperties.ContentControlListItems.Add(item);
+ item = new ContentControlListItem();
+ item.Value = "2";
+ item.DisplayText = "Cool drinks";
+ dropDownList.ContentControlProperties.ContentControlListItems.Add(item);
+ dropDownList.ContentControlProperties.Tag = "Drop down";
+ dropDownList.ContentControlProperties.Title = "Drop down list items";
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add new drop down list content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.DropDownList)
+ 'Add new text to the content control
+ Dim textRange As New WTextRange(document)
+ textRange.Text = "Drop down Content Control"
+ Dim dropDownList As InlineContentControl = TryCast(paragraph.Items.LastItem, InlineContentControl)
+ Dim item As New ContentControlListItem()
+ dropDownList.ParagraphItems.Add(textRange)
+ item.Value = "1"
+ item.DisplayText = "Ice cream"
+ dropDownList.ContentControlProperties.ContentControlListItems.Add(item)
+ item = New ContentControlListItem()
+ item.Value = "2"
+ item.DisplayText = "Cool drinks"
+ dropDownList.ContentControlProperties.ContentControlListItems.Add(item)
+ dropDownList.ContentControlProperties.Tag = "Drop down"
+ dropDownList.ContentControlProperties.Title = "Drop down list items"
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add new drop down list content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.DropDownList);
+ //Add new text to the content control
+ WTextRange textRange = new WTextRange(document);
+ textRange.Text = "Drop down Content Control";
+ InlineContentControl dropDownList = paragraph.Items.LastItem as InlineContentControl;
+ //richTextControl.ParagraphItems.Add(textRange);
+ ContentControlListItem item = new ContentControlListItem();
+ item.Value = "1";
+ item.DisplayText = "Ice cream";
+ dropDownList.ContentControlProperties.ContentControlListItems.Add(item);
+ item = new ContentControlListItem();
+ item.Value = "2";
+ item.DisplayText = "Cool drinks";
+ dropDownList.ContentControlProperties.ContentControlListItems.Add(item);
+ dropDownList.ContentControlProperties.Tag = "Drop down";
+ dropDownList.ContentControlProperties.Title = "Drop down list items";
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add new drop down list content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.DropDownList)
+ 'Add new text to the content control
+ Dim textRange As New WTextRange(document)
+ textRange.Text = "Drop down Content Control"
+ Dim dropDownList As InlineContentControl = TryCast(paragraph.Items.LastItem, InlineContentControl)
+ 'richTextControl.ParagraphItems.Add(textRange);
+ Dim item As New ContentControlListItem()
+ item.Value = "1"
+ item.DisplayText = "Ice cream"
+ dropDownList.ContentControlProperties.ContentControlListItems.Add(item)
+ item = New ContentControlListItem()
+ item.Value = "2"
+ item.DisplayText = "Cool drinks"
+ dropDownList.ContentControlProperties.ContentControlListItems.Add(item)
+ dropDownList.ContentControlProperties.Tag = "Drop down"
+ dropDownList.ContentControlProperties.Title = "Drop down list items"
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add new drop down list content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.DropDownList);
+ //Add new text to the content control
+ WTextRange textRange = new WTextRange(document);
+ textRange.Text = "Drop down Content Control";
+ InlineContentControl dropDownList = paragraph.Items.LastItem as InlineContentControl;
+ ContentControlListItem item = new ContentControlListItem();
+ item.Value = "1";
+ item.DisplayText = "Ice cream";
+ dropDownList.ContentControlProperties.ContentControlListItems.Add(item);
+ item = new ContentControlListItem();
+ item.Value = "2";
+ item.DisplayText = "Cool drinks";
+ dropDownList.ContentControlProperties.ContentControlListItems.Add(item);
+ dropDownList.ContentControlProperties.Tag = "Drop down";
+ dropDownList.ContentControlProperties.Title = "Drop down list items";
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add new drop down list content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.DropDownList)
+ 'Add new text to the content control
+ Dim textRange As New WTextRange(document)
+ textRange.Text = "Drop down Content Control"
+ Dim dropDownList As InlineContentControl = TryCast(paragraph.Items.LastItem, InlineContentControl)
+ Dim item As New ContentControlListItem()
+ item.Value = "1"
+ item.DisplayText = "Ice cream"
+ dropDownList.ContentControlProperties.ContentControlListItems.Add(item)
+ item = New ContentControlListItem()
+ item.Value = "2"
+ item.DisplayText = "Cool drinks"
+ dropDownList.ContentControlProperties.ContentControlListItems.Add(item)
+ dropDownList.ContentControlProperties.Tag = "Drop down"
+ dropDownList.ContentControlProperties.Title = "Drop down list items"
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add new rich text content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.RichText);
+ //Add new text to the content control
+ WTextRange textRange = new WTextRange(document);
+ textRange.Text = "Rich Text Content Control";
+ (paragraph.Items.LastItem as InlineContentControl).ParagraphItems.Add(textRange);
+ InlineContentControl richTextControl = paragraph.Items.LastItem as InlineContentControl;
+ richTextControl.ParagraphItems.Add(textRange);
+ richTextControl.ContentControlProperties.Appearance = ContentControlAppearance.Tags;
+ richTextControl.ContentControlProperties.Color = Color.Gray;
+ richTextControl.ContentControlProperties.LockContentControl = true;
+ richTextControl.ContentControlProperties.Tag = "RichText";
+ richTextControl.ContentControlProperties.Title = "Rich text content control";
+ //Add new text content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.Text);
+ //Add new text to the content control
+ WTextRange textRange1 = new WTextRange(document);
+ textRange1.Text = "Text Content Control";
+ (paragraph.Items.LastItem as InlineContentControl).ParagraphItems.Add(textRange1);
+ InlineContentControl textControl = paragraph.Items.LastItem as InlineContentControl;
+ textControl.ParagraphItems.Add(textRange1);
+ textControl.ContentControlProperties.Appearance = ContentControlAppearance.Tags;
+ textControl.ContentControlProperties.Color = Color.Gray;
+ textControl.ContentControlProperties.LockContentControl = true;
+ textControl.ContentControlProperties.LockContents = true;
+ textControl.ContentControlProperties.Multiline = true;
+ textControl.ContentControlProperties.Tag = "Text";
+ textControl.ContentControlProperties.Title = "Text content control";
+ //Add new date content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.Date);
+ //Add new text to the content control
+ WTextRange textRange2 = new WTextRange(document);
+ textRange2.Text = "Date Content Control";
+ (paragraph.Items.LastItem as InlineContentControl).ParagraphItems.Add(textRange2);
+ InlineContentControl dateControl = paragraph.Items.LastItem as InlineContentControl;
+ dateControl.ParagraphItems.Add(textRange2);
+ dateControl.ContentControlProperties.Appearance = ContentControlAppearance.Tags;
+ dateControl.ContentControlProperties.DateCalendarType = CalendarType.GregorianArabic;
+ dateControl.ContentControlProperties.DateDisplayFormat = "dd yy MMMM";
+ dateControl.ContentControlProperties.DateDisplayLocale = LocaleIDs.en_US;
+ dateControl.ContentControlProperties.DateStorageFormat = ContentControlDateStorageFormat.DateStorageDate;
+ dateControl.ContentControlProperties.Tag = "Date control";
+ dateControl.ContentControlProperties.Title = "Date content control";
+ //Add new drop down list content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.DropDownList);
+ //Add new text to the content control
+ WTextRange textRange3 = new WTextRange(document);
+ textRange3.Text = "Drop down Content Control";
+ InlineContentControl dropDownList = paragraph.Items.LastItem as InlineContentControl;
+ //richTextControl.ParagraphItems.Add(textRange);
+ ContentControlListItem item = new ContentControlListItem();
+ item.Value = "1";
+ item.DisplayText = "Ice cream";
+ dropDownList.ContentControlProperties.ContentControlListItems.Add(item);
+ item = new ContentControlListItem();
+ item.Value = "2";
+ item.DisplayText = "Cool drinks";
+ dropDownList.ContentControlProperties.ContentControlListItems.Add(item);
+ dropDownList.ContentControlProperties.Tag = "Drop down";
+ dropDownList.ContentControlProperties.Title = "Drop down list items";
+ //Add new picture content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.Picture);
+ Image image = Image.FromFile("Image.png");
+ IWPicture picture = new WPicture(document);
+ picture.LoadImage(image);
+ picture.Height = 100;
+ picture.Width = 100;
+ InlineContentControl pictureControl = paragraph.Items.LastItem as InlineContentControl;
+ pictureControl.ParagraphItems.Add(picture);
+ pictureControl.ContentControlProperties.Tag = "Picture control";
+ pictureControl.ContentControlProperties.Title = "picture control";
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add new rich text content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.RichText)
+ 'Add new text to the content control
+ Dim textRange As New WTextRange(document)
+ textRange.Text = "Rich Text Content Control"
+ TryCast(paragraph.Items.LastItem, InlineContentControl).ParagraphItems.Add(textRange)
+ Dim richTextControl As InlineContentControl = TryCast(paragraph.Items.LastItem, InlineContentControl)
+ richTextControl.ParagraphItems.Add(textRange)
+ richTextControl.ContentControlProperties.Appearance = ContentControlAppearance.Tags
+ richTextControl.ContentControlProperties.Color = Color.Gray
+ richTextControl.ContentControlProperties.LockContentControl = True
+ richTextControl.ContentControlProperties.Tag = "RichText"
+ richTextControl.ContentControlProperties.Title = "Rich text content control"
+ 'Add new text content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.Text)
+ 'Add new text to the content control
+ Dim textRange1 As New WTextRange(document)
+ textRange1.Text = "Text Content Control"
+ TryCast(paragraph.Items.LastItem, InlineContentControl).ParagraphItems.Add(textRange1)
+ Dim textControl As InlineContentControl = TryCast(paragraph.Items.LastItem, InlineContentControl)
+ textControl.ParagraphItems.Add(textRange1)
+ textControl.ContentControlProperties.Appearance = ContentControlAppearance.Tags
+ textControl.ContentControlProperties.Color = Color.Gray
+ textControl.ContentControlProperties.LockContentControl = True
+ textControl.ContentControlProperties.LockContents = True
+ textControl.ContentControlProperties.Multiline = True
+ textControl.ContentControlProperties.Tag = "Text"
+ textControl.ContentControlProperties.Title = "Text content control"
+ 'Add new date content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.[Date])
+ 'Add new text to the content control
+ Dim textRange2 As New WTextRange(document)
+ textRange2.Text = "Date Content Control"
+ TryCast(paragraph.Items.LastItem, InlineContentControl).ParagraphItems.Add(textRange2)
+ Dim dateControl As InlineContentControl = TryCast(paragraph.Items.LastItem, InlineContentControl)
+ dateControl.ParagraphItems.Add(textRange2)
+ dateControl.ContentControlProperties.Appearance = ContentControlAppearance.Tags
+ dateControl.ContentControlProperties.DateCalendarType = CalendarType.GregorianArabic
+ dateControl.ContentControlProperties.DateDisplayFormat = "dd yy MMMM"
+ dateControl.ContentControlProperties.DateDisplayLocale = LocaleIDs.en_US
+ dateControl.ContentControlProperties.DateStorageFormat = ContentControlDateStorageFormat.DateStorageDate
+ dateControl.ContentControlProperties.Tag = "Date control"
+ dateControl.ContentControlProperties.Title = "Date content control"
+ 'Add new drop down list content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.DropDownList)
+ 'Add new text to the content control
+ Dim textRange3 As New WTextRange(document)
+ textRange3.Text = "Drop down Content Control"
+ Dim dropDownList As InlineContentControl = TryCast(paragraph.Items.LastItem, InlineContentControl)
+ 'richTextControl.ParagraphItems.Add(textRange);
+ Dim item As New ContentControlListItem()
+ item.Value = "1"
+ item.DisplayText = "Ice cream"
+ dropDownList.ContentControlProperties.ContentControlListItems.Add(item)
+ item = New ContentControlListItem()
+ item.Value = "2"
+ item.DisplayText = "Cool drinks"
+ dropDownList.ContentControlProperties.ContentControlListItems.Add(item)
+ dropDownList.ContentControlProperties.Tag = "Drop down"
+ dropDownList.ContentControlProperties.Title = "Drop down list items"
+ 'Add new picture content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.Picture)
+ Dim image As Image = image.FromFile("Image.png")
+ Dim picture As IWPicture = New WPicture(document)
+ picture.LoadImage(image)
+ picture.Height = 100
+ picture.Width = 100
+ Dim pictureControl As InlineContentControl = TryCast(paragraph.Items.LastItem, InlineContentControl)
+ pictureControl.ParagraphItems.Add(picture)
+ pictureControl.ContentControlProperties.Tag = "Picture control"
+ pictureControl.ContentControlProperties.Title = "picture control"
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add new date picker content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.Date);
+ InlineContentControl datePicker = paragraph.Items.LastItem as InlineContentControl;
+ WTextRange textRange = new WTextRange(document);
+ //Sets today's date to display.
+ textRange.Text = DateTime.Now.ToShortDateString();
+ datePicker.ParagraphItems.Add(textRange);
+ //Sets format for date to display.
+ datePicker.ContentControlProperties.DateDisplayFormat = "M/d/yyyy";
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add new date picker content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.[Date])
+ Dim datePicker As InlineContentControl = TryCast(paragraph.Items.LastItem, InlineContentControl)
+ Dim textRange As New WTextRange(document)
+ 'Sets today's date to display.
+ textRange.Text = DateTime.Now.ToShortDateString()
+ datePicker.ParagraphItems.Add(textRange)
+ datePicker.ContentControlProperties.DateDisplayFormat = "M/d/yyyy"
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add new date picker content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.Date);
+ InlineContentControl datePicker = paragraph.Items.LastItem as InlineContentControl;
+ WTextRange textRange = new WTextRange(document);
+ //Sets today's date to display.
+ textRange.Text = DateTime.Now.ToShortDateString();
+ datePicker.ParagraphItems.Add(textRange);
+ //Sets the language format for the date.
+ datePicker.ContentControlProperties.DateDisplayLocale = LocaleIDs.en_US;
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add new date picker content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.[Date])
+ Dim datePicker As InlineContentControl = TryCast(paragraph.Items.LastItem, InlineContentControl)
+ Dim textRange As New WTextRange(document)
+ 'Sets today's date to display.
+ textRange.Text = DateTime.Now.ToShortDateString()
+ datePicker.ParagraphItems.Add(textRange)
+ 'Sets the language format for the date.
+ datePicker.ContentControlProperties.DateDisplayLocale = LocaleIDs.en_US
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add new date picker content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.Date);
+ InlineContentControl datePicker = paragraph.Items.LastItem as InlineContentControl;
+ WTextRange textRange = new WTextRange(document);
+ //Sets today's date to display.
+ textRange.Text = DateTime.Now.ToShortDateString();
+ datePicker.ParagraphItems.Add(textRange);
+ //Sets the storage and retrieval format for the date.
+ datePicker.ContentControlProperties.DateStorageFormat = ContentControlDateStorageFormat.DateStorageDate;
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add new date picker content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.[Date])
+ Dim datePicker As InlineContentControl = TryCast(paragraph.Items.LastItem, InlineContentControl)
+ Dim textRange As New WTextRange(document)
+ 'Sets today's date to display.
+ textRange.Text = DateTime.Now.ToShortDateString()
+ datePicker.ParagraphItems.Add(textRange)
+ 'Sets the storage and retrieval format for the date.
+ datePicker.ContentControlProperties.DateStorageFormat = ContentControlDateStorageFormat.DateStorageDate;
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add new date picker content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.Date);
+ InlineContentControl datePicker = paragraph.Items.LastItem as InlineContentControl;
+ WTextRange textRange = new WTextRange(document);
+ //Sets today's date to display.
+ textRange.Text = DateTime.Now.ToShortDateString();
+ datePicker.ParagraphItems.Add(textRange);
+ //Sets calendar type for the date picker control.
+ datePicker.ContentControlProperties.DateCalendarType = CalendarType.Gregorian;
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add new date picker content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.[Date])
+ Dim datePicker As InlineContentControl = TryCast(paragraph.Items.LastItem, InlineContentControl)
+ Dim textRange As New WTextRange(document)
+ 'Sets today's date to display.
+ textRange.Text = DateTime.Now.ToShortDateString()
+ datePicker.ParagraphItems.Add(textRange)
+ 'Sets calendar type for the date picker control.
+ datePicker.ContentControlProperties.DateCalendarType = CalendarType.Gregorian
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add new rich text content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.RichText);
+ //Add new text to the content control
+ WTextRange textRange = new WTextRange(document);
+ textRange.Text = "Rich Text Content Control";
+ (paragraph.Items.LastItem as InlineContentControl).ParagraphItems.Add(textRange);
+ InlineContentControl richTextControl = paragraph.Items.LastItem as InlineContentControl;
+ richTextControl.ParagraphItems.Add(textRange);
+ // Enables content control lock.
+ richTextControl.ContentControlProperties.LockContentControl = true;
+ //Add new text content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.Text);
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add new rich text content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.RichText)
+ 'Add new text to the content control
+ Dim textRange As New WTextRange(document)
+ textRange.Text = "Rich Text Content Control"
+ TryCast(paragraph.Items.LastItem, InlineContentControl).ParagraphItems.Add(textRange)
+ Dim richTextControl As InlineContentControl = TryCast(paragraph.Items.LastItem, InlineContentControl)
+ richTextControl.ParagraphItems.Add(textRange)
+ 'Enables content control lock.
+ richTextControl.ContentControlProperties.LockContentControl = True
+ 'Add new text content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.Text)
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add new rich text content control to the paragraph.
+ paragraph.AppendInlineContentControl(ContentControlType.RichText);
+ InlineContentControl richTextControl = paragraph.Items.LastItem as InlineContentControl;
+ //Add new text to the content control
+ WTextRange textRange = new WTextRange(document);
+ textRange.Text = "Rich Text Content Control";
+ richTextControl.ParagraphItems.Add(textRange);
+ //Protects the content control.
+ richTextControl.ContentControlProperties.LockContents = true;
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add new rich text content control to the paragraph.
+ paragraph.AppendInlineContentControl(ContentControlType.RichText)
+ Dim richTextControl As InlineContentControl = TryCast(paragraph.Items.LastItem, InlineContentControl)
+ 'Add new text to the content control
+ Dim textRange As New WTextRange(document)
+ textRange.Text = "Rich Text Content Control"
+ richTextControl.ParagraphItems.Add(textRange)
+ 'Protects the content control.
+ richTextControl.ContentControlProperties.LockContents = True
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add new plain text content control to the paragraph.
+ paragraph.AppendInlineContentControl(ContentControlType.Text);
+ InlineContentControl plainTextControl = paragraph.Items.LastItem as InlineContentControl;
+ //Enables multiline for plain text control.
+ plainTextControl.ContentControlProperties.Multiline = true;
+ //Add new text to the content control
+ WTextRange textRange = new WTextRange(document);
+ textRange.Text = "Plain Text Content Control";
+ plainTextControl.ParagraphItems.Add(textRange);
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add new plain text content control to the paragraph.
+ paragraph.AppendInlineContentControl(ContentControlType.Text)
+ Dim plainTextControl As InlineContentControl = TryCast(paragraph.Items.LastItem, InlineContentControl)
+ 'Enables multiline for plain text control.
+ plainTextControl.ContentControlProperties.Multiline = True
+ 'Add new text to the content control
+ Dim textRange As New WTextRange(document)
+ textRange.Text = "Plain Text Content Control"
+ plainTextControl.ParagraphItems.Add(textRange)
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add new rich text content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.RichText);
+ //Add new text to the content control
+ WTextRange textRange = new WTextRange(document);
+ textRange.Text = "Rich Text Content Control";
+ (paragraph.Items.LastItem as InlineContentControl).ParagraphItems.Add(textRange);
+ InlineContentControl richTextControl = paragraph.Items.LastItem as InlineContentControl;
+ richTextControl.ParagraphItems.Add(textRange);
+ //Sets Tag appearance for the content control.
+ richTextControl.ContentControlProperties.Appearance = ContentControlAppearance.Tags;
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add new rich text content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.RichText)
+ 'Add new text to the content control
+ Dim textRange As New WTextRange(document)
+ textRange.Text = "Rich Text Content Control"
+ TryCast(paragraph.Items.LastItem, InlineContentControl).ParagraphItems.Add(textRange)
+ Dim richTextControl As InlineContentControl = TryCast(paragraph.Items.LastItem, InlineContentControl)
+ richTextControl.ParagraphItems.Add(textRange)
+ 'Sets Tag appearance for the content control.
+ richTextControl.ContentControlProperties.Appearance = ContentControlAppearance.Tags
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add new rich text content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.RichText);
+ //Add new text to the content control
+ WTextRange textRange = new WTextRange(document);
+ textRange.Text = "Rich Text Content Control";
+ (paragraph.Items.LastItem as InlineContentControl).ParagraphItems.Add(textRange);
+ InlineContentControl richTextControl = paragraph.Items.LastItem as InlineContentControl;
+ richTextControl.ParagraphItems.Add(textRange);
+ // Sets the Color property of content control.
+ richTextControl.ContentControlProperties.Color = Color.Blue;
+ //Add new text content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.Text);
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add new rich text content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.RichText)
+ 'Add new text to the content control
+ Dim textRange As New WTextRange(document)
+ textRange.Text = "Rich Text Content Control"
+ TryCast(paragraph.Items.LastItem, InlineContentControl).ParagraphItems.Add(textRange)
+ Dim richTextControl As InlineContentControl = TryCast(paragraph.Items.LastItem, InlineContentControl)
+ richTextControl.ParagraphItems.Add(textRange)
+ 'Sets the Color property of content control.
+ richTextControl.ContentControlProperties.Color = Color.Blue
+ 'Add new text content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.Text)
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add new rich text content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.RichText);
+ //Add new text to the content control
+ WTextRange textRange = new WTextRange(document);
+ textRange.Text = "Rich Text Content Control";
+ (paragraph.Items.LastItem as InlineContentControl).ParagraphItems.Add(textRange);
+ InlineContentControl richTextControl = paragraph.Items.LastItem as InlineContentControl;
+ richTextControl.ParagraphItems.Add(textRange);
+ // Sets Title property of the content control.
+ richTextControl.ContentControlProperties.Title = "Rich text content control";
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add new rich text content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.RichText)
+ 'Add new text to the content control
+ Dim textRange As New WTextRange(document)
+ textRange.Text = "Rich Text Content Control"
+ TryCast(paragraph.Items.LastItem, InlineContentControl).ParagraphItems.Add(textRange)
+ Dim richTextControl As InlineContentControl = TryCast(paragraph.Items.LastItem, InlineContentControl)
+ richTextControl.ParagraphItems.Add(textRange)
+ 'Sets Title property of the content control.
+ richTextControl.ContentControlProperties.Title = "Rich text content control"
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add new drop down list content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.DropDownList);
+ InlineContentControl dropDownList = paragraph.Items.LastItem as InlineContentControl;
+ //Set default option in drop down list.
+ WTextRange textRange = new WTextRange(document);
+ textRange.Text = "Choose an item";
+ dropDownList.ParagraphItems.Add(textRange);
+ //Add item into drop down list.
+ ContentControlListItem item = new ContentControlListItem();
+ item.Value = "1";
+ item.DisplayText = "DocIO";
+ //Add item into collection of drop down list items.
+ dropDownList.ContentControlProperties.ContentControlListItems.Add(item);
+ //Add item into drop down list.
+ item = new ContentControlListItem();
+ item.Value = "2";
+ item.DisplayText = "PDF";
+ //Add item into collection of drop down list items.
+ dropDownList.ContentControlProperties.ContentControlListItems.Add(item);
+ //Add combo box control.
+ IInlineContentControl comboboxControl = paragraph.AppendInlineContentControl(ContentControlType.ComboBox);
+ //Set default option in Combo box.
+ textRange = new WTextRange(document);
+ textRange.Text = "Choose an item";
+ comboboxControl.ParagraphItems.Add(textRange);
+ //Add item into combo box list.
+ item = new ContentControlListItem();
+ item.Value = "1";
+ item.DisplayText = "Windows";
+ //Add item into collection of combo box list items.
+ comboboxControl.ContentControlProperties.ContentControlListItems.Add(item);
+ //Add another item into combo box list.
+ item = new ContentControlListItem();
+ item.Value = "2";
+ item.DisplayText = "Xamarin";
+ //Add item into collection of combo box list items.
+ comboboxControl.ContentControlProperties.ContentControlListItems.Add(item);
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add new drop down list content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.DropDownList)
+ Dim dropDownList As InlineContentControl = TryCast(paragraph.Items.LastItem, InlineContentControl)
+ 'Set default option in drop down list.
+ Dim textRange As New WTextRange(document)
+ textRange.Text = "Choose an item"
+ dropDownList.ParagraphItems.Add(textRange)
+ 'Add item into drop down list.
+ Dim item As New ContentControlListItem()
+ item.Value = "1"
+ item.DisplayText = "DocIO"
+ 'Add item into collection of drop down list items.
+ dropDownList.ContentControlProperties.ContentControlListItems.Add(item)
+ 'Add item into drop down list.
+ item = New ContentControlListItem()
+ item.Value = "2"
+ item.DisplayText = "PDF"
+ 'Add item into collection of drop down list items.
+ dropDownList.ContentControlProperties.ContentControlListItems.Add(item)
+ 'Add combo box control.
+ Dim comboboxControl As IInlineContentControl = paragraph.AppendInlineContentControl(ContentControlType.ComboBox)
+ 'Set default option in Combo box.
+ textRange = New WTextRange(document)
+ textRange.Text = "Choose an item"
+ comboboxControl.ParagraphItems.Add(textRange)
+ 'Add item into combo box list.
+ item = New ContentControlListItem()
+ item.Value = "1"
+ item.DisplayText = "Windows"
+ 'Add item into collection of combo box list items.
+ comboboxControl.ContentControlProperties.ContentControlListItems.Add(item)
+ 'Add another item into combo box list.
+ item = New ContentControlListItem()
+ item.Value = "2"
+ item.DisplayText = "Xamarin"
+ 'Add item into collection of combo box list items.
+ comboboxControl.ContentControlProperties.ContentControlListItems.Add(item)
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ paragraph.AppendText("Plain Text");
+ //Add new plain text content control to the paragraph.
+ paragraph.AppendInlineContentControl(ContentControlType.Text);
+ InlineContentControl inlineContentControl = paragraph.Items.LastItem as InlineContentControl;
+ //Gets the type of content control.
+ ContentControlType controlType = inlineContentControl.ContentControlProperties.Type;
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ paragraph.AppendText("Plain Text")
+ 'Add new plain text content control to the paragraph.
+ paragraph.AppendInlineContentControl(ContentControlType.Text)
+ Dim inlineContentControl As InlineContentControl = TryCast(paragraph.Items.LastItem, InlineContentControl)
+ 'Gets the type of content control.
+ Dim controlType As ContentControlType = inlineContentControl.ContentControlProperties.Type
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add new rich text content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.RichText);
+ //Add new text to the content control
+ WTextRange textRange = new WTextRange(document);
+ textRange.Text = "Rich Text Content Control";
+ (paragraph.Items.LastItem as InlineContentControl).ParagraphItems.Add(textRange);
+ InlineContentControl richTextControl = paragraph.Items.LastItem as InlineContentControl;
+ richTextControl.ParagraphItems.Add(textRange);
+ // Sets Tag property of the content control.
+ richTextControl.ContentControlProperties.Tag = "RichText";
+ //Add new text content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.Text);
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add new rich text content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.RichText)
+ 'Add new text to the content control
+ Dim textRange As New WTextRange(document)
+ textRange.Text = "Rich Text Content Control"
+ TryCast(paragraph.Items.LastItem, InlineContentControl).ParagraphItems.Add(textRange)
+ Dim richTextControl As InlineContentControl = TryCast(paragraph.Items.LastItem, InlineContentControl)
+ richTextControl.ParagraphItems.Add(textRange)
+ 'Sets Tag property of the content control.
+ richTextControl.ContentControlProperties.Tag = "RichText"
+ 'Add new text content control to the paragraph
+ paragraph.AppendInlineContentControl(ContentControlType.Text)
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add one section and one paragraph to the document
+ document.EnsureMinimal();
+ //Get the last paragraph.
+ WParagraph paragraph = document.LastParagraph;
+ //Add text to the paragraph
+ paragraph.AppendText("A new text is added to the paragraph. ");
+ //Append checkbox content control to the paragraph
+ InlineContentControl checkBox = paragraph.AppendInlineContentControl(ContentControlType.CheckBox) as InlineContentControl;
+ //Get checked state of checkbox
+ CheckBoxState checkBoxCheckedState = checkBox.ContentControlProperties.CheckedState;
+ //Set font for checked state value
+ checkBoxCheckedState.Font = "Calibri";
+ //Set symbol for checked state value
+ checkBoxCheckedState.Value = "C";
+ //Get unchecked state of checkbox
+ CheckBoxState checkBoxUncheckedState = checkBox.ContentControlProperties.UncheckedState;
+ //Set font for unchecked state value
+ checkBoxUncheckedState.Font = "Calibri";
+ //Set symbol for unchecked state value
+ checkBoxUncheckedState.Value = "U";
+ //Set the state for checkbox
+ checkBox.ContentControlProperties.IsChecked = true;
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ 'Create a new Word document
+ Dim document As WordDocument = New WordDocument
+ 'Add one section and one paragraph to the document
+ document.EnsureMinimal
+ 'Get the last paragraph.
+ Dim paragraph As WParagraph = document.LastParagraph
+ 'Add text to the paragraph
+ paragraph.AppendText("A new text is added to the paragraph. ")
+ 'Append checkbox content control to the paragraph
+ Dim checkBox As InlineContentControl = CType(paragraph.AppendInlineContentControl(ContentControlType.CheckBox), InlineContentControl)
+ 'Get checked state of checkbox
+ Dim checkBoxCheckedState As CheckBoxState = checkBox.ContentControlProperties.CheckedState
+ 'Set font for checked state value
+ checkBoxCheckedState.Font = "Calibri"
+ 'Set symbol for checked state value
+ checkBoxCheckedState.Value = "C"
+ 'Get unchecked state of checkbox
+ Dim checkBoxUncheckedState As CheckBoxState = checkBox.ContentControlProperties.UncheckedState
+ 'Set font for unchecked state value
+ checkBoxUncheckedState.Font = "Calibri"
+ 'Set symbol for unchecked state value
+ checkBoxUncheckedState.Value = "U"
+ 'Set the state for checkbox
+ checkBox.ContentControlProperties.IsChecked = true
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close
+
+
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add new XmlPart to the section
+ CustomXMLPart xmlPart = new CustomXMLPart(document);
+ //Load the xml code.
+ xmlPart.Load(@"F:\XmlFile.xml");
+ //Add new content control to the paragraph.
+ InlineContentControl control = paragraph.AppendInlineContentControl(ContentControlType.Text) as InlineContentControl;
+ control.ContentControlProperties.XmlMapping.SetMapping("/books/book/author", "", xmlPart);
+ //Select the single node.
+ CustomXMLNode node = xmlPart.SelectSingleNode(control.ContentControlProperties.XmlMapping.XPath);
+ //Append text to second paragraph.
+ control = paragraph.AppendInlineContentControl(ContentControlType.Text) as InlineContentControl;
+ //Save the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Close the document
+ document.Close();
+
+
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add new XmlPart to the section
+ Dim xmlPart As New CustomXMLPart(document)
+ 'Load the xml code.
+ xmlPart.Load(@"F:\XmlFile.xml");
+ 'Append text to second paragraph.
+ control = TryCast(paragraph.AppendInlineContentControl(ContentControlType.Text), InlineContentControl)
+ 'Save the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Close the document
+ document.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Create a new list numbered list style
+ ListStyle listStyle = new ListStyle(document, ListType.Numbered);
+ //Set the name for the new list style
+ listStyle.Name = "UserdefinedList";
+ WListLevel levelOne = listStyle.Levels[0];
+ //Define the follow character, prefix, suffix, start index for level 0
+ levelOne.FollowCharacter = FollowCharacterType.Tab;
+ levelOne.NumberPrefix = "(";
+ levelOne.NumberSufix = ")";
+ levelOne.PatternType = ListPatternType.LowRoman;
+ levelOne.StartAt = 1;
+ levelOne.TabSpaceAfter = 5;
+ levelOne.NumberAlignment = ListNumberAlignment.Center;
+ document.ListStyles.Add(listStyle);
+ //Add new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Add text to the paragraph
+ paragraph.AppendText("The list of pets available:");
+ //Add other paragraphs and apply the created new list style
+ paragraph = section.AddParagraph();
+ //Apply default numbered list style
+ paragraph.ListFormat.ApplyStyle("UserdefinedList");
+ paragraph.AppendText("Dog");
+ paragraph = section.AddParagraph();
+
+ paragraph.ListFormat.ApplyStyle("UserdefinedList");
+ paragraph.AppendText("Cat");
+ //Continue last defined list
+ paragraph.ListFormat.ContinueListNumbering();
+ paragraph = section.AddParagraph();
+
+ paragraph.ListFormat.ApplyStyle("UserdefinedList");
+ paragraph.AppendText("Hamsters");
+ paragraph.ListFormat.ContinueListNumbering();
+
+ paragraph.ListFormat.ApplyStyle("UserdefinedList");
+ paragraph.AppendText("Turtles");
+ paragraph.ListFormat.ContinueListNumbering();
+ paragraph = section.AddParagraph();
+
+ paragraph.ListFormat.ApplyStyle("UserdefinedList");
+ paragraph.AppendText("Guinea Pigs");
+ paragraph.ListFormat.ContinueListNumbering();
+ paragraph = section.AddParagraph();
+
+ paragraph.ListFormat.ApplyStyle("UserdefinedList");
+ paragraph.AppendText("Ferrets");
+ paragraph.ListFormat.ContinueListNumbering();
+ paragraph = section.AddParagraph();
+
+ paragraph.ListFormat.ApplyStyle("UserdefinedList");
+ paragraph.AppendText("Fish");
+ paragraph.ListFormat.ContinueListNumbering();
+
+ //Save and close the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Create a new list numbered list style
+ Dim listStyle As New ListStyle(document, ListType.Numbered)
+ 'Set the name for the new list style
+ listStyle.Name = "UserdefinedList"
+ Dim levelOne As WListLevel = listStyle.Levels(0)
+ 'Define the follow character, prefix, suffix, start index for level 0
+ levelOne.FollowCharacter = FollowCharacterType.Tab
+ levelOne.NumberPrefix = "("
+ levelOne.NumberSufix = ")"
+ levelOne.PatternType = ListPatternType.LowRoman
+ levelOne.StartAt = 1
+ levelOne.TabSpaceAfter = 5
+ levelOne.NumberAlignment = ListNumberAlignment.Center
+ document.ListStyles.Add(listStyle)
+ 'Add new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Add text to the paragraph
+ paragraph.AppendText("The list of pets available:")
+ 'Add other paragraphs and apply the created new list style
+ paragraph = section.AddParagraph()
+ 'Apply default numbered list style
+ paragraph.ListFormat.ApplyStyle("UserdefinedList")
+ paragraph.AppendText("Dog")
+ paragraph = section.AddParagraph()
+
+ paragraph.ListFormat.ApplyStyle("UserdefinedList")
+ paragraph.AppendText("Cat")
+ 'Continue last defined list
+ paragraph.ListFormat.ContinueListNumbering()
+ paragraph = section.AddParagraph()
+
+ paragraph.ListFormat.ApplyStyle("UserdefinedList")
+ paragraph.AppendText("Hamsters")
+ paragraph.ListFormat.ContinueListNumbering()
+ paragraph = section.AddParagraph()
+
+ paragraph.ListFormat.ApplyStyle("UserdefinedList")
+ paragraph.AppendText("Turtles")
+ paragraph.ListFormat.ContinueListNumbering()
+ paragraph = section.AddParagraph()
+
+ paragraph.ListFormat.ApplyStyle("UserdefinedList")
+ paragraph.AppendText("Guinea Pigs")
+ paragraph.ListFormat.ContinueListNumbering()
+ paragraph = section.AddParagraph()
+
+ paragraph.ListFormat.ApplyStyle("UserdefinedList")
+ paragraph.AppendText("Ferrets")
+ paragraph.ListFormat.ContinueListNumbering()
+ paragraph = section.AddParagraph()
+
+ paragraph.ListFormat.ApplyStyle("UserdefinedList")
+ paragraph.AppendText("Fish")
+ paragraph.ListFormat.ContinueListNumbering()
+
+ 'Save and close the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Creates a new Word document
+ WordDocument document = new WordDocument();
+ //Adds new section to the document
+ IWSection section = document.AddSection();
+ //Adds new list style to the document
+ ListStyle listStyle = document.AddListStyle(ListType.Numbered, "UserDefinedList");
+ WListLevel levelOne = listStyle.Levels[0];
+ //Defines the follow character, prefix, suffix, start index for level 0
+ levelOne.FollowCharacter = FollowCharacterType.Tab;
+ levelOne.NumberPrefix = "(";
+ levelOne.NumberSuffix = ")";
+ //Adds new paragraph to the section
+ IWParagraph paragraph = section.AddParagraph();
+ //Adds text to the paragraph
+ paragraph.AppendText("User defined list - Level 0");
+ //Applies default numbered list style
+ paragraph.ListFormat.ApplyStyle("UserDefinedList");
+ //Saves the Word document
+ document.Save("Sample.docx", FormatType.Docx);
+ //Closes the document
+ document.Close();
+ }
+
+
+ Private Sub Button1_Click(sender As System.Object, e As System.EventArgs)
+ 'Creates a new Word document
+ Dim document As New WordDocument()
+ 'Adds new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Adds new list style to the document
+ Dim listStyle As ListStyle = document.AddListStyle(ListType.Numbered, "UserDefinedList")
+ Dim levelOne As WListLevel = listStyle.Levels(0)
+ 'Defines the follow character, prefix, suffix, start index for level 0
+ levelOne.FollowCharacter = FollowCharacterType.Tab
+ levelOne.NumberPrefix = "("
+ levelOne.NumberSuffix = ")"
+ 'Adds new paragraph to the section
+ Dim paragraph As IWParagraph = section.AddParagraph()
+ 'Adds text to the paragraph
+ paragraph.AppendText("User defined list - Level 0")
+ 'Applies default numbered list style
+ paragraph.ListFormat.ApplyStyle("UserDefinedList")
+ 'Saves the Word document
+ document.Save("Sample.docx", FormatType.Docx)
+ 'Closes the document
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Create a new Word document
+ WordDocument document = new WordDocument();
+ //Add new section to the document
+ IWSection section = document.AddSection();
+ //Creates Paragraph styles.
+ WParagraphStyle style = document.AddParagraphStyle("Heading 1") as WParagraphStyle;
+ //Applies the base style.
+ style.ApplyBaseStyle("Normal");
+ //Applies character formats.
+ style.CharacterFormat.FontName = "Calibri Light";
+ style.CharacterFormat.FontSize = 16f;
+ style.CharacterFormat.TextColor = System.Drawing.Color.FromArgb(46, 116, 181);
+ //Applies paragraph formats.
+ style.ParagraphFormat.BeforeSpacing = 12;
+ style.ParagraphFormat.AfterSpacing = 0;
+ style.ParagraphFormat.Keep = true;
+ style.ParagraphFormat.KeepFollow = true;
+ style.ParagraphFormat.OutlineLevel = OutlineLevel.Level1;
+ //Add new paragraph
+ WParagraph paragraph = section.AddParagraph() as WParagraph;
+ //Apply style
+ paragraph.ApplyStyle("Heading 1");
+ paragraph.AppendText("Applying paragraph style");
+ //Save and close the Word document
+ document.Save("Sample1.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Create a new Word document
+ Dim document As New WordDocument()
+ 'Add new section to the document
+ Dim section As IWSection = document.AddSection()
+ 'Creates Paragraph styles.
+ Dim style As WParagraphStyle = TryCast(document.AddParagraphStyle("Heading 1"), WParagraphStyle)
+ 'Applies the base style.
+ style.ApplyBaseStyle("Normal")
+ 'Applies character formats.
+ style.CharacterFormat.FontName = "Calibri Light"
+ style.CharacterFormat.FontSize = 16.0F
+ style.CharacterFormat.TextColor = System.Drawing.Color.FromArgb(46, 116, 181)
+ 'Applies paragraph formats.
+ style.ParagraphFormat.BeforeSpacing = 12
+ style.ParagraphFormat.AfterSpacing = 0
+ style.ParagraphFormat.Keep = True
+ style.ParagraphFormat.KeepFollow = True
+ style.ParagraphFormat.OutlineLevel = OutlineLevel.Level1
+ 'Add new paragraph
+ Dim paragraph As WParagraph = TryCast(section.AddParagraph(), WParagraph)
+ 'Apply style
+ paragraph.ApplyStyle("Heading 1")
+ paragraph.AppendText("Applying paragraph style")
+ 'Save and close the Word document
+ document.Save("Sample1.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ using (WordDocument document = new WordDocument())
+ {
+ document.EnsureMinimal();
+ WTable table = document.LastSection.AddTable() as WTable;
+ table.ResetCells(3, 2);
+ table[0, 0].AddParagraph().AppendText("Hi");
+ table[0, 1].AddParagraph().AppendText("Hi");
+ //Adds a new custom table style
+ WTableStyle tableStyle = document.AddTableStyle("CustomStyle1") as WTableStyle;
+ //Applies conditional formatting for first row
+ ConditionalFormattingStyle firstRowStyle = tableStyle.ConditionalFormattingStyles.Add(ConditionalFormattingType.FirstRow);
+ firstRowStyle.CharacterFormat.Bold = true;
+ firstRowStyle.CharacterFormat.TextColor = Color.FromArgb(255, 255, 255, 255);
+ firstRowStyle.CellProperties.BackColor = Color.Blue;
+ //Applies conditional formatting for first column
+ ConditionalFormattingStyle firstColumnStyle = tableStyle.ConditionalFormattingStyles.Add(ConditionalFormattingType.FirstColumn);
+ firstColumnStyle.CharacterFormat.Bold = true;
+ //Applies conditional formatting for odd row
+ ConditionalFormattingStyle oddRowBandingStyle = tableStyle.ConditionalFormattingStyles.Add(ConditionalFormattingType.OddRowBanding);
+ oddRowBandingStyle.CellProperties.BackColor = Color.Red;
+ //Apply built in table style as base style for CustomStyle2
+ tableStyle.ApplyBaseStyle(BuiltinTableStyle.TableContemporary);
+ //Applies the custom table style to the table
+ table.ApplyStyle("CustomStyle1");
+ //Saves and closes the document instance
+ document.Save("TableStyle.docx", FormatType.Docx);
+ }
+
+
+ Dim document As WordDocument = New WordDocument()
+ document.EnsureMinimal()
+ Dim table As WTable = TryCast(document.LastSection.AddTable(), WTable)
+ table.ResetCells(3, 2)
+ table(0, 0).AddParagraph().AppendText("Hi")
+ table(0, 1).AddParagraph().AppendText("Hi")
+ 'Adds a new custom table style
+ Dim tableStyle As WTableStyle = TryCast(document.AddTableStyle("CustomStyle1"), WTableStyle)
+ 'Applies conditional formatting for first row
+ Dim firstRowStyle As ConditionalFormattingStyle = tableStyle.ConditionalFormattingStyles.Add(ConditionalFormattingType.FirstRow)
+ firstRowStyle.CharacterFormat.Bold = True
+ firstRowStyle.CharacterFormat.TextColor = Color.FromArgb(255, 255, 255, 255)
+ firstRowStyle.CellProperties.BackColor = Color.Blue
+ 'Applies conditional formatting for first column
+ Dim firstColumnStyle As ConditionalFormattingStyle = tableStyle.ConditionalFormattingStyles.Add(ConditionalFormattingType.FirstColumn)
+ firstColumnStyle.CharacterFormat.Bold = True
+ 'Applies conditional formatting for odd row
+ Dim oddRowBandingStyle As ConditionalFormattingStyle = tableStyle.ConditionalFormattingStyles.Add(ConditionalFormattingType.OddRowBanding)
+ oddRowBandingStyle.CellProperties.BackColor = Color.Red
+ 'Apply built in table style as base style for CustomStyle2
+ tableStyle.ApplyBaseStyle(BuiltinTableStyle.TableContemporary)
+ 'Applies the custom table style to the table
+ table.ApplyStyle("CustomStyle1")
+ 'Saves and closes the document instance
+ document.Save("TableStyle.docx", FormatType.Docx)
+ document.Close()
+
+
+ WordDocument document = new WordDocument("Bookmarks.docx", FormatType.Docx);
+ //Create the bookmark navigator instance to access the bookmark
+ BookmarksNavigator bookmarkNavigator = new BookmarksNavigator(document);
+ //Move the virtual cursor to the before the end location of the bookmark "Northwind"
+ bookmarkNavigator.MoveToBookmark("Northwind");
+ //Get the bookmark content as a text body part.
+ TextBodyPart part = bookmarkNavigator.GetBookmarkContent();
+ //Convert the textbody part as a separate Word document.
+ WordDocument new_document = part.GetAsWordDocument();
+ //Save and close the document
+ new_document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+
+
+ Dim document As New WordDocument("Bookmarks.docx", FormatType.Docx)
+ 'Create the bookmark navigator instance to access the bookmark
+ Dim bookmarkNavigator As New BookmarksNavigator(document)
+ 'Move the virtual cursor to the before the end location of the bookmark "Northwind"
+ bookmarkNavigator.MoveToBookmark("Northwind")
+ 'Get the bookmark content as a text body part.
+ Dim part As TextBodyPart = bookmarkNavigator.GetBookmarkContent()
+ 'Convert the textbody part as a separate Word document.
+ Dim new_document As WordDocument = part.GetAsWordDocument()
+ 'Save and close the document
+ new_document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+
+
+ //Open the template document
+ WordDocument document = new WordDocument("Bookmarks.docx", FormatType.Docx);
+ //Create the bookmark navigator instance to access the bookmark
+ BookmarksNavigator bookmarkNavigator = new BookmarksNavigator(document);
+ //Move the virtual cursor to the before the end location of the bookmark "Northwind"
+ bookmarkNavigator.MoveToBookmark("Northwind");
+ //Get the bookmark content as a text body part.
+ TextBodyPart part = bookmarkNavigator.GetBookmarkContent();
+ //Paste the content as first item in the second paragraph.
+ part.PasteAt(document.Sections[0].Body, 1, 0);
+ //Save and close the document
+ document.Save("Result.docx", FormatType.Docx);
+ document.Close();
+
+
+ 'Open the template document
+ Dim document As New WordDocument("Bookmarks.docx", FormatType.Docx)
+ 'Create the bookmark navigator instance to access the bookmark
+ Dim bookmarkNavigator As New BookmarksNavigator(document)
+ 'Move the virtual cursor to the before the end location of the bookmark "Northwind"
+ bookmarkNavigator.MoveToBookmark("Northwind")
+ 'Get the bookmark content as a text body part.
+ Dim part As TextBodyPart = bookmarkNavigator.GetBookmarkContent()
+ 'Paste the content as first item in the second paragraph.
+ part.PasteAt(document.Sections(0).Body, 1, 0)
+ 'Save and close the document
+ document.Save("Result.docx", FormatType.Docx)
+ document.Close()
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Open a new Word document
+ WordDocument document = new WordDocument("Template.docx");
+ //Initialize a new instance of TextConverter class
+ TextConverter converter = new TextConverter();
+ //Get the text contents from the template document
+ string text = converter.GetText(document);
+ //Create new Word document
+ WordDocument textDocument = new WordDocument();
+ textDocument.EnsureMinimal();
+ //Add the text to the newly created document
+ textDocument.LastParagraph.AppendText(text);
+ //Save and close the document.
+ textDocument.Save("Sample.txt", FormatType.Txt);
+ document.Close();
+ textDocument.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Open a new Word document
+ Dim document As New WordDocument("Template.docx")
+ 'Initialize a new instance of TextConverter class
+ Dim converter As New TextConverter()
+ 'Get the text contents from the template document
+ Dim text As String = converter.GetText(document)
+ 'Create new Word document
+ Dim textDocument As New WordDocument()
+ textDocument.EnsureMinimal()
+ 'Add the text to the newly created document
+ textDocument.LastParagraph.AppendText(text)
+ 'Save and close the document.
+ textDocument.Save("Sample.txt", FormatType.Txt)
+ document.Close()
+ textDocument.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ FileStream fs = new FileStream("Result.txt", FileMode.Open, FileAccess.Read);
+ StreamReader reader = new StreamReader(fs);
+ reader.BaseStream.Position = 0;
+ //Create the new TextConverter
+ TextConverter txtConverter = new TextConverter();
+ //Write the text file to document
+ txtConverter.Read(reader, document);
+ reader.Dispose();
+ fs.Dispose();
+ //Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx);
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ Dim fs As New FileStream("Result.txt", FileMode.Open, FileAccess.Read)
+ Dim reader As New StreamReader(fs)
+ reader.BaseStream.Position = 0
+ 'Create the new TextConverter
+ Dim txtConverter As New TextConverter()
+ 'Write the text file to document
+ txtConverter.Read(reader, document)
+ reader.Dispose()
+ fs.Dispose()
+ 'Save and close the Word document instance
+ document.Save("Sample.docx", FormatType.Docx)
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Load an existing Word document into DocIO instance
+ WordDocument document = new WordDocument("Template.docx");
+ FileStream fs = new FileStream("Result.txt", FileMode.OpenOrCreate, FileAccess.ReadWrite);
+ StreamWriter writer = new StreamWriter(fs);
+ //Create the new TextConverter
+ TextConverter txtConverter = new TextConverter();
+ //Write the document to text file
+ txtConverter.Write(writer, document);
+ writer.Flush();
+ writer.Dispose();
+ fs.Dispose();
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Load an existing Word document into DocIO instance
+ Dim document As New WordDocument("Template.docx")
+ Dim fs As New FileStream("Result.txt", FileMode.OpenOrCreate, FileAccess.ReadWrite)
+ Dim writer As New StreamWriter(fs)
+ 'Create the new TextConverter
+ Dim txtConverter As New TextConverter()
+ 'Write the document to text file
+ txtConverter.Write(writer, document)
+ writer.Flush()
+ writer.Dispose()
+ fs.Dispose()
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Open the template document
+ WordDocument document = new WordDocument("Bookmarks.docx", FormatType.Docx);
+ //Get the text body of first section
+ WTextBody textbody = document.Sections[0].Body;
+ //Gets the second paragraph
+ WParagraph paragraph = textbody.Paragraphs[1];
+ //Get the start and end items
+ ParagraphItem startItem = (ParagraphItem)paragraph.ChildEntities[0];
+ ParagraphItem endItem = (ParagraphItem)paragraph.ChildEntities[1];
+ //Selects the items in the text body
+ TextBodySelection selection = new TextBodySelection(startItem, endItem);
+ //Create new text body part
+ TextBodyPart textbodyPart = new TextBodyPart(document);
+ //Copy the selected items
+ textbodyPart.Copy(selection);
+ //Paste the selected items.
+ textbodyPart.PasteAt(textbody, 2);
+ //Save and close the document.
+ document.Save("Result.docx");
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Open the template document
+ Dim document As New WordDocument("Bookmarks.docx", FormatType.Docx)
+ 'Get the text body of first section
+ Dim textbody As WTextBody = document.Sections(0).Body
+ 'Gets the second paragraph
+ Dim paragraph As WParagraph = textbody.Paragraphs(1)
+ 'Get the start and end items
+ Dim startItem As ParagraphItem = DirectCast(paragraph.ChildEntities(0), ParagraphItem)
+ Dim endItem As ParagraphItem = DirectCast(paragraph.ChildEntities(1), ParagraphItem)
+ 'Selects the items in the text body
+ Dim selection As New TextBodySelection(startItem, endItem)
+ 'Create new text body part
+ Dim textbodyPart As New TextBodyPart(document)
+ 'Copy the selected items
+ textbodyPart.Copy(selection)
+ 'Paste the selected items.
+ textbodyPart.PasteAt(textbody, 2)
+ 'Save and close the document.
+ document.Save("Result.docx")
+ document.Close()
+ End Sub
+
+
+ private void Button1_Click(System.Object sender, System.EventArgs e)
+ {
+ //Open the template document
+ WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
+ //Get the text body of first section
+ WTextBody textbody = document.Sections[0].Body;
+ //Selects the items in the text body
+ TextBodySelection selection = new TextBodySelection(textbody, 0, 1, 0, 1);
+ //Create new text body part
+ TextBodyPart textbodyPart = new TextBodyPart(document);
+ //Copy the selected items
+ textbodyPart.Copy(selection);
+ //Paste the selected items.
+ textbodyPart.PasteAt(textbody, 2);
+ //Save and close the document.
+ document.Save("Sample.docx");
+ document.Close();
+ }
+
+
+ Private Sub button_Click(sender As Object, e As EventArgs)
+ 'Open the template document
+ Dim document As New WordDocument("Template.docx", FormatType.Docx)
+ 'Get the text body of first section
+ Dim textbody As WTextBody = document.Sections(0).Body
+ 'Selects the items in the text body
+ Dim selection As New TextBodySelection(textbody, 0, 1, 0, 1)
+ 'Create new text body part
+ Dim textbodyPart As New TextBodyPart(document)
+ 'Copy the selected items
+ textbodyPart.Copy(selection)
+ 'Paste the selected items.
+ textbodyPart.PasteAt(textbody, 2)
+ 'Save and close the document.
+ document.Save("Sample.docx")
+ document.Close()
+ End Sub
+
+
+ public delegate string LibraryFunction(string args);
+
+
+ //Register three ICalcData objects so cell can be referenced across ICalcData objects:
+ int sheetfamilyID = CalcEngine.CreateSheetFamilyID();
+ myCalcEngine.RegisterGridAsSheet("summary", calcData1, sheetfamilyID);
+ myCalcEngine.RegisterGridAsSheet("income", calcData2, sheetfamilyID);
+ myCalcEngine.RegisterGridAsSheet("expenses", calcData3, sheetfamilyID);
+ ....
+ //Sample formula usage for cells in calcData1, the 'summary' data source.
+ //This code sums ups some cells from calcData3, the 'expenses' data source
+ //and calcData2, the 'income' data source.
+ //Sum the range B2:B8 from expenses:
+ string sumExpenses = "= Sum(expenses!B2:expenses!B8)";
+ //Sum the range B2:B4 from income:
+ string sumIncome = "= Sum(income!B2:income!B4)";
+
+
+ 'Register three ICalcData objects so cell can be referenced across ICalcData objects:
+ Dim sheetfamilyID As Integer = CalcEngine.CreateSheetFamilyID();
+ myCalcEngine.RegisterGridAsSheet("summary", calcData1, sheetfamilyID)
+ myCalcEngine.RegisterGridAsSheet("income", calcData2, sheetfamilyID)
+ myCalcEngine.RegisterGridAsSheet("expenses", calcData3, sheetfamilyID)
+ ....
+ 'Sample formula usage for cells in calcData1, the 'summary' data source.
+ 'This code sums ups some cells from calcData3, the 'expenses' data source
+ 'and calcData2, the 'income' data source.
+ 'Sum the range B2:B8 from expenses:
+ Dim sumExpenses As String = "= Sum(expenses!B2:expenses!B8)"
+ 'Sum the range B2:B4 from income:
+ Dim sumIncome As String = "= Sum(income!B2:income!B4)"
+
+
+ nominalRate = npery * (Math.Pow(1 + effectRate, 1.0 / npery) - 1)
+
+ where
+ engine.ReservedWordOperators = new string[]
+ {
+ " or ", //0
+ " and ", //1
+ " xor ", //2
+ " if ", //3
+ " then ", //4
+ " else ", //5
+ " not " //6
+ };
+
+
+ public void DisplayAllAffectedCells()
+ {
+ CalcEngine engine = ((GridFormulaCellModel)this.gridControl1.CellModels["FormulaCell"]).Engine;
+ foreach(object o in engine.DependentCells.Keys)
+ {
+ string s1 = o as string;
+ Console.Write(s1 + " affects ");
+ ArrayList ht = (ArrayList) engine.DependentCells[s1];
+ foreach(object o1 in ht)
+ {
+ string s2 = o1 as string;
+ Console.Write(s2 + " ");
+ }
+ Console.WriteLine("");
+ }
+ }
+
+
+ Public Sub DisplayAllAffectedCells()
+ Dim engine As GridCalcEngine = CType(Me.gridControl1.CellModels("FormulaCell"), GridFormulaCellModel).Engine
+ Dim o As Object
+ For Each o In engine.DependentCells.Keys
+ Dim s1 As String = CStr(o)
+ Console.Write((s1 + " affects "))
+ Dim ht As ArrayList = CType(engine.DependentCells(s1), ArrayList)
+ Dim o1 As Object
+ For Each o1 In ht
+ Dim s2 As String = CStr(o1)
+ Console.Write((s2 + " "))
+ Next o1
+ Console.WriteLine("")
+ Next o
+ End Sub 'DisplayAllAffectedCells
+
+
+ public void DisplayAllFormulaDependencies()
+ {
+ GridCalcEngine engine = ((GridFormulaCellModel)this.gridControl1.CellModels["FormulaCell"]).Engine;
+ foreach(object o in engine.DependentFormulaCells.Keys)
+ {
+ string s1 = o as string;
+ Console.Write(s1 + " depends upon ");
+ Hashtable ht = (Hashtable) engine.DependentFormulaCells[s1];
+ foreach(object o1 in ht.Keys)
+ {
+ string s2 = o1 as string;
+ Console.Write(s2 + " ");
+ }
+ Console.WriteLine("");
+ }
+ }
+
+
+ Public Sub DisplayAllFormulaDependencies()
+ Dim engine As GridCalcEngine = CType(Me.gridControl1.CellModels("FormulaCell"), GridFormulaCellModel).Engine
+
+ Dim o As Object
+ For Each o In engine.DependentFormulaCells.Keys
+ Dim s1 As String = CStr(o)
+ Console.Write((s1 + " depends upon "))
+ Dim ht As Hashtable = CType(engine.DependentFormulaCells(s1), Hashtable)
+ Dim o1 As Object
+ For Each o1 In ht.Keys
+ Dim s2 As String = CStr(o1)
+ Console.Write((s2 + " "))
+ Next o1
+ Console.WriteLine("")
+ Next o
+ End Sub 'DisplayAllFormulaDependencies
+
+
+ //subscribe to the event before any formulas are loaded into the grid...
+ Engine.FormulaParsing += new FormulaParsingEventHandler(Engine_FormulaParsing);
+
+ //Here is the handler code that adds an = if necessary so any string beginning with +, - or =
+ //is treated as a formula.
+ void Engine_FormulaParsing(object sender, FormulaParsingEventArgs e)
+ {
+ //allow cells starting with + and - to be treated as formula cells.
+ if (e.Text.StartsWith("-"))
+ e.Text = "=" + e.Text;
+ else if (e.Text.StartsWith("+"))
+ e.Text = "=" + e.Text.Substring(1);
+ }
+
+
+ CalcQuick calculator = null;
+ private void AngleForm_Load(object sender, System.EventArgs e)
+ {
+ //TextBox Angle = new TextBox();
+ this.Angle.Name = "Angle";
+ this.Angle.Text = "30";
+ //cosTB = new TextBox();
+ this.cosTB.Name = "cosTB";
+ this.cosTB.Text = "= cos([Angle] * pi() / 180) ";
+ //sinTB = new TextBox();
+ this.sinTB.Name = "sinTB";
+ this.sinTB.Text = "= sin([Angle] * pi() / 180) ";
+ // Instantiate the CalcQuick object:
+ this.calculator = new CalcQuick();
+ }
+ // Perform a manual calculation:
+ private void ComputeButton_Click(object sender, System.EventArgs e)
+ {
+ // Let the calculator know the values/formulas
+ // by using an indexer on the calculator object.
+ // Here we are using the TextBox.Name as the indexer key
+ // provided to the calculator object. This is not required.
+ // The only restriction for the indexer key values is that they
+ // be unique nonempty strings:
+ this.calculator["Angle"] = this.Angle.Text;
+ this.calculator["cosTB"] = this.cosTB.Text;
+ this.calculator["sinTB"] = this.sinTB.Text;
+ // Mark the calculator dirty:
+ this.calculator.SetDirty();
+ // Now as the values are retrieved from the calculator, they
+ // will be the newly calculated values:
+ this.cosTB.Text = this.calculator["cosTB"];
+ this.sinTB.Text = this.calculator["sinTB"];
+ }
+
+
+ Dim calculator As CalcQuick = Nothing
+ Private Sub AngleForm_Load(sender As Object, e As System.EventArgs)
+ 'TextBox Angle = new TextBox();
+ Me.Angle.Name = "Angle"
+ Me.Angle.Text = "30"
+ 'cosTB = new TextBox();
+ Me.cosTB.Name = "cosTB"
+ Me.cosTB.Text = "= cos([Angle] * pi() / 180) "
+
+ 'sinTB = new TextBox();
+ Me.sinTB.Name = "sinTB"
+ Me.sinTB.Text = "= sin([Angle] * pi() / 180) "
+
+ 'Instantiate the CalcQuick object:
+ Me.calculator = New CalcQuick()
+ End Sub 'AngleForm_Load
+
+ 'Perform a manual calculation:
+ Private Sub ComputeButton_Click(sender As Object, e As System.EventArgs)
+ 'Let the calculator know the values/formulas
+ 'by using an indexer on the calculator object.
+ 'Here we are using the TextBox.Name as the indexer key
+ 'provided to the calculator object. This is not required.
+ 'The only restriction for the indexer key values is that they
+ 'be unique nonempty strings:
+ Me.calculator("Angle") = Me.Angle.Text
+ Me.calculator("cosTB") = Me.cosTB.Text
+ Me.calculator("sinTB") = Me.sinTB.Text
+
+ 'Mark the calculator dirty:
+ Me.calculator.SetDirty()
+
+ 'Now as the values are retrieved from the calculator, they
+ 'will be the newly calculated values:
+ Me.cosTB.Text = Me.calculator("cosTB")
+ Me.sinTB.Text = Me.calculator("sinTB")
+ End Sub 'ComputeButton_Click
+
+ Here is code that uses the same three TextBoxes as above, but this time
+ the code is set up to automatically compute things as you change the
+ value in the Angle TextBox. There is no longer a need for a button handler
+ to trigger setting / getting values.
+
+ CalcQuick calculator = null;
+
+ private void AngleForm_Load(object sender, System.EventArgs e)
+ {
+ //TextBox Angle = new TextBox();
+ this.Angle.Name = "Angle";
+ this.Angle.Text = "30";
+
+ //cosTB = new TextBox();
+ this.cosTB.Name = "cosTB";
+ this.cosTB.Text = "= cos([Angle] * pi() / 180) ";
+
+ //sinTB = new TextBox();
+ this.sinTB.Name = "sinTB";
+ this.sinTB.Text = "= sin([Angle] * pi() / 180) ";
+
+ // Instantiate the CalcQuick object:
+ this.calculator = new CalcQuick();
+ }
+
+ // Perform a manual calculation:
+ private void ComputeButton_Click(object sender, System.EventArgs e)
+ {
+ // Let the calculator know the values/formulas
+ // by using an indexer on the calculator object.
+ // Here we are using the TextBox.Name as the indexer key
+ // provided to the calculator object. This is not required.
+ // The only restriction for the indexer key values is that they
+ // be unique nonempty strings:
+ this.calculator["Angle"] = this.Angle.Text;
+ this.calculator["cosTB"] = this.cosTB.Text;
+ this.calculator["sinTB"] = this.sinTB.Text;
+
+ // Mark the calculator dirty:
+ this.calculator.SetDirty();
+
+ // Now as the values are retrieved from the calculator, they
+ // will be the newly calculated values:
+ this.cosTB.Text = this.calculator["cosTB"];
+ this.sinTB.Text = this.calculator["sinTB"];
+ }
+
+
+ Dim calculator As CalcQuick = Nothing
+
+ Private Sub AngleForm_Load(sender As Object, e As System.EventArgs)
+ 'TextBox Angle = new TextBox();
+ Me.Angle.Name = "Angle"
+ Me.Angle.Text = "30"
+
+ 'cosTB = new TextBox();
+ Me.cosTB.Name = "cosTB"
+ Me.cosTB.Text = "= cos([Angle] * pi() / 180) "
+
+ 'sinTB = new TextBox();
+ Me.sinTB.Name = "sinTB"
+ Me.sinTB.Text = "= sin([Angle] * pi() / 180) "
+
+ 'Instantiate the CalcQuick object:
+ Me.calculator = New CalcQuick()
+ End Sub 'AngleForm_Load
+
+ 'Perform a manual calculation:
+ Private Sub ComputeButton_Click(sender As Object, e As System.EventArgs)
+ 'Let the calculator know the values/formulas
+ 'by using an indexer on the calculator object.
+ 'Here we are using the TextBox.Name as the indexer key
+ 'provided to the calculator object. This is not required.
+ 'The only restriction for the indexer key values is that they
+ 'be unique nonempty strings:
+ Me.calculator("Angle") = Me.Angle.Text
+ Me.calculator("cosTB") = Me.cosTB.Text
+ Me.calculator("sinTB") = Me.sinTB.Text
+
+ 'Mark the calculator dirty:
+ Me.calculator.SetDirty()
+
+ 'Now as the values are retrieved from the calculator, they
+ 'will be the newly calculated values:
+ Me.cosTB.Text = Me.calculator("cosTB")
+ Me.sinTB.Text = Me.calculator("sinTB")
+ End Sub 'ComputeButton_Click
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the chart title
+ chart.ChartTitle = "This is a chart Title";
+ //Invoke the begin update method
+ chart.ChartTitleArea.BeginUpdate();
+ //Set the bold font style
+ chart.ChartTitleArea.Bold = true;
+ //Set the color of the text area
+ chart.ChartTitleArea.Color = OfficeKnownColors.Plum;
+ //Invoke end update method
+ chart.ChartTitleArea.EndUpdate();
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Set the chart title
+ chart.ChartTitle = "This is a chart Title"
+ 'Invoke the begin update method
+ chart.ChartTitleArea.BeginUpdate()
+ 'Set the bold font style
+ chart.ChartTitleArea.Bold = True
+ 'Set the color of the text area
+ chart.ChartTitleArea.Color = OfficeKnownColors.Plum
+ 'Invoke end update method
+ chart.ChartTitleArea.EndUpdate()
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the chart title
+ chart.ChartTitle = "This is a chart Title";
+ //Invoke the begin update method
+ chart.ChartTitleArea.BeginUpdate();
+ //Set the bold font style
+ chart.ChartTitleArea.Bold = true;
+ //Set the color of the text area
+ chart.ChartTitleArea.Color = OfficeKnownColors.Plum;
+ //Invoke end update method
+ chart.ChartTitleArea.EndUpdate();
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Set the chart title
+ chart.ChartTitle = "This is a chart Title"
+ 'Invoke the begin update method
+ chart.ChartTitleArea.BeginUpdate()
+ 'Set the bold font style
+ chart.ChartTitleArea.Bold = True
+ 'Set the color of the text area
+ chart.ChartTitleArea.Color = OfficeKnownColors.Plum
+ 'Invoke end update method
+ chart.ChartTitleArea.EndUpdate()
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ ISlide slide = presentation.Slides[0];
+ //Get the chart from slide
+ IPresentationChart chart = slide.Shapes[0] as IPresentationChart;
+ //Create an instance of chart axis
+ //Set the number format of axis
+ chartAxis.NumberFormat = "Number";
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation As IPresentation = Presentation.Open("Template.pptx")
+ Dim slide As ISlide = presentation.Slides(0)
+ 'Get the chart from slide
+ Dim chart As IPresentationChart= TryCast(slide.Shapes(0), IPresentationChart)
+ 'Create an instance of chart axis
+ 'Set the number format of axis
+ chartAxis.NumberFormat = "Number"
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ ISlide slide = presentation.Slides[0];
+ //Get the chart from slide
+ IPresentationChart chart = slide.Shapes[0] as IPresentationChart;
+ //Create an instance of chart axis
+ IOfficeChartAxis chartAxis = chart.PrimaryValueAxis;
+ //Get the chart axis type, read only
+ OfficeAxisType axisType = chartAxis.AxisType;
+ //Enable reverse plot order
+ chartAxis.ReversePlotOrder = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation As IPresentation = Presentation.Open("Template.pptx")
+ Dim slide As ISlide = presentation.Slides(0)
+ 'Get the chart from slide
+ Dim chart As IPresentationChart= TryCast(slide.Shapes(0), IPresentationChart)
+ 'Create an instance of chart axis
+ Dim chartAxis As IOfficeChartAxis = chart.PrimaryValueAxis
+ 'Get the chart axis type, read only
+ Dim axisType As OfficeAxisType = chartAxis.AxisType
+ 'Enable reverse plot order
+ chartAxis.ReversePlotOrder = True
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ ISlide slide = presentation.Slides[0];
+ //Get the chart from slide
+ IPresentationChart chart = slide.Shapes[0] as IPresentationChart;
+ //Create an instance of chart axis
+ IOfficeChartAxis chartAxis = chart.PrimaryValueAxis;
+ chartAxis.ReversePlotOrder = true;
+ //Set the text rotation angle
+ chartAxis.TextRotationAngle = 30;
+ //Set the title
+ chartAxis.Title = "Chart Axis";
+ //Set the font style for title area
+ chartAxis.TitleArea.Bold = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation As IPresentation = Presentation.Open("Template.pptx")
+ Dim slide As ISlide = presentation.Slides(0)
+ 'Get the chart from slide
+ Dim chart As IPresentationChart= TryCast(slide.Shapes(0), IPresentationChart)
+ 'Create an instance of chart axis
+ Dim chartAxis As IOfficeChartAxis = chart.PrimaryValueAxis
+ chartAxis.ReversePlotOrder = True
+ 'Set the text rotation angle
+ chartAxis.TextRotationAngle = 30
+ 'Set the title
+ chartAxis.Title = "Chart Axis"
+ 'Set the font style for title area
+ chartAxis.TitleArea.Bold = True
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ ISlide slide = presentation.Slides[0];
+ //Get the chart from slide
+ IPresentationChart chart = slide.Shapes[0] as IPresentationChart;
+ //Create an instance of chart axis
+ IOfficeChartAxis chartAxis = chart.PrimaryValueAxis;
+ chartAxis.ReversePlotOrder = true;
+ //Set the text rotation angle
+ chartAxis.TextRotationAngle = 50;
+ //Set the title
+ chartAxis.Title = "Chart Axis";
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation As IPresentation = Presentation.Open("Template.pptx")
+ Dim slide As ISlide = presentation.Slides(0)
+ 'Get the chart from slide
+ Dim chart As IPresentationChart= TryCast(slide.Shapes(0), IPresentationChart)
+ 'Create an instance of chart axis
+ Dim chartAxis As IOfficeChartAxis = chart.PrimaryValueAxis
+ chartAxis.ReversePlotOrder = True
+ 'Set the text rotation angle
+ chartAxis.TextRotationAngle = 30
+ 'Set the title
+ chartAxis.Title = "Chart Axis"
+ 'Set the font style for title area
+ chartAxis.TitleArea.Bold = True
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ ISlide slide = presentation.Slides[0];
+ //Get the chart from slide
+ IPresentationChart chart = slide.Shapes[0] as IPresentationChart;
+ //Create an instance of chart axis
+ IOfficeChartAxis chartAxis = chart.PrimaryValueAxis;
+ chartAxis.ReversePlotOrder = true;
+ //Set the text rotation angle
+ chartAxis.TextRotationAngle = 30;
+ //Set the title
+ chartAxis.Title = "Chart Axis";
+ //Set the font style for title area
+ chartAxis.TitleArea.Bold = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation As IPresentation = Presentation.Open("Template.pptx")
+ Dim slide As ISlide = presentation.Slides(0)
+ 'Get the chart from slide
+ Dim chart As IPresentationChart= TryCast(slide.Shapes(0), IPresentationChart)
+ 'Create an instance of chart axis
+ Dim chartAxis As IOfficeChartAxis = chart.PrimaryValueAxis
+ chartAxis.ReversePlotOrder = True
+ 'Set the text rotation angle
+ chartAxis.TextRotationAngle = 30
+ 'Set the title
+ chartAxis.Title = "Chart Axis"
+ 'Set the font style for title area
+ chartAxis.TitleArea.Bold = True
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ ISlide slide = presentation.Slides[0];
+ //Get the chart from slide
+ IPresentationChart chart = slide.Shapes[0] as IPresentationChart;
+ //Create an instance of chart axis
+ IOfficeChartAxis chartAxis = chart.PrimaryValueAxis;
+ //Set auto tick label spacing
+ chartAxis.AutoTickLabelSpacing = true;
+ //Set the border of chart axis
+ chartAxis.Border.LineWeight = OfficeChartLineWeight.Medium;
+ //Set 3D options for chart
+ chartAxis.Chart3DOptions.BevelBottomWidth = 200;
+ //Set the font color for chart axis
+ chartAxis.Font.Color = OfficeKnownColors.Lavender;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation As IPresentation = Presentation.Open("Template.pptx")
+ Dim slide As ISlide = presentation.Slides(0)
+ 'Get the chart from slide
+ Dim chart As IPresentationChart= TryCast(slide.Shapes(0), IPresentationChart)
+ 'Create an instance of chart axis
+ Dim chartAxis As IOfficeChartAxis = chart.PrimaryValueAxis
+ 'Set auto tick label spacing
+ chartAxis.AutoTickLabelSpacing = True
+ 'Set the border of chart axis
+ chartAxis.Border.LineWeight = OfficeChartLineWeight.Medium
+ 'Set 3D options for chart
+ chartAxis.Chart3DOptions.BevelBottomWidth = 200
+ 'Set the font color for chart axis
+ chartAxis.Font.Color = OfficeKnownColors.Lavender
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ ISlide slide = presentation.Slides[0];
+ //Get the chart from slide
+ IPresentationChart chart = slide.Shapes[0] as IPresentationChart;
+ //Create an instance of chart axis
+ IOfficeChartAxis chartAxis = chart.PrimaryValueAxis;
+ //Set major gridline
+ chartAxis.HasMajorGridLines = true;
+ //Get the major gridline of chart axis, read only
+ IOfficeChartGridLine gridline = chartAxis.MajorGridLines;
+ //Set border of major grid line
+ gridline.Border.AutoFormat = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ Dim slide As ISlide = presentation__1.Slides(0)
+ 'Get the chart from slide
+ Dim chart As IPresentationChart = TryCast(slide.Shapes(0), IPresentationChart)
+ 'Create an instance of chart axis
+ Dim chartAxis As IOfficeChartAxis = chart.PrimaryValueAxis
+ 'Set major gridline
+ chartAxis.HasMajorGridLines = True
+ 'Get the major gridline of chart axis, read only
+ Dim gridline As IOfficeChartGridLine = chartAxis.MajorGridLines
+ 'Set border of major grid line
+ gridline.Border.AutoFormat = True
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ ISlide slide = presentation.Slides[0];
+ //Get the chart from slide
+ IPresentationChart chart = slide.Shapes[0] as IPresentationChart;
+ //Create an instance of chart axis
+ IOfficeChartAxis chartAxis = chart.PrimaryValueAxis;
+ //Set minor gridline
+ chartAxis.HasMinorGridLines = true;
+ //Get the minor gridline of chart axis, read only
+ IOfficeChartGridLine gridline = chartAxis.MinorGridLines;
+ //Set border of minor grid line
+ gridline.Border.AutoFormat = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ Dim slide As ISlide = presentation__1.Slides(0)
+ 'Get the chart from slide
+ Dim chart As IPresentationChart = TryCast(slide.Shapes(0), IPresentationChart)
+ 'Create an instance of chart axis
+ Dim chartAxis As IOfficeChartAxis = chart.PrimaryValueAxis
+ 'Set minor gridline
+ chartAxis.HasMinorGridLines = True
+ 'Get the minor gridline of chart axis, read only
+ Dim gridline As IOfficeChartGridLine = chartAxis.MinorGridLines
+ 'Set border of minor grid line
+ gridline.Border.AutoFormat = True
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ ISlide slide = presentation.Slides[0];
+ //Get the chart from slide
+ IPresentationChart chart = slide.Shapes[0] as IPresentationChart;
+ //Create an instance of chart axis
+ IOfficeChartAxis chartAxis = chart.PrimaryValueAxis;
+ //Set 3D options for chart
+ chartAxis.Chart3DOptions.BevelBottomWidth = 200;
+ //Set the font color for chart axis
+ chartAxis.Font.Color = OfficeKnownColors.Lavender;
+ //Set the minor grid lines
+ chartAxis.HasMinorGridLines = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ Dim slide As ISlide = presentation__1.Slides(0)
+ 'Get the chart from slide
+ Dim chart As IPresentationChart = TryCast(slide.Shapes(0), IPresentationChart)
+ 'Create an instance of chart axis
+ Dim chartAxis As IOfficeChartAxis = chart.PrimaryValueAxis
+ 'Set 3D options for chart
+ chartAxis.Chart3DOptions.BevelBottomWidth = 200
+ 'Set the font color for chart axis
+ chartAxis.Font.Color = OfficeKnownColors.Lavender
+ 'Set the minor grid lines
+ chartAxis.HasMinorGridLines = True
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ ISlide slide = presentation.Slides[0];
+ //Get the chart from slide
+ IPresentationChart chart = slide.Shapes[0] as IPresentationChart;
+ //Create an instance of chart axis
+ IOfficeChartAxis chartAxis = chart.PrimaryValueAxis;
+ //Set minor gridline
+ chartAxis.HasMinorGridLines = true;
+ //Set the font color for chart axis
+ chartAxis.Font.Color = OfficeKnownColors.Lavender;
+ //Set the major gridlines
+ chartAxis.HasMajorGridLines = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ Dim slide As ISlide = presentation__1.Slides(0)
+ 'Get the chart from slide
+ Dim chart As IPresentationChart = TryCast(slide.Shapes(0), IPresentationChart)
+ 'Create an instance of chart axis
+ Dim chartAxis As IOfficeChartAxis = chart.PrimaryValueAxis
+ 'Set minor gridline
+ chartAxis.HasMinorGridLines = True
+ 'Set the font color for chart axis
+ chartAxis.Font.Color = OfficeKnownColors.Lavender
+ 'Set the major gridlines
+ chartAxis.HasMajorGridLines = True
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ ISlide slide = presentation.Slides[0];
+ //Get the chart from slide
+ IPresentationChart chart = slide.Shapes[0] as IPresentationChart;
+ //Create an instance of chart axis
+ IOfficeChartAxis chartAxis = chart.PrimaryValueAxis;
+ //Set the border of chart axis
+ chartAxis.Border.LineWeight = OfficeChartLineWeight.Medium;
+ //Set 3D options for chart
+ chartAxis.Chart3DOptions.BevelBottomWidth = 200;
+ //Set the font color for chart axis
+ chartAxis.Font.Color = OfficeKnownColors.Lavender;
+ //Set the minor tick mark
+ chartAxis.MinorTickMark = OfficeTickMark.TickMark_Outside;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ Dim slide As ISlide = presentation__1.Slides(0)
+ 'Get the chart from slide
+ Dim chart As IPresentationChart = TryCast(slide.Shapes(0), IPresentationChart)
+ 'Create an instance of chart axis
+ Dim chartAxis As IOfficeChartAxis = chart.PrimaryValueAxis
+ 'Set the border of chart axis
+ chartAxis.Border.LineWeight = OfficeChartLineWeight.Medium
+ 'Set 3D options for chart
+ chartAxis.Chart3DOptions.BevelBottomWidth = 200
+ 'Set the font color for chart axis
+ chartAxis.Font.Color = OfficeKnownColors.Lavender
+ 'Set the minor tick mark
+ chartAxis.MinorTickMark = OfficeTickMark.TickMark_Outside
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ ISlide slide = presentation.Slides[0];
+ //Get the chart from slide
+ IPresentationChart chart = slide.Shapes[0] as IPresentationChart;
+ //Create an instance of chart axis
+ IOfficeChartAxis chartAxis = chart.PrimaryValueAxis;
+ //Set the border of chart axis
+ chartAxis.Border.LineWeight = OfficeChartLineWeight.Medium;
+ //Set 3D options for chart
+ chartAxis.Chart3DOptions.BevelBottomWidth = 200;
+ //Set the font color for chart axis
+ chartAxis.Font.Color = OfficeKnownColors.Lavender;
+ //Set the major tick mark
+ chartAxis.MajorTickMark = OfficeTickMark.TickMark_Inside;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ Dim slide As ISlide = presentation__1.Slides(0)
+ 'Get the chart from slide
+ Dim chart As IPresentationChart = TryCast(slide.Shapes(0), IPresentationChart)
+ 'Create an instance of chart axis
+ Dim chartAxis As IOfficeChartAxis = chart.PrimaryValueAxis
+ 'Set the border of chart axis
+ chartAxis.Border.LineWeight = OfficeChartLineWeight.Medium
+ 'Set 3D options for chart
+ chartAxis.Chart3DOptions.BevelBottomWidth = 200
+ 'Set the font color for chart axis
+ chartAxis.Font.Color = OfficeKnownColors.Lavender
+ 'Set the major tick mark
+ chartAxis.MajorTickMark = OfficeTickMark.TickMark_Inside
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ ISlide slide = presentation.Slides[0];
+ //Get the chart from slide
+ IPresentationChart chart = slide.Shapes[0] as IPresentationChart;
+ //Create an instance of chart axis
+ IOfficeChartAxis chartAxis = chart.PrimaryValueAxis;
+ //Set auto tick label spacing
+ chartAxis.AutoTickLabelSpacing = true;
+ //Set the border of chart axis
+ chartAxis.Border.LineWeight = OfficeChartLineWeight.Medium;
+ //Set 3D options for chart
+ chartAxis.Chart3DOptions.BevelBottomWidth = 200;
+ //Set the font color for chart axis
+ chartAxis.Font.Color = OfficeKnownColors.Lavender;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation As IPresentation = Presentation.Open("Template.pptx")
+ Dim slide As ISlide = presentation.Slides(0)
+ 'Get the chart from slide
+ Dim chart As IPresentationChart= TryCast(slide.Shapes(0), IPresentationChart)
+ 'Create an instance of chart axis
+ Dim chartAxis As IOfficeChartAxis = chart.PrimaryValueAxis
+ 'Set auto tick label spacing
+ chartAxis.AutoTickLabelSpacing = True
+ 'Set the border of chart axis
+ chartAxis.Border.LineWeight = OfficeChartLineWeight.Medium
+ 'Set 3D options for chart
+ chartAxis.Chart3DOptions.BevelBottomWidth = 200
+ 'Set the font color for chart axis
+ chartAxis.Font.Color = OfficeKnownColors.Lavender
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ ISlide slide = presentation.Slides[0];
+ //Get the chart from slide
+ IPresentationChart chart = slide.Shapes[0] as IPresentationChart;
+ //Create an instance of chart axis
+ IOfficeChartAxis chartAxis = chart.PrimaryValueAxis;
+ //Set auto tick label spacing
+ chartAxis.AutoTickLabelSpacing = true;
+ //Set the border of chart axis
+ chartAxis.Border.LineWeight = OfficeChartLineWeight.Medium;
+ //Set 3D options for chart
+ chartAxis.Chart3DOptions.BevelBottomWidth = 200;
+ //Set the font color for chart axis
+ chartAxis.Font.Color = OfficeKnownColors.Lavender;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation As IPresentation = Presentation.Open("Template.pptx")
+ Dim slide As ISlide = presentation.Slides(0)
+ 'Get the chart from slide
+ Dim chart As IPresentationChart= TryCast(slide.Shapes(0), IPresentationChart)
+ 'Create an instance of chart axis
+ Dim chartAxis As IOfficeChartAxis = chart.PrimaryValueAxis
+ 'Set auto tick label spacing
+ chartAxis.AutoTickLabelSpacing = True
+ 'Set the border of chart axis
+ chartAxis.Border.LineWeight = OfficeChartLineWeight.Medium
+ 'Set 3D options for chart
+ chartAxis.Chart3DOptions.BevelBottomWidth = 200
+ 'Set the font color for chart axis
+ chartAxis.Font.Color = OfficeKnownColors.Lavender
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ ISlide slide = presentation.Slides[0];
+ //Get the chart from slide
+ IPresentationChart chart = slide.Shapes[0] as IPresentationChart;
+ //Create an instance of chart axis
+ IOfficeChartAxis chartAxis = chart.PrimaryValueAxis;
+ //Set the tick label position
+ chartAxis.TickLabelPosition = OfficeTickLabelPosition.TickLabelPosition_NextToAxis;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ Dim slide As ISlide = presentation__1.Slides(0)
+ 'Get the chart from slide
+ Dim chart As IPresentationChart = TryCast(slide.Shapes(0), IPresentationChart)
+ 'Create an instance of chart axis
+ Dim chartAxis As IOfficeChartAxis = chart.PrimaryValueAxis
+ 'Set the tick label position
+ chartAxis.TickLabelPosition = OfficeTickLabelPosition.TickLabelPosition_NextToAxis
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ ISlide slide = presentation.Slides[0];
+ //Get the chart from slide
+ IPresentationChart chart = slide.Shapes[0] as IPresentationChart;
+ //Create an instance of chart axis
+ IOfficeChartAxis chartAxis = chart.PrimaryValueAxis;
+ //Hide the visibility of chart axis
+ chartAxis.Visible = false;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ Dim slide As ISlide = presentation__1.Slides(0)
+ 'Get the chart from slide
+ Dim chart As IPresentationChart = TryCast(slide.Shapes(0), IPresentationChart)
+ 'Create an instance of chart axis
+ Dim chartAxis As IOfficeChartAxis = chart.PrimaryValueAxis
+ 'Hide the visibility of chart axis
+ chartAxis.Visible = False
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ ISlide slide = presentation.Slides[0];
+ //Get the chart from slide
+ IPresentationChart chart = slide.Shapes[0] as IPresentationChart;
+ //Create an instance of chart axis
+ IOfficeChartAxis chartAxis = chart.PrimaryValueAxis;
+ //Get the chart axis type, read only
+ OfficeAxisType axisType = chartAxis.AxisType;
+ //Enable reverse plot order
+ chartAxis.ReversePlotOrder = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation As IPresentation = Presentation.Open("Template.pptx")
+ Dim slide As ISlide = presentation.Slides(0)
+ 'Get the chart from slide
+ Dim chart As IPresentationChart= TryCast(slide.Shapes(0), IPresentationChart)
+ 'Create an instance of chart axis
+ Dim chartAxis As IOfficeChartAxis = chart.PrimaryValueAxis
+ 'Get the chart axis type, read only
+ Dim axisType As OfficeAxisType = chartAxis.AxisType
+ 'Enable reverse plot order
+ chartAxis.ReversePlotOrder = True
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ ISlide slide = presentation.Slides[0];
+ //Get the chart from slide
+ IPresentationChart chart = slide.Shapes[0] as IPresentationChart;
+ //Create an instance of chart axis
+ IOfficeChartAxis chartAxis = chart.PrimaryValueAxis;
+ //Get the shadow od axis
+ IShadow shadow = chartAxis.Shadow;
+ //Set the shadow color
+ shadow.ShadowColor = Color.Brown;
+ //Set the shadow angle
+ shadow.Angle = 87;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ Dim slide As ISlide = presentation__1.Slides(0)
+ 'Get the chart from slide
+ Dim chart As IPresentationChart = TryCast(slide.Shapes(0), IPresentationChart)
+ 'Create an instance of chart axis
+ Dim chartAxis As IOfficeChartAxis = chart.PrimaryValueAxis
+ 'Get the shadow od axis
+ Dim shadow As IShadow = chartAxis.Shadow
+ 'Set the shadow color
+ shadow.ShadowColor = Color.Brown
+ 'Set the shadow angle
+ shadow.Angle = 87
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ ISlide slide = presentation.Slides[0];
+ //Get the chart from slide
+ IPresentationChart chart = slide.Shapes[0] as IPresentationChart;
+ //Create an instance of chart axis
+ IOfficeChartAxis chartAxis = chart.PrimaryValueAxis;
+ //Set the border of chart axis
+ chartAxis.Border.LineWeight = OfficeChartLineWeight.Medium;
+ //Set 3D options for chart
+ chartAxis.Chart3DOptions.BevelBottomWidth = 200;
+ //Set the font color for chart axis
+ chartAxis.Font.Color = OfficeKnownColors.Lavender;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation As IPresentation = Presentation.Open("Template.pptx")
+ Dim slide As ISlide = presentation.Slides(0)
+ 'Get the chart from slide
+ Dim chart As IPresentationChart= TryCast(slide.Shapes(0), IPresentationChart)
+ 'Create an instance of chart axis
+ Dim chartAxis As IOfficeChartAxis = chart.PrimaryValueAxis
+ 'Set auto tick label spacing
+ chartAxis.AutoTickLabelSpacing = True
+ 'Set the border of chart axis
+ chartAxis.Border.LineWeight = OfficeChartLineWeight.Medium
+ 'Set 3D options for chart
+ chartAxis.Chart3DOptions.BevelBottomWidth = 200
+ 'Set the font color for chart axis
+ chartAxis.Font.Color = OfficeKnownColors.Lavender
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the chart area border
+ IOfficeChartBorder chartAreaBorder = chart.ChartArea.Border;
+ //Enable auto line color
+ chartAreaBorder.IsAutoLineColor = false;
+ //Set the line color
+ chartAreaBorder.LineColor = System.Drawing.Color.CornflowerBlue;
+ //Set the line pattern
+ chartAreaBorder.LinePattern = OfficeChartLinePattern.DashDotDot;
+ //Set the line weight
+ chartAreaBorder.LineWeight = OfficeChartLineWeight.Wide;
+ //Set the transparency of border
+ chartAreaBorder.Transparency = 0.8;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the chart area border
+ Dim chartAreaBorder As IOfficeChartBorder = chart.ChartArea.Border
+ 'Enable auto line color
+ chartAreaBorder.IsAutoLineColor = False
+ 'Set the line color
+ chartAreaBorder.LineColor = System.Drawing.Color.CornflowerBlue
+ 'Set the line pattern
+ chartAreaBorder.LinePattern = OfficeChartLinePattern.DashDotDot
+ 'Set the line weight
+ chartAreaBorder.LineWeight = OfficeChartLineWeight.Wide
+ 'Set the transparency of border
+ chartAreaBorder.Transparency = 0.8
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the chart area border
+ IOfficeChartBorder chartAreaBorder = chart.ChartArea.Border;
+ //Enable auto line color
+ chartAreaBorder.IsAutoLineColor = false;
+ //Set the line color
+ chartAreaBorder.LineColor = System.Drawing.Color.CornflowerBlue;
+ //Set the line pattern
+ chartAreaBorder.LinePattern = OfficeChartLinePattern.DashDotDot;
+ //Set the line weight
+ chartAreaBorder.LineWeight = OfficeChartLineWeight.Wide;
+ //Set the transparency of border
+ chartAreaBorder.Transparency = 0.8;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the chart area border
+ Dim chartAreaBorder As IOfficeChartBorder = chart.ChartArea.Border
+ 'Enable auto line color
+ chartAreaBorder.IsAutoLineColor = False
+ 'Set the line color
+ chartAreaBorder.LineColor = System.Drawing.Color.CornflowerBlue
+ 'Set the line pattern
+ chartAreaBorder.LinePattern = OfficeChartLinePattern.DashDotDot
+ 'Set the line weight
+ chartAreaBorder.LineWeight = OfficeChartLineWeight.Wide
+ 'Set the transparency of border
+ chartAreaBorder.Transparency = 0.8
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the chart area border
+ IOfficeChartBorder chartAreaBorder = chart.ChartArea.Border;
+ //Enable auto line color
+ chartAreaBorder.IsAutoLineColor = false;
+ //Set the line color
+ chartAreaBorder.LineColor = System.Drawing.Color.CornflowerBlue;
+ //Set the line pattern
+ chartAreaBorder.LinePattern = OfficeChartLinePattern.DashDotDot;
+ //Set the line weight
+ chartAreaBorder.LineWeight = OfficeChartLineWeight.Wide;
+ //Set the transparency of border
+ chartAreaBorder.Transparency = 0.8;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the chart area border
+ Dim chartAreaBorder As IOfficeChartBorder = chart.ChartArea.Border
+ 'Enable auto line color
+ chartAreaBorder.IsAutoLineColor = False
+ 'Set the line color
+ chartAreaBorder.LineColor = System.Drawing.Color.CornflowerBlue
+ 'Set the line pattern
+ chartAreaBorder.LinePattern = OfficeChartLinePattern.DashDotDot
+ 'Set the line weight
+ chartAreaBorder.LineWeight = OfficeChartLineWeight.Wide
+ 'Set the transparency of border
+ chartAreaBorder.Transparency = 0.8
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the chart area border
+ IOfficeChartBorder chartAreaBorder = chart.ChartArea.Border;
+ //Set the auto format
+ chartAreaBorder.AutoFormat = false;
+ //Set the color index of chart area border
+ chartAreaBorder.ColorIndex = OfficeKnownColors.Light_orange;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the chart area border
+ Dim chartAreaBorder As IOfficeChartBorder = chart.ChartArea.Border
+ 'Set the auto format
+ chartAreaBorder.AutoFormat = False
+ 'Set the color index of chart area border
+ chartAreaBorder.ColorIndex = OfficeKnownColors.Light_orange
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the chart area border
+ IOfficeChartBorder chartAreaBorder = chart.ChartArea.Border;
+ //Enable auto line color
+ chartAreaBorder.IsAutoLineColor = false;
+ //Set the line color
+ //chartAreaBorder.LineColor = Color.Chocolate;
+ //Set the line pattern
+ chartAreaBorder.LinePattern = OfficeChartLinePattern.DashDotDot;
+ //Set the line weight
+ chartAreaBorder.LineWeight = OfficeChartLineWeight.Wide;
+ //Set the transparency of border
+ chartAreaBorder.Transparency = 0.8;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the chart area border
+ Dim chartAreaBorder As IOfficeChartBorder = chart.ChartArea.Border
+ 'Enable auto line color
+ chartAreaBorder.IsAutoLineColor = False
+ 'Set the line color
+ 'chartAreaBorder.LineColor = Color.Chocolate;
+ 'Set the line pattern
+ chartAreaBorder.LinePattern = OfficeChartLinePattern.DashDotDot
+ 'Set the line weight
+ chartAreaBorder.LineWeight = OfficeChartLineWeight.Wide
+ 'Set the transparency of border
+ chartAreaBorder.Transparency = 0.8
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the chart area border
+ IOfficeChartBorder chartAreaBorder = chart.ChartArea.Border;
+ //Set the color index of chart area border
+ chartAreaBorder.ColorIndex = OfficeKnownColors.Light_orange;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the chart area border
+ Dim chartAreaBorder As IOfficeChartBorder = chart.ChartArea.Border
+ 'Set the color index of chart area border
+ chartAreaBorder.ColorIndex = OfficeKnownColors.Light_orange
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the chart area border
+ IOfficeChartBorder chartAreaBorder = chart.ChartArea.Border;
+ //Set the color index of chart area border
+ chartAreaBorder.ColorIndex = OfficeKnownColors.Light_orange;
+ //Set the transparency of border
+ chartAreaBorder.Transparency = 0.8;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the chart area border
+ Dim chartAreaBorder As IOfficeChartBorder = chart.ChartArea.Border
+ 'Set the color index of chart area border
+ chartAreaBorder.ColorIndex = OfficeKnownColors.Light_orange
+ 'Set the transparency of border
+ chartAreaBorder.Transparency = 0.8
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Open a presentation
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ //Get the chart from the first slide
+ IPresentationChart chart = presentation.Slides[0].Charts[0] as IPresentationChart;
+ //Get the categories of chart
+ IOfficeChartCategories categories = chart.Categories;
+ //Get the name of the category
+ string name = categories[0].Name;
+ //Set the category filter
+ categories[0].IsFiltered = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open a presentation
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ 'Get the chart from the first slide
+ Dim chart As IPresentationChart = TryCast(presentation__1.Slides(0).Charts(0), IPresentationChart)
+ 'Get the categories of chart
+ Dim categories As IOfficeChartCategories = chart.Categories
+ 'Get the name of the category
+ Dim name As String = categories(0).Name
+ 'Set the category filter
+ categories(0).IsFiltered = True
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ ISlide slide = presentation.Slides[0];
+ //Get the chart from slide
+ IPresentationChart chart = slide.Shapes[0] as IPresentationChart;
+ //Get the category from the category collection
+ IOfficeChartCategory category = chart.Categories[0];
+ //Get the name of the category
+ string name = category.Name;
+ //Get the category label, read only
+ IOfficeDataRange dataRange = category.CategoryLabel;
+ //Set the value
+ dataRange.SetValue(2, 1, "2ndRow, 1stCol");
+ dataRange.SetValue(2, 4, 290);
+ //Get the values of category
+ IOfficeDataRange values = category.Values;
+ //Set the value
+ values.SetValue(3, 2, 120);
+ values.SetValue(5, 2, 320);
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ Dim slide As ISlide = presentation__1.Slides(0)
+ 'Get the chart from slide
+ Dim chart As IPresentationChart = TryCast(slide.Shapes(0), IPresentationChart)
+ 'Get the category from the category collection
+ Dim category As IOfficeChartCategory = chart.Categories(0)
+ 'Get the name of the category
+ Dim name As String = category.Name
+ 'Get the category label, read only
+ Dim dataRange As IOfficeDataRange = category.CategoryLabel
+ 'Set the value
+ dataRange.SetValue(2, 1, "2ndRow, 1stCol")
+ dataRange.SetValue(2, 4, 290)
+ 'Get the values of category
+ Dim values As IOfficeDataRange = category.Values
+ 'Set the value
+ values.SetValue(3, 2, 120)
+ values.SetValue(5, 2, 320)
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ ISlide slide = presentation.Slides[0];
+ //Get the chart from slide
+ IPresentationChart chart = slide.Shapes[0] as IPresentationChart;
+ //Get the category from the category collection
+ IOfficeChartCategory category = chart.Categories[0];
+ //Get the name of the category
+ string name = category.Name;
+ //Get the category label, read only
+ IOfficeDataRange dataRange = category.CategoryLabel;
+ //Set the value
+ dataRange.SetValue(2, 1, "2ndRow, 1stCol");
+ dataRange.SetValue(2, 4, 290);
+ //Get the values of category
+ IOfficeDataRange values = category.Values;
+ //Set the value
+ values.SetValue(3, 2, 120);
+ values.SetValue(5, 2, 320);
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ Dim slide As ISlide = presentation__1.Slides(0)
+ 'Get the chart from slide
+ Dim chart As IPresentationChart = TryCast(slide.Shapes(0), IPresentationChart)
+ 'Get the category from the category collection
+ Dim category As IOfficeChartCategory = chart.Categories(0)
+ 'Get the name of the category
+ Dim name As String = category.Name
+ 'Get the category label, read only
+ Dim dataRange As IOfficeDataRange = category.CategoryLabel
+ 'Set the value
+ dataRange.SetValue(2, 1, "2ndRow, 1stCol")
+ dataRange.SetValue(2, 4, 290)
+ 'Get the values of category
+ Dim values As IOfficeDataRange = category.Values
+ 'Set the value
+ values.SetValue(3, 2, 120)
+ values.SetValue(5, 2, 320)
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ ISlide slide = presentation.Slides[0];
+ //Get the chart from slide
+ IPresentationChart chart = slide.Shapes[0] as IPresentationChart;
+ //Get the category from the category collection
+ IOfficeChartCategory category = chart.Categories[0];
+ //Get the name of the category
+ string name = category.Name;
+ //Get the category label, read only
+ IOfficeDataRange dataRange = category.CategoryLabel;
+ //Set the value
+ dataRange.SetValue(2, 1, "2ndRow, 1stCol");
+ dataRange.SetValue(2, 4, 290);
+ //Get the values of category
+ IOfficeDataRange values = category.Values;
+ //Set the value
+ values.SetValue(3, 2, 120);
+ values.SetValue(5, 2, 320);
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ Dim slide As ISlide = presentation__1.Slides(0)
+ 'Get the chart from slide
+ Dim chart As IPresentationChart = TryCast(slide.Shapes(0), IPresentationChart)
+ 'Get the category from the category collection
+ Dim category As IOfficeChartCategory = chart.Categories(0)
+ 'Get the name of the category
+ Dim name As String = category.Name
+ 'Get the category label, read only
+ Dim dataRange As IOfficeDataRange = category.CategoryLabel
+ 'Set the value
+ dataRange.SetValue(2, 1, "2ndRow, 1stCol")
+ dataRange.SetValue(2, 4, 290)
+ 'Get the values of category
+ Dim values As IOfficeDataRange = category.Values
+ 'Set the value
+ values.SetValue(3, 2, 120)
+ values.SetValue(5, 2, 320)
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Specify the chart title
+ chart.ChartTitle = "Sales Analysis";
+ //Specify the chart type
+ chart.ChartType = OfficeChartType.Column_Clustered;
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Diable auto major
+ chart.PrimaryValueAxis.IsAutoMin = false;
+ //Disable auto max
+ chart.PrimaryValueAxis.IsAutoMinor = false;
+ //Set the major unit
+ chart.PrimaryValueAxis.MinorUnit = 24.34;
+ //Set the maximum value
+ chart.PrimaryValueAxis.MinimumValue = 60;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Specify the chart title
+ chart.ChartTitle = "Sales Analysis";
+ //Specify the chart type
+ chart.ChartType = OfficeChartType.Column_Clustered;
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Diable auto major
+ chart.PrimaryValueAxis.IsAutoMajor = false;
+ //Disable auto max
+ chart.PrimaryValueAxis.IsAutoMax = false;
+ //Set the major unit
+ chart.PrimaryValueAxis.MajorUnit = 24.34;
+ //Set the maximum value
+ chart.PrimaryValueAxis.MaximumValue = 60;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Specify the chart title
+ chart.ChartTitle = "Sales Analysis";
+ //Specify the chart type
+ chart.ChartType = OfficeChartType.Column_Clustered;
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Diable auto major
+ chart.PrimaryValueAxis.IsAutoMajor = false;
+ //Disable auto max
+ chart.PrimaryValueAxis.IsAutoMax = false;
+ //Set the major unit
+ chart.PrimaryValueAxis.MajorUnit = 24.34;
+ //Set the maximum value
+ chart.PrimaryValueAxis.MaximumValue = 60;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Specify the chart title
+ chart.ChartTitle = "Sales Analysis";
+ //Specify the chart type
+ chart.ChartType = OfficeChartType.Column_Clustered;
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Diable auto major
+ chart.PrimaryValueAxis.IsAutoMin = false;
+ //Disable auto max
+ chart.PrimaryValueAxis.IsAutoMinor = false;
+ //Set the major unit
+ chart.PrimaryValueAxis.MinorUnit = 24.34;
+ //Set the maximum value
+ chart.PrimaryValueAxis.MinimumValue = 60;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Specify the chart title
+ chart.ChartTitle = "Sales Analysis";
+ //Specify the chart type
+ chart.ChartType = OfficeChartType.Column_Clustered;
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Set the crosses At
+ chart.PrimaryValueAxis.CrossesAt = 1.2;
+ //Set the display unit
+ chart.PrimaryValueAxis.DisplayUnit = OfficeChartDisplayUnit.Hundreds;
+ //Set the display unit custom
+ chart.PrimaryValueAxis.DisplayUnitCustom = 12.34;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Specify the chart title
+ chart.ChartTitle = "Sales Analysis";
+ //Specify the chart type
+ chart.ChartType = OfficeChartType.Column_Clustered;
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Diable auto major
+ chart.PrimaryValueAxis.IsAutoMin = false;
+ //Disable auto max
+ chart.PrimaryValueAxis.IsAutoMinor = false;
+ //Set the major unit
+ chart.PrimaryValueAxis.MinorUnit = 24.34;
+ //Set the maximum value
+ chart.PrimaryValueAxis.MinimumValue = 60;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Specify the chart title
+ chart.ChartTitle = "Sales Analysis";
+ //Specify the chart type
+ chart.ChartType = OfficeChartType.Column_Clustered;
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Diable auto major
+ chart.PrimaryValueAxis.IsAutoMajor = false;
+ //Disable auto max
+ chart.PrimaryValueAxis.IsAutoMax = false;
+ //Set the major unit
+ chart.PrimaryValueAxis.MajorUnit = 24.34;
+ //Set the maximum value
+ chart.PrimaryValueAxis.MaximumValue = 60;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Specify the chart title
+ chart.ChartTitle = "Sales Analysis";
+ //Specify the chart type
+ chart.ChartType = OfficeChartType.Column_Clustered;
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Diable auto major
+ chart.PrimaryValueAxis.IsAutoMajor = false;
+ //Disable auto max
+ chart.PrimaryValueAxis.IsAutoMax = false;
+ //Set the major unit
+ chart.PrimaryValueAxis.MajorUnit = 24.34;
+ //Set the maximum value
+ chart.PrimaryValueAxis.MaximumValue = 60;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Specify the chart title
+ chart.ChartTitle = "Sales Analysis";
+ //Specify the chart type
+ chart.ChartType = OfficeChartType.Column_Clustered;
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Disable the auto cross
+ chart.PrimaryValueAxis.IsAutoCross = false;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Specify the chart title
+ chart.ChartTitle = "Sales Analysis";
+ //Specify the chart type
+ chart.ChartType = OfficeChartType.Column_Clustered;
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Set the log scale
+ chart.PrimaryValueAxis.IsLogScale = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Specify the chart title
+ chart.ChartTitle = "Sales Analysis";
+ //Specify the chart type
+ chart.ChartType = OfficeChartType.Column_Clustered;
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range (start row, start column, end row, end column) of chart series
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range (start row, start column, end row, end column) of chart series
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Set the log scale and log base
+ chart.PrimaryValueAxis.IsLogScale = true;
+ chart.PrimaryValueAxis.LogBase = 2;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Specify the chart title
+ chart.ChartTitle = "Sales Analysis";
+ //Specify the chart type
+ chart.ChartType = OfficeChartType.Column_Clustered;
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Disable the auto cross
+ chart.PrimaryValueAxis.IsAutoCross = false;
+ //Set the Max cross
+ chart.PrimaryValueAxis.IsMaxCross = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Specify the chart title
+ chart.ChartTitle = "Sales Analysis";
+ //Specify the chart type
+ chart.ChartType = OfficeChartType.Column_Clustered;
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Set the crosses At
+ chart.PrimaryValueAxis.CrossesAt = 1.2;
+ //Set the display unit
+ chart.PrimaryValueAxis.DisplayUnit = OfficeChartDisplayUnit.Hundreds;
+ //Set the display unit custom
+ chart.PrimaryValueAxis.DisplayUnitCustom = 12.34;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Specify the chart title
+ chart.ChartTitle = "Sales Analysis";
+ //Specify the chart type
+ chart.ChartType = OfficeChartType.Column_Clustered;
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Set the crosses At
+ chart.PrimaryValueAxis.CrossesAt = 1.2;
+ //Set the display unit
+ chart.PrimaryValueAxis.DisplayUnit = OfficeChartDisplayUnit.Hundreds;
+ //Set the display unit custom
+ chart.PrimaryValueAxis.DisplayUnitCustom = 12.34;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Specify the chart title
+ chart.ChartTitle = "Sales Analysis";
+ //Specify the chart type
+ chart.ChartType = OfficeChartType.Column_Clustered;
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Set the display unit
+ chart.PrimaryValueAxis.DisplayUnit = OfficeChartDisplayUnit.MillionMillions;
+ //Hide the display unit label
+ chart.PrimaryValueAxis.HasDisplayUnitLabel = false;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Specify the chart title
+ chart.ChartTitle = "Sales Analysis";
+ //Specify the chart type
+ chart.ChartType = OfficeChartType.Column_Clustered;
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Set the display unit
+ chart.PrimaryValueAxis.DisplayUnit = OfficeChartDisplayUnit.MillionMillions;
+ //Set the italic font style for the lable
+ chart.PrimaryValueAxis.DisplayUnitLabel.Italic = true;
+ //Set the RGB color of the label
+ chart.PrimaryValueAxis.DisplayUnitLabel.RGBColor = System.Drawing.Color.Bisque;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "9/21/2015");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "9/24/2015");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "9/28/2015");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the primary category axis of chart
+ IOfficeChartCategoryAxis categoryAxis = chart.PrimaryCategoryAxis;
+ //Set the category labels
+ categoryAxis.CategoryLabels = chart.ChartData[2, 1, 4, 1];
+ //Set the number format of axis
+ categoryAxis.NumberFormat = "m/d/yyyy";
+ //Set the tick label spacing
+ categoryAxis.TickLabelSpacing = 2;
+ //Set the tick mark spacing
+ categoryAxis.TickMarkSpacing = 2;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "9/21/2015")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "9/24/2015")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "9/28/2015")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the primary category axis of chart
+ Dim categoryAxis As IOfficeChartCategoryAxis = chart.PrimaryCategoryAxis
+ 'Set the category labels
+ categoryAxis.CategoryLabels = chart.ChartData(2, 1, 4, 1)
+ 'Set the number format of axis
+ categoryAxis.NumberFormat = "m/d/yyyy"
+ 'Set the tick label spacing
+ categoryAxis.TickLabelSpacing = 2
+ 'Set the tick mark spacing
+ categoryAxis.TickMarkSpacing = 2
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the primary category axis of chart
+ IOfficeChartCategoryAxis categoryAxis = chart.PrimaryCategoryAxis;
+ //Set the auto tick label spacing
+ categoryAxis.AutoTickLabelSpacing = false;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the primary category axis of chart
+ Dim categoryAxis As IOfficeChartCategoryAxis = chart.PrimaryCategoryAxis
+ 'Set the auto tick label spacing
+ categoryAxis.AutoTickLabelSpacing = False
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "9/21/2015");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "9/24/2015");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "9/28/2015");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the primary category axis of chart
+ IOfficeChartCategoryAxis categoryAxis = chart.PrimaryCategoryAxis;
+ //Set the category labels
+ categoryAxis.CategoryLabels = chart.ChartData[2, 1, 4, 1];
+ //Set the number format of axis
+ categoryAxis.NumberFormat = "m/d/yyyy";
+ //Set the tick label spacing
+ categoryAxis.TickLabelSpacing = 2;
+ //Set the tick mark spacing
+ categoryAxis.TickMarkSpacing = 2;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "9/21/2015")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "9/24/2015")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "9/28/2015")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the primary category axis of chart
+ Dim categoryAxis As IOfficeChartCategoryAxis = chart.PrimaryCategoryAxis
+ 'Set the category labels
+ categoryAxis.CategoryLabels = chart.ChartData(2, 1, 4, 1)
+ 'Set the number format of axis
+ categoryAxis.NumberFormat = "m/d/yyyy"
+ 'Set the tick label spacing
+ categoryAxis.TickLabelSpacing = 2
+ 'Set the tick mark spacing
+ categoryAxis.TickMarkSpacing = 2
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "9/21/2015");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "9/24/2015");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "9/28/2015");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the primary category axis of chart
+ IOfficeChartCategoryAxis categoryAxis = chart.PrimaryCategoryAxis;
+ //Set the category labels
+ categoryAxis.CategoryLabels = chart.ChartData[2, 1, 4, 1];
+ //Set the number format of axis
+ categoryAxis.NumberFormat = "m/d/yyyy";
+ //Set the tick label spacing
+ categoryAxis.TickLabelSpacing = 2;
+ //Set the tick mark spacing
+ categoryAxis.TickMarkSpacing = 2;
+ //Set IsBetween, default is true
+ categoryAxis.IsBetween = false;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "9/21/2015")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "9/24/2015")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "9/28/2015")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the primary category axis of chart
+ Dim categoryAxis As IOfficeChartCategoryAxis = chart.PrimaryCategoryAxis
+ 'Set the category labels
+ categoryAxis.CategoryLabels = chart.ChartData(2, 1, 4, 1)
+ 'Set the number format of axis
+ categoryAxis.NumberFormat = "m/d/yyyy"
+ 'Set the tick label spacing
+ categoryAxis.TickLabelSpacing = 2
+ 'Set the tick mark spacing
+ categoryAxis.TickMarkSpacing = 2
+ 'Set IsBetween, default is true
+ categoryAxis.IsBetween = False
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "9/21/2015");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "9/24/2015");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "9/28/2015");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the primary category axis of chart
+ IOfficeChartCategoryAxis categoryAxis = chart.PrimaryCategoryAxis;
+ //Set the category labels
+ categoryAxis.CategoryLabels = chart.ChartData[2, 1, 4, 1];
+ //Set the number format of axis
+ categoryAxis.NumberFormat = "m/d/yyyy";
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "9/21/2015")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "9/24/2015")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "9/28/2015")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the primary category axis of chart
+ Dim categoryAxis As IOfficeChartCategoryAxis = chart.PrimaryCategoryAxis
+ 'Set the category labels
+ categoryAxis.CategoryLabels = chart.ChartData(2, 1, 4, 1)
+ 'Set the number format of axis
+ categoryAxis.NumberFormat = "m/d/yyyy"
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 1, "Jan");
+ chart.ChartData.SetValue(1, 2, "Feb");
+ chart.ChartData.SetValue(1, 3, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "10");
+ chart.ChartData.SetValue(2, 2, "20");
+ chart.ChartData.SetValue(2, 3, "30");
+ ///'Sets the data range of chart
+ chart.DataRange = chart.ChartData(1, 1, 2, 2)
+ //Get the primary category axis of chart
+ IOfficeChartCategoryAxis categoryAxis = chart.PrimaryCategoryAxis;
+ //Set the category labels
+ categoryAxis.DirectCategoryLabels = = new object[] { "Oct", "Nov", "Dec" };;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "9/21/2015");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "9/24/2015");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "9/28/2015");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the primary category axis of chart
+ IOfficeChartCategoryAxis categoryAxis = chart.PrimaryCategoryAxis;
+ //Set the category labels
+ categoryAxis.CategoryLabels = chart.ChartData[2, 1, 4, 1];
+ //Set the number format of axis
+ categoryAxis.NumberFormat = "m/d/yyyy";
+ //Set the category type
+ categoryAxis.CategoryType = OfficeCategoryType.Category;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "9/21/2015")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "9/24/2015")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "9/28/2015")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the primary category axis of chart
+ Dim categoryAxis As IOfficeChartCategoryAxis = chart.PrimaryCategoryAxis
+ 'Set the category labels
+ categoryAxis.CategoryLabels = chart.ChartData(2, 1, 4, 1)
+ 'Set the number format of axis
+ categoryAxis.NumberFormat = "m/d/yyyy"
+ 'Set the category type
+ categoryAxis.CategoryType = OfficeCategoryType.Category
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "9/21/2015");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "9/24/2015");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "9/28/2015");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the primary category axis of chart
+ IOfficeChartCategoryAxis categoryAxis = chart.PrimaryCategoryAxis;
+ //Set the category labels
+ categoryAxis.CategoryLabels = chart.ChartData[2, 1, 4, 1];
+ //Set the number format of axis
+ categoryAxis.NumberFormat = "m/d/yyyy";
+ //Set the base unit
+ categoryAxis.BaseUnit = OfficeChartBaseUnit.Month;
+ //Set the base unit for the category axis, default is true
+ categoryAxis.BaseUnitIsAuto = false;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "9/21/2015")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "9/24/2015")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "9/28/2015")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the primary category axis of chart
+ Dim categoryAxis As IOfficeChartCategoryAxis = chart.PrimaryCategoryAxis
+ 'Set the category labels
+ categoryAxis.CategoryLabels = chart.ChartData(2, 1, 4, 1)
+ 'Set the number format of axis
+ categoryAxis.NumberFormat = "m/d/yyyy"
+ 'Set the base unit
+ categoryAxis.BaseUnit = OfficeChartBaseUnit.Month
+ 'Set the base unit for the category axis, default is true
+ categoryAxis.BaseUnitIsAuto = False
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "9/21/2015");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "9/24/2015");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "9/28/2015");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the primary category axis of chart
+ IOfficeChartCategoryAxis categoryAxis = chart.PrimaryCategoryAxis;
+ //Set the category labels
+ categoryAxis.CategoryLabels = chart.ChartData[2, 1, 4, 1];
+ //Set the number format of axis
+ categoryAxis.NumberFormat = "m/d/yyyy";
+ //Set the base unit
+ categoryAxis.BaseUnit = OfficeChartBaseUnit.Month;
+ //Set the base unit for the category axis, default is true
+ categoryAxis.BaseUnitIsAuto = false;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "9/21/2015")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "9/24/2015")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "9/28/2015")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the primary category axis of chart
+ Dim categoryAxis As IOfficeChartCategoryAxis = chart.PrimaryCategoryAxis
+ 'Set the category labels
+ categoryAxis.CategoryLabels = chart.ChartData(2, 1, 4, 1)
+ 'Set the number format of axis
+ categoryAxis.NumberFormat = "m/d/yyyy"
+ 'Set the base unit
+ categoryAxis.BaseUnit = OfficeChartBaseUnit.Month
+ 'Set the base unit for the category axis, default is true
+ categoryAxis.BaseUnitIsAuto = False
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "9/21/2015");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "9/24/2015");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "9/28/2015");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the primary category axis of chart
+ IOfficeChartCategoryAxis categoryAxis = chart.PrimaryCategoryAxis;
+ //Set the category labels
+ categoryAxis.CategoryLabels = chart.ChartData[2, 1, 4, 1];
+ //Set the number format of axis
+ categoryAxis.NumberFormat = "m/d/yyyy";
+ //Set the base unit
+ categoryAxis.BaseUnit = OfficeChartBaseUnit.Month;
+ //Set the major unit scale
+ categoryAxis.MajorUnitScale = OfficeChartBaseUnit.Month;
+ //Set the minor unit scale
+ categoryAxis.MinorUnitScale = OfficeChartBaseUnit.Month;
+ //Set the minor unit
+ categoryAxis.MinorUnit = 10;
+ //Set the major unit
+ categoryAxis.MajorUnit = 10;
+ //Set the offset value
+ categoryAxis.Offset = 450;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "9/21/2015")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "9/24/2015")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "9/28/2015")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the primary category axis of chart
+ Dim categoryAxis As IOfficeChartCategoryAxis = chart.PrimaryCategoryAxis
+ 'Set the category labels
+ categoryAxis.CategoryLabels = chart.ChartData(2, 1, 4, 1)
+ 'Set the number format of axis
+ categoryAxis.NumberFormat = "m/d/yyyy"
+ 'Set the base unit
+ categoryAxis.BaseUnit = OfficeChartBaseUnit.Month
+ 'Set the major unit scale
+ categoryAxis.MajorUnitScale = OfficeChartBaseUnit.Month
+ 'Set the minor unit scale
+ categoryAxis.MinorUnitScale = OfficeChartBaseUnit.Month
+ 'Set the minor unit
+ categoryAxis.MinorUnit = 10
+ 'Set the major unit
+ categoryAxis.MajorUnit = 10
+ 'Set the offset value
+ categoryAxis.Offset = 450
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "9/21/2015");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "9/24/2015");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "9/28/2015");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the primary category axis of chart
+ IOfficeChartCategoryAxis categoryAxis = chart.PrimaryCategoryAxis;
+ //Set the category labels
+ categoryAxis.CategoryLabels = chart.ChartData[2, 1, 4, 1];
+ //Set the number format of axis
+ categoryAxis.NumberFormat = "m/d/yyyy";
+ //Set the base unit
+ categoryAxis.BaseUnit = OfficeChartBaseUnit.Month;
+ //Set the major unit scale
+ categoryAxis.MajorUnitScale = OfficeChartBaseUnit.Month;
+ //Set the minor unit scale
+ categoryAxis.MinorUnitScale = OfficeChartBaseUnit.Month;
+ //Set the minor unit
+ categoryAxis.MinorUnit = 10;
+ //Set the major unit
+ categoryAxis.MajorUnit = 10;
+ //Set the offset value
+ categoryAxis.Offset = 450;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "9/21/2015")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "9/24/2015")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "9/28/2015")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the primary category axis of chart
+ Dim categoryAxis As IOfficeChartCategoryAxis = chart.PrimaryCategoryAxis
+ 'Set the category labels
+ categoryAxis.CategoryLabels = chart.ChartData(2, 1, 4, 1)
+ 'Set the number format of axis
+ categoryAxis.NumberFormat = "m/d/yyyy"
+ 'Set the base unit
+ categoryAxis.BaseUnit = OfficeChartBaseUnit.Month
+ 'Set the major unit scale
+ categoryAxis.MajorUnitScale = OfficeChartBaseUnit.Month
+ 'Set the minor unit scale
+ categoryAxis.MinorUnitScale = OfficeChartBaseUnit.Month
+ 'Set the minor unit
+ categoryAxis.MinorUnit = 10
+ 'Set the major unit
+ categoryAxis.MajorUnit = 10
+ 'Set the offset value
+ categoryAxis.Offset = 450
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Open a presentation
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ //Get the chart from the first slide
+ IPresentationChart chart = presentation.Slides[1].Charts[0] as IPresentationChart;
+ //Get the categories of chart
+ IOfficeChartCategories categories = chart.Categories;
+ //Get the count of categories
+ int count = categories.Count;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open a presentation
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ 'Get the chart from the first slide
+ Dim chart As IPresentationChart = TryCast(presentation__1.Slides(1).Charts(0), IPresentationChart)
+ 'Get the categories of chart
+ Dim categories As IOfficeChartCategories = chart.Categories
+ 'Get the count of categories
+ Dim count As Integer = categories.Count
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Open a presentation
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ //Get the chart from the first slide
+ IPresentationChart chart = presentation.Slides[0].Charts[0] as IPresentationChart;
+ //Get the categories of chart
+ IOfficeChartCategories categories = chart.Categories;
+ //Get the name of the category
+ string name = categories[0].Name;
+ //Set the category filter
+ categories[0].IsFiltered = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open a presentation
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ 'Get the chart from the first slide
+ Dim chart As IPresentationChart = TryCast(presentation__1.Slides(0).Charts(0), IPresentationChart)
+ 'Get the categories of chart
+ Dim categories As IOfficeChartCategories = chart.Categories
+ 'Get the name of the category
+ Dim name As String = categories(0).Name
+ 'Set the category filter
+ categories(0).IsFiltered = True
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ ISlide slide = presentation.Slides[0];
+ //Get the chart from slide
+ IOfficeChart chart = slide.Shapes[0] as IOfficeChart;
+ //Get the chart data
+ IOfficeChartData chartData = chart.ChartData;
+ //Get the category label, read only
+ IOfficeDataRange dataRange = chartData[2, 2, 4, 5];
+ //Set the cell with an integer
+ dataRange.SetValue(2, 4, 290);
+ //Set the cell with double value
+ dataRange.SetValue(3, 3, 23.34);
+ //Set the cell with a string
+ dataRange.SetValue(3, 1, "ChartData - 3R1C");
+ //Set the cell with an object
+ object value = "@!@#";
+ dataRange.SetValue(2, 1, "value");
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ Dim slide As ISlide = presentation__1.Slides(0)
+ 'Get the chart from slide
+ Dim chart As IOfficeChart = TryCast(slide.Shapes(0), IOfficeChart)
+ 'Get the chart data
+ Dim chartData As IOfficeChartData = chart.ChartData
+ 'Get the category label, read only
+ Dim dataRange As IOfficeDataRange = chartData(2, 2, 4, 5)
+ 'Set the cell with an integer
+ dataRange.SetValue(2, 4, 290)
+ 'Set the cell with double value
+ dataRange.SetValue(3, 3, 23.34)
+ 'Set the cell with a string
+ dataRange.SetValue(3, 1, "ChartData - 3R1C")
+ 'Set the cell with an object
+ Dim value As Object = "@!@#"
+ dataRange.SetValue(2, 1, "value")
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ ISlide slide = presentation.Slides[0];
+ //Get the chart from slide
+ IOfficeChart chart = slide.Shapes[0] as IOfficeChart;
+ //Get the chart data
+ IOfficeChartData chartData = chart.ChartData;
+ //Get the category label, read only
+ IOfficeDataRange dataRange = chartData[2, 2, 4, 5];
+ //Set the cell with an integer
+ dataRange.SetValue(2, 4, 290);
+ //Set the cell with double value
+ dataRange.SetValue(3, 3, 23.34);
+ //Set the cell with a string
+ dataRange.SetValue(3, 1, "ChartData - 3R1C");
+ //Set the cell with an object
+ object value = "@!@#";
+ dataRange.SetValue(2, 1, "value");
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ Dim slide As ISlide = presentation__1.Slides(0)
+ 'Get the chart from slide
+ Dim chart As IOfficeChart = TryCast(slide.Shapes(0), IOfficeChart)
+ 'Get the chart data
+ Dim chartData As IOfficeChartData = chart.ChartData
+ 'Get the category label, read only
+ Dim dataRange As IOfficeDataRange = chartData(2, 2, 4, 5)
+ 'Set the cell with an integer
+ dataRange.SetValue(2, 4, 290)
+ 'Set the cell with double value
+ dataRange.SetValue(3, 3, 23.34)
+ 'Set the cell with a string
+ dataRange.SetValue(3, 1, "ChartData - 3R1C")
+ 'Set the cell with an object
+ Dim value As Object = "@!@#"
+ dataRange.SetValue(2, 1, "value")
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ ISlide slide = presentation.Slides[0];
+ //Get the chart from slide
+ IOfficeChart chart = slide.Shapes[0] as IOfficeChart;
+ //Get the chart data
+ IOfficeChartData chartData = chart.ChartData;
+ //Get the category label, read only
+ IOfficeDataRange dataRange = chartData[2, 2, 4, 5];
+ //Set the cell with an integer
+ dataRange.SetValue(2, 4, 290);
+ //Set the cell with double value
+ dataRange.SetValue(3, 3, 23.34);
+ //Set the cell with a string
+ dataRange.SetValue(3, 1, "ChartData - 3R1C");
+ //Set the cell with an object
+ object value = "@!@#";
+ dataRange.SetValue(2, 1, "value");
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ Dim slide As ISlide = presentation__1.Slides(0)
+ 'Get the chart from slide
+ Dim chart As IOfficeChart = TryCast(slide.Shapes(0), IOfficeChart)
+ 'Get the chart data
+ Dim chartData As IOfficeChartData = chart.ChartData
+ 'Get the category label, read only
+ Dim dataRange As IOfficeDataRange = chartData(2, 2, 4, 5)
+ 'Set the cell with an integer
+ dataRange.SetValue(2, 4, 290)
+ 'Set the cell with double value
+ dataRange.SetValue(3, 3, 23.34)
+ 'Set the cell with a string
+ dataRange.SetValue(3, 1, "ChartData - 3R1C")
+ 'Set the cell with an object
+ Dim value As Object = "@!@#"
+ dataRange.SetValue(2, 1, "value")
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ ISlide slide = presentation.Slides[0];
+ //Get the chart from slide
+ IOfficeChart chart = slide.Shapes[0] as IOfficeChart;
+ //Get the chart data
+ IOfficeChartData chartData = chart.ChartData;
+ //Get the category label, read only
+ IOfficeDataRange dataRange = chartData[2, 2, 4, 5];
+ //Set the cell with an integer
+ dataRange.SetValue(2, 4, 290);
+ //Set the cell with double value
+ dataRange.SetValue(3, 3, 23.34);
+ //Set the cell with a string
+ dataRange.SetValue(3, 1, "ChartData - 3R1C");
+ //Set the cell with an object
+ object value = "@!@#";
+ dataRange.SetValue(2, 1, "value");
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ Dim slide As ISlide = presentation__1.Slides(0)
+ 'Get the chart from slide
+ Dim chart As IOfficeChart = TryCast(slide.Shapes(0), IOfficeChart)
+ 'Get the chart data
+ Dim chartData As IOfficeChartData = chart.ChartData
+ 'Get the category label, read only
+ Dim dataRange As IOfficeDataRange = chartData(2, 2, 4, 5)
+ 'Set the cell with an integer
+ dataRange.SetValue(2, 4, 290)
+ 'Set the cell with double value
+ dataRange.SetValue(3, 3, 23.34)
+ 'Set the cell with a string
+ dataRange.SetValue(3, 1, "ChartData - 3R1C")
+ 'Set the cell with an object
+ Dim value As Object = "@!@#"
+ dataRange.SetValue(2, 1, "value")
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IOfficeChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie – start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie – start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series – start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the chart data
+ IOfficeChartData chartData = chart.ChartData;
+ //Get the value of a particular cell from the chart data
+ object value = chartData.GetValue(2, 3);
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with postion and size
+ Dim chart As IOfficeChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie – start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie – start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series – start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the chart data
+ Dim chartData As IOfficeChartData = chart.ChartData
+ 'Get the value of a particular cell from the chart data
+ Dim value As Object = chartData.GetValue(2, 3)
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ ISlide slide = presentation.Slides[0];
+ //Get the chart from slide
+ IOfficeChart chart = slide.Shapes[0] as IOfficeChart;
+ //Get the chart data
+ IOfficeChartData chartData = chart.ChartData;
+ //Clear the chart data
+ chartData.Clear();
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ Dim slide As ISlide = presentation__1.Slides(0)
+ 'Get the chart from slide
+ Dim chart As IOfficeChart = TryCast(slide.Shapes(0), IOfficeChart)
+ 'Get the chart data
+ Dim chartData As IOfficeChartData = chart.ChartData
+ 'Clear the chart data
+ chartData.Clear()
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ ISlide slide = presentation.Slides[0];
+ //Get the chart from slide
+ IOfficeChart chart = slide.Shapes[0] as IOfficeChart;
+ //Get the chart data
+ IOfficeChartData chartData = chart.ChartData;
+ //Get the category label, read only
+ IOfficeDataRange dataRange = chartData[2, 2, 4, 5];
+ //Set the cell with an integer
+ dataRange.SetValue(2, 4, 290);
+ //Set the cell with double value
+ dataRange.SetValue(3, 3, 23.34);
+ //Set the cell with a string
+ dataRange.SetValue(3, 1, "ChartData - 3R1C");
+ //Set the cell with an object
+ object value = "@!@#";
+ dataRange.SetValue(2, 1, "value");
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ Dim slide As ISlide = presentation__1.Slides(0)
+ 'Get the chart from slide
+ Dim chart As IOfficeChart = TryCast(slide.Shapes(0), IOfficeChart)
+ 'Get the chart data
+ Dim chartData As IOfficeChartData = chart.ChartData
+ 'Get the category label, read only
+ Dim dataRange As IOfficeDataRange = chartData(2, 2, 4, 5)
+ 'Set the cell with an integer
+ dataRange.SetValue(2, 4, 290)
+ 'Set the cell with double value
+ dataRange.SetValue(3, 3, 23.34)
+ 'Set the cell with a string
+ dataRange.SetValue(3, 1, "ChartData - 3R1C")
+ 'Set the cell with an object
+ Dim value As Object = "@!@#"
+ dataRange.SetValue(2, 1, "value")
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the chart title
+ chart.ChartTitle = "This is a chart Title";
+ //Set the bold font style
+ chart.ChartTitleArea.Bold = true;
+ //Set the color of chart title area
+ chart.ChartTitleArea.Color = OfficeKnownColors.BlueCustom;
+ //Set the font name
+ chart.ChartTitleArea.FontName = "Calibri";
+ //Get if the chart area is auto color
+ bool autoColor = chart.ChartTitleArea.IsAutoColor;
+ //Set the italic font style
+ chart.ChartTitleArea.Italic = true;
+ //Set the underline property
+ chart.ChartTitleArea.Underline = OfficeUnderline.Double;
+ //Set the alignment
+ chart.ChartTitleArea.VerticalAlignment = OfficeFontVerticalAlignment.Baseline;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the chart title
+ chart.ChartTitle = "This is a chart Title";
+ //Set the bold font style
+ chart.ChartTitleArea.Bold = true;
+ //Set the color of chart title area
+ chart.ChartTitleArea.Color = OfficeKnownColors.BlueCustom;
+ //Set the font name
+ chart.ChartTitleArea.FontName = "Calibri";
+ //Get if the chart area is auto color
+ bool autoColor = chart.ChartTitleArea.IsAutoColor;
+ //Set the italic font style
+ chart.ChartTitleArea.Italic = true;
+ //Set the underline property
+ chart.ChartTitleArea.Underline = OfficeUnderline.Double;
+ //Set the alignment
+ chart.ChartTitleArea.VerticalAlignment = OfficeFontVerticalAlignment.Baseline;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the chart title
+ chart.ChartTitle = "This is a chart Title";
+ //Set the size of text area
+ chart.ChartTitleArea.Size = 32;
+ //Set the RGB color
+ chart.ChartTitleArea.RGBColor = System.Drawing.Color.Peru;
+ //Set strike through
+ chart.ChartTitleArea.Strikethrough = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the chart title
+ chart.ChartTitle = "This is a chart Title";
+ //Set the bold font style
+ chart.ChartTitleArea.Bold = true;
+ //Set the color of chart title area
+ chart.ChartTitleArea.Color = OfficeKnownColors.BlueCustom;
+ //Set the font name
+ chart.ChartTitleArea.FontName = "Calibri";
+ //Get if the chart area is auto color
+ bool autoColor = chart.ChartTitleArea.IsAutoColor;
+ //Set the italic font style
+ chart.ChartTitleArea.Italic = true;
+ //Set the underline property
+ chart.ChartTitleArea.Underline = OfficeUnderline.Double;
+ //Set the alignment
+ chart.ChartTitleArea.VerticalAlignment = OfficeFontVerticalAlignment.Baseline;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the chart title
+ chart.ChartTitle = "This is a chart Title";
+ //Set the size of text area
+ chart.ChartTitleArea.Size = 32;
+ //Set the RGB color
+ chart.ChartTitleArea.RGBColor = System.Drawing.Color.Peru;
+ //Set strike through
+ chart.ChartTitleArea.Strikethrough = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the chart title
+ chart.ChartTitle = "This is a chart Title";
+ //Set the size of text area
+ chart.ChartTitleArea.Size = 32;
+ //Set the RGB color
+ chart.ChartTitleArea.RGBColor = System.Drawing.Color.Peru;
+ //Set strike through
+ chart.ChartTitleArea.Strikethrough = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the chart title
+ chart.ChartTitle = "This is a chart Title";
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the bold font style
+ chart.ChartTitleArea.Bold = true;
+ //Set the color of chart title area
+ chart.ChartTitleArea.Color = OfficeKnownColors.BlueCustom;
+ //Set the font name
+ chart.ChartTitleArea.FontName = "Calibri";
+ //Get if the chart area is auto color
+ bool autoColor = chart.ChartTitleArea.IsAutoColor;
+ //Set the italic font style
+ chart.ChartTitleArea.Italic = true;
+ //Set the underline property
+ chart.ChartTitleArea.Underline = OfficeUnderline.Double;
+ //Set the alignment
+ chart.ChartTitleArea.VerticalAlignment = OfficeFontVerticalAlignment.Baseline;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the chart title
+ chart.ChartTitle = "This is a chart Title";
+ //Set the bold font style
+ chart.ChartTitleArea.Bold = true;
+ //Set the color of chart title area
+ chart.ChartTitleArea.Color = OfficeKnownColors.BlueCustom;
+ //Set the font name
+ chart.ChartTitleArea.FontName = "Calibri";
+ //Get if the chart area is auto color
+ bool autoColor = chart.ChartTitleArea.IsAutoColor;
+ //Set the italic font style
+ chart.ChartTitleArea.Italic = true;
+ //Set the underline property
+ chart.ChartTitleArea.Underline = OfficeUnderline.Double;
+ //Set the alignment
+ chart.ChartTitleArea.VerticalAlignment = OfficeFontVerticalAlignment.Baseline;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the chart title
+ chart.ChartTitle = "This is a chart Title";
+ //Set the bold font style
+ chart.ChartTitleArea.Bold = true;
+ //Set the color of chart title area
+ chart.ChartTitleArea.Color = OfficeKnownColors.BlueCustom;
+ //Set the font name
+ chart.ChartTitleArea.FontName = "Calibri";
+ //Get if the chart area is auto color
+ bool autoColor = chart.ChartTitleArea.IsAutoColor;
+ //Set the italic font style
+ chart.ChartTitleArea.Italic = true;
+ //Set the underline property
+ chart.ChartTitleArea.Underline = OfficeUnderline.Double;
+ //Set the alignment
+ chart.ChartTitleArea.VerticalAlignment = OfficeFontVerticalAlignment.Baseline;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the chart title
+ chart.ChartTitle = "This is a chart Title";
+ //Set the bold font style
+ chart.ChartTitleArea.Bold = true;
+ //Set the color of chart title area
+ chart.ChartTitleArea.Color = OfficeKnownColors.BlueCustom;
+ //Set the font name
+ chart.ChartTitleArea.FontName = "Calibri";
+ //Get if the chart area is auto color
+ bool autoColor = chart.ChartTitleArea.IsAutoColor;
+ //Set the italic font style
+ chart.ChartTitleArea.Italic = true;
+ //Set the underline property
+ chart.ChartTitleArea.Underline = OfficeUnderline.Double;
+ //Set the alignment
+ chart.ChartTitleArea.VerticalAlignment = OfficeFontVerticalAlignment.Baseline;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the size of title text area
+ chart.ChartTitleArea.Size = 26;
+ //Set the border color of frame format
+ chart.ChartTitleArea.FrameFormat.Border.LineColor = System.Drawing.Color.Peru;
+ //Set the text for chart title
+ chart.ChartTitleArea.Text = "The Chart Title";
+ //Set the text rotation angle
+ chart.ChartTitleArea.TextRotationAngle = 45;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Set the size of title text area
+ chart.ChartTitleArea.Size = 26
+ 'Set the border color of frame format
+ chart.ChartTitleArea.FrameFormat.Border.LineColor = System.Drawing.Color.Peru
+ 'Set the text for chart title
+ chart.ChartTitleArea.Text = "The Chart Title"
+ 'Set the text rotation angle
+ chart.ChartTitleArea.TextRotationAngle = 45
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the size of title text area
+ chart.ChartTitleArea.Size = 26;
+ //Set the border color of frame format
+ chart.ChartTitleArea.FrameFormat.Border.LineColor = System.Drawing.Color.Peru;
+ //Set the text for chart title
+ chart.ChartTitleArea.Text = "The Chart Title";
+ //Set the text rotation angle
+ chart.ChartTitleArea.TextRotationAngle = 45;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Set the size of title text area
+ chart.ChartTitleArea.Size = 26
+ 'Set the border color of frame format
+ chart.ChartTitleArea.FrameFormat.Border.LineColor = System.Drawing.Color.Peru
+ 'Set the text for chart title
+ chart.ChartTitleArea.Text = "The Chart Title"
+ 'Set the text rotation angle
+ chart.ChartTitleArea.TextRotationAngle = 45
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the chart title
+ chart.ChartTitle = "The Chart Title";
+ //Set the size of title text area
+ chart.ChartTitleArea.Size = 26;
+ //Set the border color of frame format
+ chart.ChartTitleArea.FrameFormat.Border.LineColor = System.Drawing.Color.Peru;
+ //Set the line pattern
+ chart.ChartTitleArea.FrameFormat.Border.LinePattern = OfficeChartLinePattern.DashDot;
+ //Set the line weight
+ chart.ChartTitleArea.FrameFormat.Border.LineWeight = OfficeChartLineWeight.Medium;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Set the chart title
+ chart.ChartTitle = "The Chart Title"
+ 'Set the size of title text area
+ chart.ChartTitleArea.Size = 26
+ 'Set the border color of frame format
+ chart.ChartTitleArea.FrameFormat.Border.LineColor = System.Drawing.Color.Peru
+ 'Set the line pattern
+ chart.ChartTitleArea.FrameFormat.Border.LinePattern = OfficeChartLinePattern.DashDot
+ 'Set the line weight
+ chart.ChartTitleArea.FrameFormat.Border.LineWeight = OfficeChartLineWeight.Medium
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the serie data labels
+ IOfficeChartDataLabels dataLabels = chart.Series[0].DataPoints.DefaultDataPoint.DataLabels;
+ //Set the serie name
+ dataLabels.IsSeriesName = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the serie data labels
+ Dim dataLabels As IOfficeChartDataLabels = chart.Series(0).DataPoints.DefaultDataPoint.DataLabels
+ 'Set the serie name
+ dataLabels.IsSeriesName = True
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the serie data labels
+ IOfficeChartDataLabels dataLabels = chart.Series[0].DataPoints.DefaultDataPoint.DataLabels;
+ //Set the serie name
+ dataLabels.IsSeriesName = true;
+ //Set the category name
+ dataLabels.IsCategoryName = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the serie data labels
+ Dim dataLabels As IOfficeChartDataLabels = chart.Series(0).DataPoints.DefaultDataPoint.DataLabels
+ 'Set the serie name
+ dataLabels.IsSeriesName = True
+ 'Set the category name
+ dataLabels.IsCategoryName = True
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the serie data labels
+ IOfficeChartDataLabels dataLabels = chart.Series[0].DataPoints.DefaultDataPoint.DataLabels;
+ //Set the value for data labels
+ dataLabels.IsValue = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the serie data labels
+ Dim dataLabels As IOfficeChartDataLabels = chart.Series(0).DataPoints.DefaultDataPoint.DataLabels
+ 'Set the value for data labels
+ dataLabels.IsValue = True
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the chart type as Pie chart
+ chart.ChartType = OfficeChartType.Pie;
+ //Get the serie data labels
+ IOfficeChartDataLabels dataLabels = chart.Series[0].DataPoints.DefaultDataPoint.DataLabels;
+ //Set the data label as percentage
+ dataLabels.IsPercentage = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the chart type as Pie chart
+ chart.ChartType = OfficeChartType.Pie
+ 'Get the serie data labels
+ Dim dataLabels As IOfficeChartDataLabels = chart.Series(0).DataPoints.DefaultDataPoint.DataLabels
+ 'Set the data label as percentage
+ dataLabels.IsPercentage = True
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create an instance equivalent to PowerPoint presentation
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart of specific size and position
+ IPresentationChart chart = slide.Charts.AddChart(100, 100, 300, 400);
+ chart.ChartData.SetValue(1, 2, 1);
+ chart.ChartData.SetValue(1, 3, 2);
+ chart.ChartData.SetValue(1, 4, 3);
+ chart.ChartData.SetValue(2, 1, "Blue");
+ chart.ChartData.SetValue(2, 2, 0.4);
+ chart.ChartData.SetValue(2, 3, 0.5);
+ chart.ChartData.SetValue(2, 4, 1.2);
+ chart.ChartData.SetValue(3, 1, "Red");
+ chart.ChartData.SetValue(3, 2, 2.6);
+ chart.ChartData.SetValue(3, 3, 3.6);
+ chart.ChartData.SetValue(3, 4, 2.1);
+ chart.ChartData.SetValue(4, 1, "Orange");
+ chart.ChartData.SetValue(4, 2, 1.1);
+ chart.ChartData.SetValue(4, 3, 0.6);
+ chart.ChartData.SetValue(4, 4, 1.2);
+ chart.ChartData.SetValue(5, 1, "Light Blue");
+ chart.ChartData.SetValue(5, 2, 2.1);
+ chart.ChartData.SetValue(5, 3, 3.4);
+ chart.ChartData.SetValue(5, 4, 1.1);
+ IOfficeChartSerie serieJan = chart.Series.Add("1");
+ //Sets the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 5, 2];
+ IOfficeChartSerie serieFeb = chart.Series.Add("2");
+ //Sets the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 5, 3];
+ //Creates a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("3");
+ //Sets the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 5, 4];
+ //Set chart data range
+ chart.DataRange = chart.ChartData[2, 1, 5, 4];
+ //Specifies the chart type
+ chart.ChartType = OfficeChartType.Bar_Stacked;
+ chart.Series[0].DataPoints.DefaultDataPoint.DataLabels.IsValue = true;
+ //Set the number format of the data label in percentage, round off to two decimal places
+ chart.Series[0].DataPoints.DefaultDataPoint.DataLabels.NumberFormat = "0.00%";
+ //Save the presentation
+ presentation.Save("sample.pptx");
+ //Close the Presentation
+ presentation.Close();
+
+
+ 'Create an instance equivalent to PowerPoint presentation
+ Dim presentationDocument As IPresentation = Presentation.Create()
+ 'Add a blank slide
+ Dim slide As ISlide = presentationDocument.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart of specific size and position
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 100, 300, 400)
+ chart.ChartData.SetValue(1, 2, 1)
+ chart.ChartData.SetValue(1, 3, 2)
+ chart.ChartData.SetValue(1, 4, 3)
+ chart.ChartData.SetValue(2, 1, "Blue")
+ chart.ChartData.SetValue(2, 2, 0.4)
+ chart.ChartData.SetValue(2, 3, 0.5)
+ chart.ChartData.SetValue(2, 4, 1.2)
+ chart.ChartData.SetValue(3, 1, "Red")
+ chart.ChartData.SetValue(3, 2, 2.6)
+ chart.ChartData.SetValue(3, 3, 3.6)
+ chart.ChartData.SetValue(3, 4, 2.1)
+ chart.ChartData.SetValue(4, 1, "Orange")
+ chart.ChartData.SetValue(4, 2, 1.1)
+ chart.ChartData.SetValue(4, 3, 0.6)
+ chart.ChartData.SetValue(4, 4, 1.2)
+ chart.ChartData.SetValue(5, 1, "Light Blue")
+ chart.ChartData.SetValue(5, 2, 2.1)
+ chart.ChartData.SetValue(5, 3, 3.4)
+ chart.ChartData.SetValue(5, 4, 1.1)
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("1")
+ 'Sets the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 5, 2)
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("2")
+ 'Sets the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 5, 3)
+ 'Creates a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("3")
+ 'Sets the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 5, 4)
+ 'Set chart data range
+ chart.DataRange = chart.ChartData(2, 1, 5, 4)
+ 'Specifies the chart type
+ chart.ChartType = OfficeChartType.Bar_Stacked
+ chart.Series(0).DataPoints.DefaultDataPoint.DataLabels.IsValue = True
+ 'Set the number format of the data label in percentage, round off to two decimal places.
+ chart.Series(0).DataPoints.DefaultDataPoint.DataLabels.NumberFormat = "0.00%"
+ 'Save the presentation
+ presentationDocument.Save("sample.pptx")
+ 'Close the Presentation
+ presentationDocument.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the serie data labels
+ IOfficeChartDataLabels dataLabels = chart.Series[0].DataPoints.DefaultDataPoint.DataLabels;
+ //Set the position of data labels
+ dataLabels.Delimiter = "L";
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the serie data labels
+ Dim dataLabels As IOfficeChartDataLabels = chart.Series(0).DataPoints.DefaultDataPoint.DataLabels
+ 'Set the position of data labels
+ dataLabels.Delimiter = "L"
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the serie data labels
+ IOfficeChartDataLabels dataLabels = chart.Series[0].DataPoints.DefaultDataPoint.DataLabels;
+ //Set the serie name
+ dataLabels.IsSeriesName = true;
+ //Set the legend key for data labels
+ dataLabels.IsLegendKey = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the serie data labels
+ Dim dataLabels As IOfficeChartDataLabels = chart.Series(0).DataPoints.DefaultDataPoint.DataLabels
+ 'Set the serie name
+ dataLabels.IsSeriesName = True
+ 'Set the legend key for data labels
+ dataLabels.IsLegendKey = True
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the chart type as Pie chart
+ chart.ChartType = OfficeChartType.Pie;
+ //Get the serie data labels
+ IOfficeChartDataLabels dataLabels = chart.Series[0].DataPoints.DefaultDataPoint.DataLabels;
+ //Set the leader lines
+ dataLabels.ShowLeaderLines = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the chart type as Pie chart
+ chart.ChartType = OfficeChartType.Pie
+ 'Get the serie data labels
+ Dim dataLabels As IOfficeChartDataLabels = chart.Series(0).DataPoints.DefaultDataPoint.DataLabels
+ 'Set the leader lines
+ dataLabels.ShowLeaderLines = True
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the serie data labels
+ IOfficeChartDataLabels dataLabels = chart.Series[0].DataPoints.DefaultDataPoint.DataLabels;
+ //Set the serie name
+ dataLabels.IsSeriesName = true;
+ //Set the legend key for data labels
+ dataLabels.IsLegendKey = true;
+ //Set the position of data labels
+ dataLabels.Position = OfficeDataLabelPosition.Outside;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the serie data labels
+ Dim dataLabels As IOfficeChartDataLabels = chart.Series(0).DataPoints.DefaultDataPoint.DataLabels
+ 'Set the serie name
+ dataLabels.IsSeriesName = True
+ 'Set the legend key for data labels
+ dataLabels.IsLegendKey = True
+ 'Set the position of data labels
+ dataLabels.Position = OfficeDataLabelPosition.Outside
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the serie data labels
+ IOfficeChartDataLabels dataLabels = chart.Series[0].DataPoints.DefaultDataPoint.DataLabels;
+ //Set the value form cells to datalabels.
+ dataLabels.IsValueFromCells = true;
+ //Set teh value form cells range in datalabels.
+ dataLabels.ValueFromCellsRange=chart.ChartData[3,5,3,7];
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the serie data labels
+ Dim dataLabels As IOfficeChartDataLabels = chart.Series(0).DataPoints.DefaultDataPoint.DataLabels
+ 'Set value form cells to DataLables.
+ 'Set value from cells range in Datalabels'
+ dataLabels.IsValueFromCells = true;
+ dataLabels.ValueFromCellsRange=chart.ChartData[3,5,3,7];
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the serie data labels
+ IOfficeChartDataLabels dataLabels = chart.Series[0].DataPoints.DefaultDataPoint.DataLabels;
+ //Set the value form cells to datalabels.
+ dataLabels.IsValueFromCells = true;
+ //Set teh value form cells range in datalabels.
+ dataLabels.ValueFromCellsRange=chart.ChartData[3,5,3,7];
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the serie data labels
+ Dim dataLabels As IOfficeChartDataLabels = chart.Series(0).DataPoints.DefaultDataPoint.DataLabels
+ 'Set value form cells to DataLables.
+ 'Set value from cells range in Datalabels'
+ dataLabels.IsValueFromCells = true;
+ dataLabels.ValueFromCellsRange=chart.ChartData[3,5,3,7];
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create an instance equivalent to PowerPoint presentation
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart of specific size and position
+ IPresentationChart chart = slide.Charts.AddChart(100, 100, 300, 400);
+ chart.ChartData.SetValue(1, 2, 1);
+ chart.ChartData.SetValue(1, 3, 2);
+ chart.ChartData.SetValue(1, 4, 3);
+ chart.ChartData.SetValue(2, 1, "Blue");
+ chart.ChartData.SetValue(2, 2, 0.4);
+ chart.ChartData.SetValue(2, 3, 0.5);
+ chart.ChartData.SetValue(2, 4, 1.2);
+ chart.ChartData.SetValue(3, 1, "Red");
+ chart.ChartData.SetValue(3, 2, 2.6);
+ chart.ChartData.SetValue(3, 3, 3.6);
+ chart.ChartData.SetValue(3, 4, 2.1);
+ chart.ChartData.SetValue(4, 1, "Orange");
+ chart.ChartData.SetValue(4, 2, 1.1);
+ chart.ChartData.SetValue(4, 3, 0.6);
+ chart.ChartData.SetValue(4, 4, 1.2);
+ chart.ChartData.SetValue(5, 1, "Light Blue");
+ chart.ChartData.SetValue(5, 2, 2.1);
+ chart.ChartData.SetValue(5, 3, 3.4);
+ chart.ChartData.SetValue(5, 4, 1.1);
+ IOfficeChartSerie serieJan = chart.Series.Add("1");
+ //Sets the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 5, 2];
+ IOfficeChartSerie serieFeb = chart.Series.Add("2");
+ //Sets the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 5, 3];
+ //Creates a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("3");
+ //Sets the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 5, 4];
+ //Set chart data range
+ chart.DataRange = chart.ChartData[2, 1, 5, 4];
+ //Specifies the chart type
+ chart.ChartType = OfficeChartType.Bar_Stacked;
+ chart.Series[0].DataPoints.DefaultDataPoint.DataLabels.IsValue = true;
+ //Set the number format of the data label in percentage, round off to two decimal places
+ chart.Series[0].DataPoints.DefaultDataPoint.DataLabels.NumberFormat = "0.00%";
+ //Save the presentation
+ presentation.Save("sample.pptx");
+ //Close the Presentation
+ presentation.Close();
+
+
+ 'Create an instance equivalent to PowerPoint presentation
+ Dim presentationDocument As IPresentation = Presentation.Create()
+ 'Add a blank slide
+ Dim slide As ISlide = presentationDocument.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart of specific size and position
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 100, 300, 400)
+ chart.ChartData.SetValue(1, 2, 1)
+ chart.ChartData.SetValue(1, 3, 2)
+ chart.ChartData.SetValue(1, 4, 3)
+ chart.ChartData.SetValue(2, 1, "Blue")
+ chart.ChartData.SetValue(2, 2, 0.4)
+ chart.ChartData.SetValue(2, 3, 0.5)
+ chart.ChartData.SetValue(2, 4, 1.2)
+ chart.ChartData.SetValue(3, 1, "Red")
+ chart.ChartData.SetValue(3, 2, 2.6)
+ chart.ChartData.SetValue(3, 3, 3.6)
+ chart.ChartData.SetValue(3, 4, 2.1)
+ chart.ChartData.SetValue(4, 1, "Orange")
+ chart.ChartData.SetValue(4, 2, 1.1)
+ chart.ChartData.SetValue(4, 3, 0.6)
+ chart.ChartData.SetValue(4, 4, 1.2)
+ chart.ChartData.SetValue(5, 1, "Light Blue")
+ chart.ChartData.SetValue(5, 2, 2.1)
+ chart.ChartData.SetValue(5, 3, 3.4)
+ chart.ChartData.SetValue(5, 4, 1.1)
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("1")
+ 'Sets the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 5, 2)
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("2")
+ 'Sets the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 5, 3)
+ 'Creates a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("3")
+ 'Sets the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 5, 4)
+ 'Set chart data range
+ chart.DataRange = chart.ChartData(2, 1, 5, 4)
+ 'Specifies the chart type
+ chart.ChartType = OfficeChartType.Bar_Stacked
+ chart.Series(0).DataPoints.DefaultDataPoint.DataLabels.IsValue = True
+ 'Set the number format of the data label in percentage, round off to two decimal places
+ chart.Series(0).DataPoints.DefaultDataPoint.DataLabels.NumberFormat = "0.00%"
+ 'Save the presentation
+ presentationDocument.Save("sample.pptx")
+ 'Close the Presentation
+ presentationDocument.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the chart type
+ chart.ChartType = OfficeChartType.Bar_Stacked_3D;
+ //Get the serie data point
+ IOfficeChartDataPoint dataPoint = chart.Series[0].DataPoints.DefaultDataPoint;
+ //Get the data labels of data point
+ IOfficeChartDataLabels dataLabels = dataPoint.DataLabels;
+ //Set the position of the data label
+ dataLabels.Position = OfficeDataLabelPosition.Center;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the chart type
+ chart.ChartType = OfficeChartType.Bar_Stacked_3D
+ 'Get the serie data point
+ Dim dataPoint As IOfficeChartDataPoint = chart.Series(0).DataPoints.DefaultDataPoint
+ 'Get the data labels of data point
+ Dim dataLabels As IOfficeChartDataLabels = dataPoint.DataLabels
+ 'Set the position of the data label
+ dataLabels.Position = OfficeDataLabelPosition.Center
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the chart type
+ chart.ChartType = OfficeChartType.Bar_Stacked_3D;
+ //Get the serie data point
+ IOfficeChartDataPoint dataPoint = chart.Series[0].DataPoints.DefaultDataPoint;
+ //Gets the index of data point from points collection
+ int index = dataPoint.Index;
+ //Check if the point is default data point
+ bool isDefault = dataPoint.IsDefault;
+ //Set the default marker type
+ dataPoint.IsDefaultmarkertype = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the chart type
+ chart.ChartType = OfficeChartType.Bar_Stacked_3D
+ 'Get the serie data point
+ Dim dataPoint As IOfficeChartDataPoint = chart.Series(0).DataPoints.DefaultDataPoint
+ 'Gets the index of data point from points collection
+ Dim index As Integer = dataPoint.Index
+ 'Check if the point is default data point
+ Dim isDefault As Boolean = dataPoint.IsDefault
+ 'Set the default marker type
+ dataPoint.IsDefaultmarkertype = True
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the chart type
+ chart.ChartType = OfficeChartType.Bar_Stacked_3D;
+ //Get the serie data point
+ IOfficeChartDataPoint dataPoint = chart.Series[0].DataPoints.DefaultDataPoint;
+ //Get the data format of the data point, read only
+ IOfficeChartSerieDataFormat dataFormat = dataPoint.DataFormat;
+ //Set the BarShapeTop
+ dataFormat.BarShapeTop = OfficeTopFormat.Trunc;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the chart type
+ chart.ChartType = OfficeChartType.Bar_Stacked_3D
+ 'Get the serie data point
+ Dim dataPoint As IOfficeChartDataPoint = chart.Series(0).DataPoints.DefaultDataPoint
+ 'Get the data format of the data point, read only
+ Dim dataFormat As IOfficeChartSerieDataFormat = dataPoint.DataFormat
+ 'Set the BarShapeTop
+ dataFormat.BarShapeTop = OfficeTopFormat.Trunc
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the chart type
+ chart.ChartType = OfficeChartType.Bar_Stacked_3D;
+ //Get the serie data point
+ IOfficeChartDataPoint dataPoint = chart.Series[0].DataPoints.DefaultDataPoint;
+ //Gets the index of data point from points collection
+ int index = dataPoint.Index;
+ //Check if the point is default data point
+ bool isDefault = dataPoint.IsDefault;
+ //Set the default marker type
+ dataPoint.IsDefaultmarkertype = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the chart type
+ chart.ChartType = OfficeChartType.Bar_Stacked_3D
+ 'Get the serie data point
+ Dim dataPoint As IOfficeChartDataPoint = chart.Series(0).DataPoints.DefaultDataPoint
+ 'Gets the index of data point from points collection
+ Dim index As Integer = dataPoint.Index
+ 'Check if the point is default data point
+ Dim isDefault As Boolean = dataPoint.IsDefault
+ 'Set the default marker type
+ dataPoint.IsDefaultmarkertype = True
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the chart type
+ chart.ChartType = OfficeChartType.Bar_Stacked_3D;
+ //Get the serie data point
+ IOfficeChartDataPoint dataPoint = chart.Series[0].DataPoints.DefaultDataPoint;
+ //Gets the index of data point from points collection
+ int index = dataPoint.Index;
+ //Check if the point is default data point
+ bool isDefault = dataPoint.IsDefault;
+ //Set the default marker type
+ dataPoint.IsDefaultmarkertype = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the chart type
+ chart.ChartType = OfficeChartType.Bar_Stacked_3D
+ 'Get the serie data point
+ Dim dataPoint As IOfficeChartDataPoint = chart.Series(0).DataPoints.DefaultDataPoint
+ 'Gets the index of data point from points collection
+ Dim index As Integer = dataPoint.Index
+ 'Check if the point is default data point
+ Dim isDefault As Boolean = dataPoint.IsDefault
+ 'Set the default marker type
+ dataPoint.IsDefaultmarkertype = True
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IOfficeChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the series data points
+ IOfficeChartDataPoints dataPoints = chart.Series[0].DataPoints;
+ //Get the default data point, read only
+ IOfficeChartDataPoint dataPoint = dataPoints.DefaultDataPoint;
+ //Get the data labels of data point
+ IOfficeChartDataLabels dataLabels = dataPoint.DataLabels;
+ //Set the position of the data label
+ dataLabels.Position = OfficeDataLabelPosition.Center;
+ //Set the series name
+ dataLabels.IsSeriesName = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IOfficeChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the series data points
+ Dim dataPoints As IOfficeChartDataPoints = chart.Series(0).DataPoints
+ 'Get the default data point, read only
+ Dim dataPoint As IOfficeChartDataPoint = dataPoints.DefaultDataPoint
+ 'Get the data labels of data point
+ Dim dataLabels As IOfficeChartDataLabels = dataPoint.DataLabels
+ 'Set the position of the data label
+ dataLabels.Position = OfficeDataLabelPosition.Center
+ 'Set the series name
+ dataLabels.IsSeriesName = True
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IOfficeChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the series data points
+ IOfficeChartDataPoints dataPoints = chart.Series[0].DataPoints;
+ //Get the data point using the index, read only
+ IOfficeChartDataPoint dataPoint = dataPoints[0];
+ //Get the data labels of data point
+ IOfficeChartDataLabels dataLabels = dataPoint.DataLabels;
+ //Set the position of the data label
+ dataLabels.Position = OfficeDataLabelPosition.Center;
+ //Set the series name
+ dataLabels.IsSeriesName = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IOfficeChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the series data points
+ Dim dataPoints As IOfficeChartDataPoints = chart.Series(0).DataPoints
+ 'Get the data point using the index, read only
+ Dim dataPoint As IOfficeChartDataPoint = dataPoints(0)
+ 'Get the data labels of data point
+ Dim dataLabels As IOfficeChartDataLabels = dataPoint.DataLabels
+ 'Set the position of the data label
+ dataLabels.Position = OfficeDataLabelPosition.Center
+ 'Set the series name
+ dataLabels.IsSeriesName = True
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie – start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie – start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Get data from the chart using specific RowIndex and columnIndex
+ object value = chart.DataRange.GetValue(2, 3);
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie – start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie – start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Get data from the chart using specific RowIndex and columnIndex
+ object value = chart.DataRange.GetValue(2, 3,true);
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to slide
+ IPresentationChart chart = slide.Shapes.AddChart(100, 120, 500, 300);
+ //Sets the data range of chart
+ chart.DataRange = chart.ChartData[1, 2, 4, 3];
+ //Set data to the chart- RowIndex, columnIndex and data
+ chart.ChartData.SetValue(1, 2, "2012");
+ chart.ChartData.SetValue(2, 2, 330);
+ chart.ChartData.SetValue(3, 2, 490);
+ chart.ChartData.SetValue(4, 2, 700);
+ //Set the chart type
+ chart.ChartType = OfficeChartType.Area;
+ //Get the first and last row
+ int _firstRow = chart.DataRange.FirstRow;
+ int _lastRow = chart.DataRange.LastRow;
+ //Get the first and last column
+ int _firstColumn = chart.DataRange.FirstColumn;
+ int _lastColumn = chart.DataRange.LastColumn;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to slide
+ IPresentationChart chart = slide.Shapes.AddChart(100, 120, 500, 300);
+ //Sets the data range of chart
+ chart.DataRange = chart.ChartData[1, 2, 4, 3];
+ //Set data to the chart- RowIndex, columnIndex and data
+ chart.ChartData.SetValue(1, 2, "2012");
+ chart.ChartData.SetValue(2, 2, 330);
+ chart.ChartData.SetValue(3, 2, 490);
+ chart.ChartData.SetValue(4, 2, 700);
+ //Set the chart type
+ chart.ChartType = OfficeChartType.Area;
+ //Get the first and last row
+ int _firstRow = chart.DataRange.FirstRow;
+ int _lastRow = chart.DataRange.LastRow;
+ //Get the first and last column
+ int _firstColumn = chart.DataRange.FirstColumn;
+ int _lastColumn = chart.DataRange.LastColumn;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to slide
+ IPresentationChart chart = slide.Shapes.AddChart(100, 120, 500, 300);
+ //Sets the data range of chart
+ chart.DataRange = chart.ChartData[1, 2, 4, 3];
+ //Set data to the chart- RowIndex, columnIndex and data
+ chart.ChartData.SetValue(1, 2, "2012");
+ chart.ChartData.SetValue(2, 2, 330);
+ chart.ChartData.SetValue(3, 2, 490);
+ chart.ChartData.SetValue(4, 2, 700);
+ //Set the chart type
+ chart.ChartType = OfficeChartType.Area;
+ //Get the first and last row
+ int _firstRow = chart.DataRange.FirstRow;
+ int _lastRow = chart.DataRange.LastRow;
+ //Get the first and last column
+ int _firstColumn = chart.DataRange.FirstColumn;
+ int _lastColumn = chart.DataRange.LastColumn;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to slide
+ IPresentationChart chart = slide.Shapes.AddChart(100, 120, 500, 300);
+ //Sets the data range of chart
+ chart.DataRange = chart.ChartData[1, 2, 4, 3];
+ //Set data to the chart- RowIndex, columnIndex and data
+ chart.ChartData.SetValue(1, 2, "2012");
+ chart.ChartData.SetValue(2, 2, 330);
+ chart.ChartData.SetValue(3, 2, 490);
+ chart.ChartData.SetValue(4, 2, 700);
+ //Set the chart type
+ chart.ChartType = OfficeChartType.Area;
+ //Get the first and last row
+ int _firstRow = chart.DataRange.FirstRow;
+ int _lastRow = chart.DataRange.LastRow;
+ //Get the first and last column
+ int _firstColumn = chart.DataRange.FirstColumn;
+ int _lastColumn = chart.DataRange.LastColumn;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Enable the chart data table
+ chart.HasDataTable = true;
+ //Get the data table of chart
+ IOfficeChartDataTable datatable = chart.DataTable;
+ //Set the horizontal border
+ datatable.HasHorzBorder = true;
+ //Set the vertical border
+ datatable.HasVertBorder = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Enable the chart data table
+ chart.HasDataTable = True
+ 'Get the data table of chart
+ Dim datatable As IOfficeChartDataTable = chart.DataTable
+ 'Set the horizontal border
+ datatable.HasHorzBorder = True
+ 'Set the vertical border
+ datatable.HasVertBorder = True
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Enable the chart data table
+ chart.HasDataTable = true;
+ //Get the data table of chart
+ IOfficeChartDataTable datatable = chart.DataTable;
+ //Set the horizontal border
+ datatable.HasHorzBorder = true;
+ //Set the vertical border
+ datatable.HasVertBorder = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Enable the chart data table
+ chart.HasDataTable = True
+ 'Get the data table of chart
+ Dim datatable As IOfficeChartDataTable = chart.DataTable
+ 'Set the horizontal border
+ datatable.HasHorzBorder = True
+ 'Set the vertical border
+ datatable.HasVertBorder = True
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Enable the chart data table
+ chart.HasDataTable = true;
+ //Get the data table of chart
+ IOfficeChartDataTable datatable = chart.DataTable;
+ //Set the borders
+ datatable.HasBorders = true;
+ //Set the horizontal border
+ datatable.HasHorzBorder = true;
+ //Set the vertical border
+ datatable.HasVertBorder = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Enable the chart data table
+ chart.HasDataTable = True
+ 'Get the data table of chart
+ Dim datatable As IOfficeChartDataTable = chart.DataTable
+ 'Set the horizontal border
+ datatable.HasHorzBorder = True
+ 'Set the vertical border
+ datatable.HasVertBorder = True
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Enable the chart data table
+ chart.HasDataTable = true;
+ //Get the data table of chart
+ IOfficeChartDataTable datatable = chart.DataTable;
+ //Set the horizontal border
+ datatable.HasHorzBorder = true;
+ //Set the vertical border
+ datatable.HasVertBorder = true;
+ //Set the series keys
+ datatable.ShowSeriesKeys = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Enable the chart data table
+ chart.HasDataTable = True
+ 'Get the data table of chart
+ Dim datatable As IOfficeChartDataTable = chart.DataTable
+ 'Set the horizontal border
+ datatable.HasHorzBorder = True
+ 'Set the vertical border
+ datatable.HasVertBorder = True
+ 'Set the series keys
+ datatable.ShowSeriesKeys = True
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Enable the chart data table
+ chart.HasDataTable = true;
+ //Get the data table of chart
+ IOfficeChartDataTable datatable = chart.DataTable;
+ //Get the text area of data table
+ IOfficeChartTextArea textArea = datatable.TextArea;
+ //Set the color of text area
+ textArea.Color = OfficeKnownColors.Violet;
+ //Set the font name
+ textArea.FontName = "Helvetica";
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Enable the chart data table
+ chart.HasDataTable = True
+ 'Get the data table of chart
+ Dim datatable As IOfficeChartDataTable = chart.DataTable
+ 'Get the text area of data table
+ Dim textArea As IOfficeChartTextArea = datatable.TextArea
+ 'Set the color of text area
+ textArea.Color = OfficeKnownColors.Violet
+ 'Set the font name
+ textArea.FontName = "Helvetica"
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the serie format
+ IOfficeChartFillBorder chartFill = chart.Series[0].SerieFormat;
+ //Get the line properties of chart fill
+ IOfficeChartBorder line = chartFill.LineProperties;
+ //Check interior object, read only
+ bool interior = chartFill.HasInterior;
+ //Check for 3D properties, read only
+ bool _3DProperties = chartFill.Has3dProperties;
+ //Check the line properties, read only
+ bool lineProps = chartFill.HasLineProperties;
+ //Check the shadow properties, read only
+ bool shadowProps = chartFill.HasShadowProperties;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the serie format
+ Dim chartFill As IOfficeChartFillBorder = chart.Series(0).SerieFormat
+ 'Get the line properties of chart fill
+ Dim line As IOfficeChartBorder = chartFill.LineProperties
+ 'Check interior object, read only
+ Dim interior As Boolean = chartFill.HasInterior
+ 'Check for 3D properties, read only
+ Dim _3DProperties As Boolean = chartFill.Has3dProperties
+ 'Check the line properties, read only
+ Dim lineProps As Boolean = chartFill.HasLineProperties
+ 'Check the shadow properties, read only
+ Dim shadowProps As Boolean = chartFill.HasShadowProperties
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the serie format
+ IOfficeChartFillBorder chartFill = chart.Series[0].SerieFormat;
+ //Get the line properties of chart fill
+ IOfficeChartBorder line = chartFill.LineProperties;
+ //Check interior object, read only
+ bool interior = chartFill.HasInterior;
+ //Check for 3D properties, read only
+ bool _3DProperties = chartFill.Has3dProperties;
+ //Check the line properties, read only
+ bool lineProps = chartFill.HasLineProperties;
+ //Check the shadow properties, read only
+ bool shadowProps = chartFill.HasShadowProperties;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the serie format
+ Dim chartFill As IOfficeChartFillBorder = chart.Series(0).SerieFormat
+ 'Get the line properties of chart fill
+ Dim line As IOfficeChartBorder = chartFill.LineProperties
+ 'Check interior object, read only
+ Dim interior As Boolean = chartFill.HasInterior
+ 'Check for 3D properties, read only
+ Dim _3DProperties As Boolean = chartFill.Has3dProperties
+ 'Check the line properties, read only
+ Dim lineProps As Boolean = chartFill.HasLineProperties
+ 'Check the shadow properties, read only
+ Dim shadowProps As Boolean = chartFill.HasShadowProperties
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the serie format
+ IOfficeChartFillBorder chartFill = chart.Series[0].SerieFormat;
+ //Get the line properties of chart fill
+ IOfficeChartBorder line = chartFill.LineProperties;
+ //Check interior object, read only
+ bool interior = chartFill.HasInterior;
+ //Check for 3D properties, read only
+ bool _3DProperties = chartFill.Has3dProperties;
+ //Check the line properties, read only
+ bool lineProps = chartFill.HasLineProperties;
+ //Check the shadow properties, read only
+ bool shadowProps = chartFill.HasShadowProperties;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the serie format
+ Dim chartFill As IOfficeChartFillBorder = chart.Series(0).SerieFormat
+ 'Get the line properties of chart fill
+ Dim line As IOfficeChartBorder = chartFill.LineProperties
+ 'Check interior object, read only
+ Dim interior As Boolean = chartFill.HasInterior
+ 'Check for 3D properties, read only
+ Dim _3DProperties As Boolean = chartFill.Has3dProperties
+ 'Check the line properties, read only
+ Dim lineProps As Boolean = chartFill.HasLineProperties
+ 'Check the shadow properties, read only
+ Dim shadowProps As Boolean = chartFill.HasShadowProperties
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the serie format
+ IOfficeChartFillBorder chartFill = chart.Series[0].SerieFormat;
+ //Get the line properties of chart fill
+ IOfficeChartBorder line = chartFill.LineProperties;
+ //Check interior object, read only
+ bool interior = chartFill.HasInterior;
+ //Check for 3D properties, read only
+ bool _3DProperties = chartFill.Has3dProperties;
+ //Check the line properties, read only
+ bool lineProps = chartFill.HasLineProperties;
+ //Check the shadow properties, read only
+ bool shadowProps = chartFill.HasShadowProperties;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the serie format
+ Dim chartFill As IOfficeChartFillBorder = chart.Series(0).SerieFormat
+ 'Get the line properties of chart fill
+ Dim line As IOfficeChartBorder = chartFill.LineProperties
+ 'Check interior object, read only
+ Dim interior As Boolean = chartFill.HasInterior
+ 'Check for 3D properties, read only
+ Dim _3DProperties As Boolean = chartFill.Has3dProperties
+ 'Check the line properties, read only
+ Dim lineProps As Boolean = chartFill.HasLineProperties
+ 'Check the shadow properties, read only
+ Dim shadowProps As Boolean = chartFill.HasShadowProperties
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the serie format
+ IOfficeChartFillBorder chartFill = chart.Series[0].SerieFormat;
+ //Get the line properties of chart fill
+ IOfficeChartBorder line = chartFill.LineProperties;
+ //Set the line color
+ line.LineColor = System.Drawing.Color.DarkGreen;
+ //Set the line weight
+ line.LineWeight = OfficeChartLineWeight.Wide;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the serie format
+ Dim chartFill As IOfficeChartFillBorder = chart.Series(0).SerieFormat
+ 'Get the line properties of chart fill
+ Dim line As IOfficeChartBorder = chartFill.LineProperties
+ 'Set the line color
+ line.LineColor = System.Drawing.Color.DarkGreen
+ 'Set the line weight
+ line.LineWeight = OfficeChartLineWeight.Wide
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the serie format
+ IOfficeChartFillBorder chartFill = chart.Series[0].SerieFormat;
+ //Get the interior of chart fill
+ IOfficeChartInterior _interior = chartFill.Interior;
+ //Enable the automatic format
+ _interior.UseAutomaticFormat = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the serie format
+ Dim chartFill As IOfficeChartFillBorder = chart.Series(0).SerieFormat
+ 'Get the interior of chart fill
+ Dim _interior As IOfficeChartInterior = chartFill.Interior
+ 'Enable the automatic format
+ _interior.UseAutomaticFormat = True
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the serie format
+ IOfficeChartFillBorder chartFill = chart.Series[0].SerieFormat;
+ //Get the line properties of chart fill, read only
+ IOfficeFill fill = chartFill.Fill;
+ //set the fill type as pattern
+ fill.FillType = OfficeFillType.Pattern;
+ //Set the back color
+ fill.BackColor = Color.Red;
+ //Set the fore color
+ fill.ForeColor = Color.Yellow;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the serie format
+ Dim chartFill As IOfficeChartFillBorder = chart.Series(0).SerieFormat
+ 'Get the line properties of chart fill, read only
+ Dim fill As IOfficeFill = chartFill.Fill
+ 'set the fill type as pattern
+ fill.FillType = OfficeFillType.Pattern
+ 'Set the back color
+ fill.BackColor = System.Drawing.Color.Red
+ 'Set the fore color
+ fill.ForeColor = System.Drawing.Color.Yellow
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the serie format
+ IOfficeChartFillBorder chartFill = chart.Series[0].SerieFormat;
+ //Get the shadow properties
+ IThreeDFormat _3Dimension = chartFill.ThreeD;
+ //Set the 3D properties
+ _3Dimension.BevelBottom = Office2007ChartBevelProperties.HardEdge;
+ _3Dimension.BevelBottomHeight = 140;
+ _3Dimension.BevelBottomWidth = 67;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the serie format
+ Dim chartFill As IOfficeChartFillBorder = chart.Series(0).SerieFormat
+ 'Get the shadow properties
+ Dim _3Dimension As IThreeDFormat = chartFill.ThreeD
+ 'Set the 3D properties
+ _3Dimension.BevelBottom = Office2007ChartBevelProperties.HardEdge
+ _3Dimension.BevelBottomHeight = 140
+ _3Dimension.BevelBottomWidth = 67
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the serie format
+ IOfficeChartFillBorder chartFill = chart.Series[0].SerieFormat;
+ //Get the shadow properties
+ IShadow shadow = chartFill.Shadow;
+ //Set the custom shadow style
+ shadow.HasCustomShadowStyle = true;
+ //set the shadow color
+ shadow.ShadowColor = System.Drawing.Color.Green;
+ //Set the shadow with inner preset
+ shadow.ShadowInnerPresets = Office2007ChartPresetsInner.InsideDiagonalBottomRight;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the serie format
+ Dim chartFill As IOfficeChartFillBorder = chart.Series(0).SerieFormat
+ 'Get the shadow properties
+ Dim shadow As IShadow = chartFill.Shadow
+ 'Set the custom shadow style
+ shadow.HasCustomShadowStyle = True
+ 'set the shadow color
+ shadow.ShadowColor = System.Drawing.Color.Green
+ 'Set the shadow with inner preset
+ shadow.ShadowInnerPresets = Office2007ChartPresetsInner.InsideDiagonalBottomRight
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ ISlide slide = presentation.Slides[0];
+ //Get the chart from slide
+ IPresentationChart chart = slide.Shapes[0] as IPresentationChart;
+ //Get the chart serie option
+ IOfficeChartFormat chartFormat = chart.Series[0].SerieFormat.CommonSerieOptions;
+ //Get the First Drop Bar
+ IOfficeChartDropBar dropBar = chartFormat.FirstDropBar;
+ //Set the gap width of data series in chart
+ dropBar.Gap = 100;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ Dim slide As ISlide = presentation__1.Slides(0)
+ 'Get the chart from slide
+ Dim chart As IPresentationChart = TryCast(slide.Shapes(0), IPresentationChart)
+ 'Get the chart serie option
+ Dim chartFormat As IOfficeChartFormat = chart.Series(0).SerieFormat.CommonSerieOptions
+ 'Get the First Drop Bar
+ Dim dropBar As IOfficeChartDropBar = chartFormat.FirstDropBar
+ 'Set the gap width of data series in chart
+ dropBar.Gap = 100
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the chart type
+ chart.ChartType = OfficeChartType.Scatter_Line;
+ //Enable error bar X for a serie
+ chart.Series[0].HasErrorBarsX = true;
+ //Get the error bar X
+ IOfficeChartErrorBars errorBars = chart.Series[0].ErrorBarsX;
+ //Set the type
+ errorBars.Type = OfficeErrorBarType.StandardDeviation;
+ //Set the cap for errorbars
+ errorBars.HasCap = true;
+ //Set the include property
+ errorBars.Include = OfficeErrorBarInclude.Minus;
+ //Clear formats
+ errorBars.ClearFormats();
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the chart type
+ chart.ChartType = OfficeChartType.Scatter_Line
+ 'Enable error bar X for a serie
+ chart.Series(0).HasErrorBarsX = True
+ 'Get the error bar X
+ Dim errorBars As IOfficeChartErrorBars = chart.Series(0).ErrorBarsX
+ 'Set the type
+ errorBars.Type = OfficeErrorBarType.StandardDeviation
+ 'Set the cap for errorbars
+ errorBars.HasCap = True
+ 'Set the include property
+ errorBars.Include = OfficeErrorBarInclude.Minus
+ 'Clear formats
+ errorBars.ClearFormats()
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the chart type
+ chart.ChartType = OfficeChartType.Scatter_Line;
+ //Enable error bar X for a serie
+ chart.Series[0].HasErrorBarsX = true;
+ //Get the error bar X
+ IOfficeChartErrorBars errorBars = chart.Series[0].ErrorBarsX;
+ //Set the type
+ errorBars.Type = OfficeErrorBarType.StandardDeviation;
+ //Set the cap for errorbars
+ errorBars.HasCap = true;
+ //Set the include property
+ errorBars.Include = OfficeErrorBarInclude.Minus;
+ //Delete the error bars
+ errorBars.Delete();
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the chart type
+ chart.ChartType = OfficeChartType.Scatter_Line
+ 'Enable error bar X for a serie
+ chart.Series(0).HasErrorBarsX = True
+ 'Get the error bar X
+ Dim errorBars As IOfficeChartErrorBars = chart.Series(0).ErrorBarsX
+ 'Set the type
+ errorBars.Type = OfficeErrorBarType.StandardDeviation
+ 'Set the cap for errorbars
+ errorBars.HasCap = True
+ 'Set the include property
+ errorBars.Include = OfficeErrorBarInclude.Minus
+ 'Delete the error bars
+ errorBars.Delete()
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the chart type
+ chart.ChartType = OfficeChartType.Scatter_Line;
+ //Enable error bar X for a serie
+ chart.Series[0].HasErrorBarsX = true;
+ //Get the error bar X
+ IOfficeChartErrorBars errorBars = chart.Series[0].ErrorBarsX;
+ //set the border line color
+ errorBars.Border.LineColor = System.Drawing.Color.BlueViolet;
+ //Set the border line weight
+ errorBars.Border.LineWeight = OfficeChartLineWeight.Wide;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the chart type
+ chart.ChartType = OfficeChartType.Scatter_Line
+ 'Enable error bar X for a serie
+ chart.Series(0).HasErrorBarsX = True
+ 'Get the error bar X
+ Dim errorBars As IOfficeChartErrorBars = chart.Series(0).ErrorBarsX
+ 'set the border line color
+ errorBars.Border.LineColor = System.Drawing.Color.BlueViolet
+ 'Set the border line weight
+ errorBars.Border.LineWeight = OfficeChartLineWeight.Wide
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the chart type
+ chart.ChartType = OfficeChartType.Scatter_Line;
+ //Enable error bar X for a serie
+ chart.Series[0].HasErrorBarsX = true;
+ //Get the error bar X
+ IOfficeChartErrorBars errorBars = chart.Series[0].ErrorBarsX;
+ //Set the type
+ errorBars.Type = OfficeErrorBarType.StandardDeviation;
+ //Set the cap for errorbars
+ errorBars.HasCap = true;
+ //Set the include property
+ errorBars.Include = OfficeErrorBarInclude.Minus;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the chart type
+ chart.ChartType = OfficeChartType.Scatter_Line
+ 'Enable error bar X for a serie
+ chart.Series(0).HasErrorBarsX = True
+ 'Get the error bar X
+ Dim errorBars As IOfficeChartErrorBars = chart.Series(0).ErrorBarsX
+ 'Set the type
+ errorBars.Type = OfficeErrorBarType.StandardDeviation
+ 'Set the cap for errorbars
+ errorBars.HasCap = True
+ 'Set the include property
+ errorBars.Include = OfficeErrorBarInclude.Minus
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the chart type
+ chart.ChartType = OfficeChartType.Scatter_Line;
+ //Enable error bar X for a serie
+ chart.Series[0].HasErrorBarsX = true;
+ //Get the error bar X
+ IOfficeChartErrorBars errorBars = chart.Series[0].ErrorBarsX;
+ //Set the type
+ errorBars.Type = OfficeErrorBarType.StandardDeviation;
+ //Set the cap for errorbars
+ errorBars.HasCap = true;
+ //Set the include property
+ errorBars.Include = OfficeErrorBarInclude.Minus;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the chart type
+ chart.ChartType = OfficeChartType.Scatter_Line
+ 'Enable error bar X for a serie
+ chart.Series(0).HasErrorBarsX = True
+ 'Get the error bar X
+ Dim errorBars As IOfficeChartErrorBars = chart.Series(0).ErrorBarsX
+ 'Set the type
+ errorBars.Type = OfficeErrorBarType.StandardDeviation
+ 'Set the cap for errorbars
+ errorBars.HasCap = True
+ 'Set the include property
+ errorBars.Include = OfficeErrorBarInclude.Minus
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the chart type
+ chart.ChartType = OfficeChartType.Scatter_Line;
+ //Enable error bar X for a serie
+ chart.Series[0].HasErrorBarsX = true;
+ //Get the error bar X
+ IOfficeChartErrorBars errorBars = chart.Series[0].ErrorBarsX;
+ //set the border line color
+ errorBars.Border.LineColor = System.Drawing.Color.BlueViolet;
+ //Set the border line weight
+ errorBars.Border.LineWeight = OfficeChartLineWeight.Wide;
+ //Set the type
+ errorBars.Type = OfficeErrorBarType.StandardDeviation;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the chart type
+ chart.ChartType = OfficeChartType.Scatter_Line
+ 'Enable error bar X for a serie
+ chart.Series(0).HasErrorBarsX = True
+ 'Get the error bar X
+ Dim errorBars As IOfficeChartErrorBars = chart.Series(0).ErrorBarsX
+ 'set the border line color
+ errorBars.Border.LineColor = System.Drawing.Color.BlueViolet
+ 'Set the border line weight
+ errorBars.Border.LineWeight = OfficeChartLineWeight.Wide
+ 'Set the type
+ errorBars.Type = OfficeErrorBarType.StandardDeviation
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the chart type
+ chart.ChartType = OfficeChartType.Scatter_Line;
+ //Enable error bar X for a serie
+ chart.Series[0].HasErrorBarsX = true;
+ //Get the error bar X
+ IOfficeChartErrorBars errorBars = chart.Series[0].ErrorBarsX;
+ //Set the include property
+ errorBars.Include = OfficeErrorBarInclude.Minus;
+ //Set the number value
+ errorBars.NumberValue = 12.78;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the chart type
+ chart.ChartType = OfficeChartType.Scatter_Line
+ 'Enable error bar X for a serie
+ chart.Series(0).HasErrorBarsX = True
+ 'Get the error bar X
+ Dim errorBars As IOfficeChartErrorBars = chart.Series(0).ErrorBarsX
+ 'Set the include property
+ errorBars.Include = OfficeErrorBarInclude.Minus
+ 'Set the number value
+ errorBars.NumberValue = 12.78
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the chart type
+ chart.ChartType = OfficeChartType.Scatter_Line;
+ //Enable error bar X for a serie
+ chart.Series[0].HasErrorBarsX = true;
+ //Get the error bar X
+ IOfficeChartErrorBars errorBars = chart.Series[0].ErrorBarsX;
+ //Set the shadow color
+ errorBars.Shadow.ShadowColor = System.Drawing.Color.Brown;
+ //Set the inner preset of shadow
+ errorBars.Shadow.ShadowInnerPresets = Office2007ChartPresetsInner.InsideDiagonalBottomRight;
+ //Set the size of the shadow
+ errorBars.Shadow.Size = 34;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the chart type
+ chart.ChartType = OfficeChartType.Scatter_Line
+ 'Enable error bar X for a serie
+ chart.Series(0).HasErrorBarsX = True
+ 'Get the error bar X
+ Dim errorBars As IOfficeChartErrorBars = chart.Series(0).ErrorBarsX
+ 'Set the shadow color
+ errorBars.Shadow.ShadowColor = System.Drawing.Color.Brown
+ 'Set the inner preset of shadow
+ errorBars.Shadow.ShadowInnerPresets = Office2007ChartPresetsInner.InsideDiagonalBottomRight
+ 'Set the size of the shadow
+ errorBars.Shadow.Size = 34
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the picture fill type for plot area
+ chart.PlotArea.Fill.UserPicture("Image.gif");
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create instance for image
+ System.Drawing.Image image = System.Drawing.Image.FromFile("Image.gif");
+ //Set the picture fill type for chart area
+ chart.ChartArea.Fill.UserPicture(image, "Image");
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create instance for image
+ System.Drawing.Image image = System.Drawing.Image.FromFile("Image.gif");
+ //Set the texture fill type for chart area
+ chart.ChartArea.Fill.UserTexture(image, "Image");
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the texture fill type for plot area
+ chart.PlotArea.Fill.UserTexture("Image.gif");
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the pattern fill for chart area
+ chart.ChartArea.Fill.Patterned(OfficeGradientPattern.Pat_50_Percent);
+ //Set the fore color
+ chart.ChartArea.Fill.ForeColor = System.Drawing.Color.PowderBlue;
+ //Set the back color
+ chart.ChartArea.Fill.BackColor = System.Drawing.Color.Pink;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the preset gradient
+ chart.ChartArea.Fill.PresetGradient(OfficeGradientPreset.Grad_Early_Sunset);
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the preset gradient
+ chart.ChartArea.Fill.PresetGradient(OfficeGradientPreset.Grad_Parchment, OfficeGradientStyle.Horizontal);
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the preset gradient
+ chart.ChartArea.Fill.PresetGradient(OfficeGradientPreset.Grad_Fire, OfficeGradientStyle.FromCorner, OfficeGradientVariants.ShadingVariants_1);
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the preset texture
+ chart.ChartArea.Fill.PresetTextured(OfficeTexture.Canvas);
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the gradient color
+ chart.ChartArea.Fill.TwoColorGradient();
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the gradient color
+ chart.ChartArea.Fill.TwoColorGradient(OfficeGradientStyle.Horizontal);
+ //Set the fore color index
+ chart.ChartArea.Fill.ForeColorIndex = OfficeKnownColors.BlueCustom;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the gradient color
+ chart.ChartArea.Fill.TwoColorGradient(OfficeGradientStyle.Vertical, OfficeGradientVariants.ShadingVariants_2);
+ //Set the fore color index
+ chart.ChartArea.Fill.ForeColorIndex = OfficeKnownColors.BlueCustom;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the fill type as texture
+ chart.ChartArea.Fill.FillType = OfficeFillType.Gradient;
+ //Se the specified fill to one color gradient
+ chart.ChartArea.Fill.OneColorGradient();
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the fill type as texture
+ chart.ChartArea.Fill.FillType = OfficeFillType.Gradient;
+ //Se the specified fill to one color gradient
+ chart.ChartArea.Fill.OneColorGradient(OfficeGradientStyle.Vertical, OfficeGradientVariants.ShadingVariants_2);
+ //Set the fill type for plot area
+ chart.PlotArea.Fill.FillType = OfficeFillType.Gradient;
+ //Set the fore color for plot area
+ chart.PlotArea.Fill.ForeColor = System.Drawing.Color.PowderBlue;
+ //Se the specified fill to one color gradient
+ chart.PlotArea.Fill.OneColorGradient(OfficeGradientStyle.Diagonl_Up);
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the fill type as texture
+ chart.ChartArea.Fill.FillType = OfficeFillType.Gradient;
+ //Se the specified fill to one color gradient
+ chart.ChartArea.Fill.OneColorGradient(OfficeGradientStyle.Vertical, OfficeGradientVariants.ShadingVariants_2);
+ //Set the fill type for plot area
+ chart.PlotArea.Fill.FillType = OfficeFillType.Gradient;
+ //Set the fore color for plot area
+ chart.PlotArea.Fill.ForeColor = System.Drawing.Color.PowderBlue;
+ //Se the specified fill to one color gradient
+ chart.PlotArea.Fill.OneColorGradient(OfficeGradientStyle.Diagonl_Up);
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the solid fill for chart area
+ chart.ChartArea.Fill.Solid();
+ //Set the fore color for chart area
+ chart.ChartArea.Fill.ForeColor = System.Drawing.Color.PowderBlue;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the fill type of the chart area
+ chart.ChartArea.Fill.FillType = OfficeFillType.Gradient;
+ //Set the gradient color type
+ chart.ChartArea.Fill.GradientColorType = OfficeGradientColor.TwoColor;
+ //Set the Back and fore colors
+ chart.ChartArea.Fill.BackColor = System.Drawing.Color.FromArgb(205, 217, 234);
+ chart.ChartArea.Fill.ForeColor = System.Drawing.Color.White;
+ //Set the gradient style
+ chart.ChartArea.Fill.GradientStyle = OfficeGradientStyle.FromCorner;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the fill type of the chart area
+ chart.ChartArea.Fill.FillType = OfficeFillType.Gradient;
+ //Set the gradient color type
+ chart.ChartArea.Fill.GradientColorType = OfficeGradientColor.TwoColor;
+ //Set the Back and fore colors
+ chart.ChartArea.Fill.BackColor = System.Drawing.Color.FromArgb(205, 217, 234);
+ chart.ChartArea.Fill.ForeColor = System.Drawing.Color.White;
+ //Set the gradient style
+ chart.ChartArea.Fill.GradientStyle = OfficeGradientStyle.FromCorner;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the fill type of the chart area
+ chart.ChartArea.Fill.FillType = OfficeFillType.Gradient;
+ //Set the fore color index of the fill
+ chart.ChartArea.Fill.ForeColorIndex = OfficeKnownColors.Brown;
+ //Set the gradient variant
+ chart.ChartArea.Fill.GradientVariant = OfficeGradientVariants.ShadingVariants_2;
+ //Set the preset gradient type
+ chart.ChartArea.Fill.PresetGradientType = OfficeGradientPreset.Grad_Desert;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the fill type of the chart area
+ chart.ChartArea.Fill.FillType = OfficeFillType.Gradient;
+ //Set the gradient color type
+ chart.ChartArea.Fill.GradientColorType = OfficeGradientColor.TwoColor;
+ //Set the Back and fore colors
+ chart.ChartArea.Fill.BackColor = System.Drawing.Color.FromArgb(205, 217, 234);
+ chart.ChartArea.Fill.ForeColor = System.Drawing.Color.White;
+ //Set the gradient style
+ chart.ChartArea.Fill.GradientStyle = OfficeGradientStyle.FromCorner;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the fill type of the chart area
+ chart.ChartArea.Fill.FillType = OfficeFillType.Pattern;
+ //Set the back anf fore color of the pattern
+ chart.ChartArea.Fill.BackColor = System.Drawing.Color.Green;
+ chart.ChartArea.Fill.ForeColor = System.Drawing.Color.Blue;
+ //Set the pattern
+ chart.ChartArea.Fill.Pattern = OfficeGradientPattern.Pat_30_Percent;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the fill type as texture
+ chart.ChartArea.Fill.FillType = OfficeFillType.Texture;
+ //Set the texture type
+ chart.ChartArea.Fill.Texture = OfficeTexture.Blue_Tissue_Paper;
+ //Set the horizontal scale
+ chart.ChartArea.Fill.TextureHorizontalScale = 6.7F;
+ //Set the offset X
+ chart.ChartArea.Fill.TextureOffsetX = 50.40F;
+ //Set the offset Y
+ chart.ChartArea.Fill.TextureOffsetY = 67.54F;
+ //Set the vertical scale
+ chart.ChartArea.Fill.TextureVerticalScale = 4.5F;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the fill type of the chart area
+ chart.ChartArea.Fill.FillType = OfficeFillType.Gradient;
+ //Set the gradient color type
+ chart.ChartArea.Fill.GradientColorType = OfficeGradientColor.OneColor;
+ //Set the gradient degree
+ chart.ChartArea.Fill.GradientDegree = 0.67;
+ //Set the gradient style
+ chart.ChartArea.Fill.GradientStyle = OfficeGradientStyle.Horizontal;
+ //Set the fore color index of the fill
+ chart.ChartArea.Fill.ForeColorIndex = OfficeKnownColors.Blue_grey;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the fill type of the chart area
+ chart.ChartArea.Fill.FillType = OfficeFillType.Pattern;
+ //Set the back anf fore color of the pattern
+ chart.ChartArea.Fill.BackColor = System.Drawing.Color.Green;
+ chart.ChartArea.Fill.ForeColor = System.Drawing.Color.Blue;
+ //Set the pattern
+ chart.ChartArea.Fill.Pattern = OfficeGradientPattern.Pat_30_Percent;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the fill type of the chart area
+ chart.ChartArea.Fill.FillType = OfficeFillType.Pattern;
+ //Set the back anf fore color of the pattern
+ chart.ChartArea.Fill.BackColor = System.Drawing.Color.Green;
+ chart.ChartArea.Fill.ForeColor = System.Drawing.Color.Blue;
+ //Set the pattern
+ chart.ChartArea.Fill.Pattern = OfficeGradientPattern.Pat_30_Percent;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the fill type of the chart area
+ chart.ChartArea.Fill.FillType = OfficeFillType.Gradient;
+ //Set the fore color index of the fill
+ chart.ChartArea.Fill.ForeColorIndex = OfficeKnownColors.Brown;
+ //Set the gradient variant
+ chart.ChartArea.Fill.GradientVariant = OfficeGradientVariants.ShadingVariants_2;
+ //Set the preset gradient type
+ chart.ChartArea.Fill.PresetGradientType = OfficeGradientPreset.Grad_Desert;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the fill type of the chart area
+ chart.ChartArea.Fill.FillType = OfficeFillType.Gradient;
+ //Set the gradient color type
+ chart.ChartArea.Fill.GradientColorType = OfficeGradientColor.OneColor;
+ //Set the gradient degree
+ chart.ChartArea.Fill.GradientDegree = 0.67;
+ //Set the gradient style
+ chart.ChartArea.Fill.GradientStyle = OfficeGradientStyle.Horizontal;
+ //chart.ChartArea.Fill.BackColorIndex = OfficeKnownColors.Blue;
+ chart.ChartArea.Fill.ForeColorIndex = OfficeKnownColors.Blue_grey;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the fill type of the chart area
+ chart.ChartArea.Fill.FillType = OfficeFillType.SolidColor;
+ //chart.ChartArea.Fill.BackColorIndex = OfficeKnownColors.Blue;
+ chart.ChartArea.Fill.ForeColorIndex = OfficeKnownColors.Blue_grey;
+ //Set the transparency of the fill
+ chart.ChartArea.Fill.Transparency = 0.5;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the fill type as texture
+ chart.ChartArea.Fill.FillType = OfficeFillType.Texture;
+ //Set the texture type
+ chart.ChartArea.Fill.Texture = OfficeTexture.Blue_Tissue_Paper;
+ //Set the horizontal scale
+ chart.ChartArea.Fill.TextureHorizontalScale = 6.7F;
+ //Set the offset X
+ chart.ChartArea.Fill.TextureOffsetX = 50.40F;
+ //Set the offset Y
+ chart.ChartArea.Fill.TextureOffsetY = 67.54F;
+ //Set the vertical scale
+ chart.ChartArea.Fill.TextureVerticalScale = 4.5F;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the fill type as texture
+ chart.ChartArea.Fill.FillType = OfficeFillType.Texture;
+ //Set the texture type
+ chart.ChartArea.Fill.Texture = OfficeTexture.Blue_Tissue_Paper;
+ //Set the horizontal scale
+ chart.ChartArea.Fill.TextureHorizontalScale = 6.7F;
+ //Set the offset X
+ chart.ChartArea.Fill.TextureOffsetX = 50.40F;
+ //Set the offset Y
+ chart.ChartArea.Fill.TextureOffsetY = 67.54F;
+ //Set the vertical scale
+ chart.ChartArea.Fill.TextureVerticalScale = 4.5F;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the fill type as texture
+ chart.ChartArea.Fill.FillType = OfficeFillType.Texture;
+ //Set the texture type
+ chart.ChartArea.Fill.Texture = OfficeTexture.Blue_Tissue_Paper;
+ //Set the horizontal scale
+ chart.ChartArea.Fill.TextureHorizontalScale = 6.7F;
+ //Set the offset X
+ chart.ChartArea.Fill.TextureOffsetX = 50.40F;
+ //Set the offset Y
+ chart.ChartArea.Fill.TextureOffsetY = 67.54F;
+ //Set the vertical scale
+ chart.ChartArea.Fill.TextureVerticalScale = 4.5F;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the fill type as texture
+ chart.ChartArea.Fill.FillType = OfficeFillType.Texture;
+ //Set the texture type
+ chart.ChartArea.Fill.Texture = OfficeTexture.Blue_Tissue_Paper;
+ //Set the horizontal scale
+ chart.ChartArea.Fill.TextureHorizontalScale = 6.7F;
+ //Set the offset X
+ chart.ChartArea.Fill.TextureOffsetX = 50.40F;
+ //Set the offset Y
+ chart.ChartArea.Fill.TextureOffsetY = 67.54F;
+ //Set the vertical scale
+ chart.ChartArea.Fill.TextureVerticalScale = 4.5F;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Open a presentation
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ //Get the bubble chart from the slide
+ IPresentationChart chart = presentation.Slides[0].Charts[0];
+ //Set the serie format of chart
+ IOfficeChartFormat format = chart.Series[0].SerieFormat.CommonSerieOptions;
+ //Set the bubble scale
+ format.BubbleScale = 200;
+ //Set the vary color
+ format.IsVaryColor = true;
+ //Set negative bubbles
+ format.ShowNegativeBubbles = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open a presentation
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ 'Get the bubble chart from the slide
+ Dim chart As IPresentationChart = presentation__1.Slides(0).Charts(0)
+ 'Set the serie format of chart
+ Dim format As IOfficeChartFormat = chart.Series(0).SerieFormat.CommonSerieOptions
+ 'Set the bubble scale
+ format.BubbleScale = 200
+ 'Set the vary color
+ format.IsVaryColor = True
+ 'Set negative bubbles
+ format.ShowNegativeBubbles = True
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the chart type
+ chart.ChartType = OfficeChartType.Bar_Clustered;
+ //Set the serie format of chart
+ IOfficeChartFormat format = chart.Series[0].SerieFormat.CommonSerieOptions;
+ //Set the gap width
+ format.GapWidth = 200;
+ //Set the overlap
+ format.Overlap = -90;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the chart type
+ chart.ChartType = OfficeChartType.Bar_Clustered
+ 'Set the serie format of chart
+ Dim format As IOfficeChartFormat = chart.Series(0).SerieFormat.CommonSerieOptions
+ 'Set the gap width
+ format.GapWidth = 200
+ 'Set the overlap
+ format.Overlap = -90
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the chart type as Pie
+ chart.ChartType = OfficeChartType.Pie;
+ //Set the serie format of chart
+ IOfficeChartFormat format = chart.Series[0].SerieFormat.CommonSerieOptions;
+ //Set the angle of first slice
+ format.FirstSliceAngle = 240;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the chart type as Pie
+ chart.ChartType = OfficeChartType.Pie
+ 'Set the serie format of chart
+ Dim format As IOfficeChartFormat = chart.Series(0).SerieFormat.CommonSerieOptions
+ 'Set the angle of first slice
+ format.FirstSliceAngle = 240
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the chart type as Doughtnut
+ chart.ChartType = OfficeChartType.Doughnut;
+ //Set the serie format of chart
+ IOfficeChartFormat format = chart.Series[0].SerieFormat.CommonSerieOptions;
+ //Set the doughnut hole size
+ format.DoughnutHoleSize = 50;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the chart type as Doughtnut
+ chart.ChartType = OfficeChartType.Doughnut
+ 'Set the serie format of chart
+ Dim format As IOfficeChartFormat = chart.Series(0).SerieFormat.CommonSerieOptions
+ 'Set the doughnut hole size
+ format.DoughnutHoleSize = 50
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Open a presentation
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ //Get the bubble chart from the slide
+ IPresentationChart chart = presentation.Slides[0].Charts[0];
+ //Set the serie format of chart
+ IOfficeChartFormat format = chart.Series[0].SerieFormat.CommonSerieOptions;
+ //Set the bubble scale
+ format.BubbleScale = 200;
+ //Set the vary color
+ format.IsVaryColor = true;
+ //Set negative bubbles
+ format.ShowNegativeBubbles = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open a presentation
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ 'Get the bubble chart from the slide
+ Dim chart As IPresentationChart = presentation__1.Slides(0).Charts(0)
+ 'Set the serie format of chart
+ Dim format As IOfficeChartFormat = chart.Series(0).SerieFormat.CommonSerieOptions
+ 'Set the bubble scale
+ format.BubbleScale = 200
+ 'Set the vary color
+ format.IsVaryColor = True
+ 'Set negative bubbles
+ format.ShowNegativeBubbles = True
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Open a presentation
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ //Get the bubble chart from the slide
+ IPresentationChart chart = presentation.Slides[0].Charts[0];
+ //Set the serie format of chart
+ IOfficeChartFormat format = chart.Series[0].SerieFormat.CommonSerieOptions;
+ //Set the bubble scale
+ format.BubbleScale = 200;
+ //Set the vary color
+ format.IsVaryColor = true;
+ //Set negative bubbles
+ format.ShowNegativeBubbles = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open a presentation
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ 'Get the bubble chart from the slide
+ Dim chart As IPresentationChart = presentation__1.Slides(0).Charts(0)
+ 'Set the serie format of chart
+ Dim format As IOfficeChartFormat = chart.Series(0).SerieFormat.CommonSerieOptions
+ 'Set the bubble scale
+ format.BubbleScale = 200
+ 'Set the vary color
+ format.IsVaryColor = True
+ 'Set negative bubbles
+ format.ShowNegativeBubbles = True
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the chart type as Radar
+ chart.ChartType = OfficeChartType.Radar;
+ //Set the serie format of chart
+ IOfficeChartFormat format = chart.Series[0].SerieFormat.CommonSerieOptions;
+ //Set the axis labels
+ format.HasRadarAxisLabels = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the chart type as Radar
+ chart.ChartType = OfficeChartType.Radar
+ 'Set the serie format of chart
+ Dim format As IOfficeChartFormat = chart.Series(0).SerieFormat.CommonSerieOptions
+ 'Set the axis labels
+ format.HasRadarAxisLabels = True
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set border settings
+ chart.PlotArea.Border.AutoFormat = false;
+ //Set the auto line color
+ chart.PlotArea.Border.IsAutoLineColor = false;
+ //Set the border line color
+ chart.PlotArea.Border.LineColor = System.Drawing.Color.Blue;
+ //Set the border line pattern
+ chart.PlotArea.Border.LinePattern = OfficeChartLinePattern.DashDot;
+ //Set the border line weight
+ chart.PlotArea.Border.LineWeight = OfficeChartLineWeight.Wide;
+ //Set the border transparency
+ chart.PlotArea.Border.Transparency = 0.6;
+ //Set the plot area�s fill type
+ chart.PlotArea.Fill.FillType = OfficeFillType.SolidColor;
+ //Set the plot area�s fill color
+ chart.PlotArea.Fill.ForeColor = System.Drawing.Color.LightPink;
+ //Set the plot area shodow presence
+ chart.PlotArea.Shadow.ShadowInnerPresets = Office2007ChartPresetsInner.InsideDiagonalTopLeft;
+ //Reset the plotarea
+ chart.PlotArea.Clear();
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set border settings
+ chart.PlotArea.Border.AutoFormat = False
+ 'Set the auto line color
+ chart.PlotArea.Border.IsAutoLineColor = False
+ 'Set the border line color
+ chart.PlotArea.Border.LineColor = System.Drawing.Color.Blue
+ 'Set the border line pattern
+ chart.PlotArea.Border.LinePattern = OfficeChartLinePattern.DashDot
+ 'Set the border line weight
+ chart.PlotArea.Border.LineWeight = OfficeChartLineWeight.Wide
+ 'Set the border transparency
+ chart.PlotArea.Border.Transparency = 0.6
+ 'Set the plot area�s fill type
+ chart.PlotArea.Fill.FillType = OfficeFillType.SolidColor
+ 'Set the plot area�s fill color
+ chart.PlotArea.Fill.ForeColor = System.Drawing.Color.LightPink
+ 'Set the plot area shodow presence
+ chart.PlotArea.Shadow.ShadowInnerPresets = Office2007ChartPresetsInner.InsideDiagonalTopLeft
+ 'Reset the plotarea
+ chart.PlotArea.Clear()
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Set the borders with rounded corners
+ chart.ChartArea.IsBorderCornersRound = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Set the borders with rounded corners
+ chart.ChartArea.IsBorderCornersRound = True
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Format Chart Area.
+ IOfficeChartFrameFormat chartArea = chart.ChartArea;
+ //Chart Area Border Settings
+ //Style
+ chartArea.Border.LinePattern = OfficeChartLinePattern.Solid;
+ //Color
+ chartArea.Border.LineColor = System.Drawing.Color.Blue;
+ //Weight
+ chartArea.Border.LineWeight = OfficeChartLineWeight.Hairline;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Format Chart Area.
+ Dim chartArea As IOfficeChartFrameFormat = chart.ChartArea
+ 'Chart Area Border Settings
+ 'Style
+ chartArea.Border.LinePattern = OfficeChartLinePattern.Solid
+ 'Color
+ chartArea.Border.LineColor = System.Drawing.Color.Blue
+ 'Weight
+ chartArea.Border.LineWeight = OfficeChartLineWeight.Hairline
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Open a presentation
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ //Get a bubble chart from the slide
+ IPresentationChart chart = presentation.Slides[0].Charts[0];
+ //Format Plot Area
+ IOfficeChartFrameFormat plotArea = chart.PlotArea;
+ //Set the height mode
+ plotArea.Layout.Height = 150;
+ plotArea.Layout.HeightMode = LayoutModes.factor;
+ //Set the top mode
+ plotArea.Layout.Top = 100;
+ plotArea.Layout.TopMode = LayoutModes.edge;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open a presentation
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ 'Get a bubble chart from the slide
+ Dim chart As IPresentationChart = presentation__1.Slides(0).Charts(0)
+ 'Format Plot Area
+ Dim plotArea As IOfficeChartFrameFormat = chart.PlotArea
+ 'Set the height mode
+ plotArea.Layout.Height = 150
+ plotArea.Layout.HeightMode = LayoutModes.factor
+ 'Set the top mode
+ plotArea.Layout.Top = 100
+ plotArea.Layout.TopMode = LayoutModes.edge
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Delete gridline
+ chart.PrimaryValueAxis.MajorGridLines.Delete();
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Delete gridline
+ chart.PrimaryValueAxis.MajorGridLines.Delete()
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Get the major grid line
+ IOfficeChartGridLine gridLine = chart.PrimaryValueAxis.MajorGridLines;
+ //Set the line pattern
+ gridLine.Border.LinePattern = OfficeChartLinePattern.DarkGray;
+ //Set the line weight
+ gridLine.Border.LineWeight = OfficeChartLineWeight.Hairline;
+ //Set the line color
+ gridLine.Border.LineColor = System.Drawing.Color.Green;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Get the major grid line
+ Dim gridLine As IOfficeChartGridLine = chart.PrimaryValueAxis.MajorGridLines
+ 'Set the line pattern
+ gridLine.Border.LinePattern = OfficeChartLinePattern.DarkGray
+ 'Set the line weight
+ gridLine.Border.LineWeight = OfficeChartLineWeight.Hairline
+ 'Set the line color
+ gridLine.Border.LineColor = System.Drawing.Color.Green
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Open a presentation containing charts
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ //Get the slide from presentation
+ ISlide slide = presentation.Slides[0];
+ //Get the chart from slide
+ IPresentationChart chart = slide.Charts[0];
+ //Refresh the chart to set worksheet data to current chart
+ chart.Refresh();
+ //Save the presentation
+ presentation.Save("Sample.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open a presentation containing charts
+ Dim presentation As IPresentation = Presentation.Open("Template.pptx")
+ 'Get the slide from presentation
+ Dim slide As ISlide = presentation.Slides(0)
+ 'Get the chart from slide
+ Dim chart As IPresentationChart = slide.Charts(0)
+ 'Refresh the chart to set worksheet data to current chart
+ chart.Refresh()
+ 'Save the presentation
+ presentation.Save("Sample.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ //Open the presentation
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ //Initialize the ChartToImageConverter class; this is mandatory
+ presentation.ChartToImageConverter = new ChartToImageConverter();
+ //Set the scaling mode for quality
+ presentation.ChartToImageConverter.ScalingMode = Syncfusion.OfficeChart.ScalingMode.Best;
+ //Get the first slide
+ ISlide slide = presentation.Slides[0];
+ //Get the chart in slide
+ IPresentationChart chart = slide.Shapes[0] as IPresentationChart;
+ //Create a stream instance to store the image
+ MemoryStream stream = new MemoryStream();
+ //Save the image to stream
+ chart.SaveAsImage(stream);
+ //Save the stream to a file
+ using (FileStream fileStream = File.Create("ChartImage.png", (int)stream.Length))
+ fileStream.Write(stream.ToArray(), 0, stream.ToArray().Length);
+ //Close the stream
+ stream.Close();
+ //Save the Presentation
+ presentation.Save("output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open the presentation
+ Dim presentation As IPresentation = Presentation.Open("Template.pptx")
+ 'Initialize the ChartToImageConverter class; this is mandatory
+ presentation.ChartToImageConverter = New ChartToImageConverter()
+ 'Set the scaling mode for quality
+ presentation.ChartToImageConverter.ScalingMode = Syncfusion.OfficeChart.ScalingMode.Best
+ 'Get the first slide
+ Dim slide As ISlide = presentation.Slides(0)
+ 'Get the chart in slide
+ Dim chart As IPresentationChart = TryCast(slide.Shapes(0), IPresentationChart)
+ 'Create a stream instance to store the image
+ Dim stream As New MemoryStream()
+ 'Save the image to stream
+ chart.SaveAsImage(stream)
+ 'Save the stream to a file
+ Using fileStream As FileStream = File.Create("ChartImage.png", CInt(stream.Length))
+ fileStream.Write(stream.ToArray(), 0, stream.ToArray().Length)
+ End Using
+ 'Close the stream
+ stream.Close()
+ 'Save the Presentation
+ presentation.Save("output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ //Create a new PowerPoint presentation
+ IPresentation presentation = Presentation.Create();
+ //Add slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to slide
+ IPresentationChart chart = slide.Charts.AddChart(100, 100, 300, 200);
+ //Create an instance of object array
+ object[][] chartData = { new object[3], new object[4] };
+ //Invoke setChartData method by passing object array
+ chart.SetChartData(chartData);
+ //Set the chart title
+ chart.ChartTitle = "Chart";
+ //Save the Presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a new PowerPoint presentation
+ Dim presentation As IPresentation = Presentation.Create()
+ 'Add slide to the presentation
+ Dim slide As ISlide = presentation.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to slide
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 100, 300, 200)
+ 'Create an instance of object array
+ Dim chartData As Object()() = {New Object(2) {}, New Object(3) {}}
+ 'Invoke setChartData method by passing object array
+ chart.SetChartData(chartData)
+ 'Set the chart title
+ chart.ChartTitle = "Chart"
+ 'Save the Presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ //Create a new PowerPoint presentation
+ IPresentation presentation = Presentation.Create();
+ //Add slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to slide
+ IPresentationChart chart = slide.Charts.AddChart(100, 100, 300, 300);
+ //Create an instance of object array
+ object[][] dataRange = { new object[5], new object[5] };
+ //Invoke set data Range method
+ chart.SetDataRange(dataRange, 1, 3);
+ //Save the Presentation
+ presentation.Save("output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a new PowerPoint presentation
+ Dim presentation As IPresentation = Presentation.Create()
+ 'Add slide to the presentation
+ Dim slide As ISlide = presentation.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to slide
+ Dim chart As IPresentationChart= slide.Charts.AddChart(100, 100, 300, 300)
+ 'Create an instance of object array
+ Dim dataRange As Object()() = {New Object(4) {}, New Object(4) {}}
+ 'Invoke set data Range method
+ chart.SetDataRange(dataRange, 1, 3)
+ 'Save the Presentation
+ presentation.Save("output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Specify the chart title
+ chart.ChartTitle = "Sales Analysis";
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Specify the chart type
+ chart.ChartType = OfficeChartType.Surface_3D;
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the data range of the category axis
+ chart.PrimaryCategoryAxis.CategoryLabels = chart.ChartData[2, 1, 4, 1];
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 700, 500)
+ 'Specify the chart title
+ chart.ChartTitle = "Sales Analysis"
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Specify the chart type
+ chart.ChartType = OfficeChartType.Surface_3D
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the data range of the category axis
+ chart.PrimaryCategoryAxis.CategoryLabels = chart.ChartData(2, 1, 4, 1)
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to slide
+ IPresentationChart chart = slide.Shapes.AddChart(100, 120, 500, 300);
+ //Sets the data range of chart
+ chart.DataRange = chart.ChartData[1, 2, 4, 3];
+ //Set data to the chart- RowIndex, columnIndex and data
+ chart.ChartData.SetValue(1, 2, "2012");
+ chart.ChartData.SetValue(2, 2, 330);
+ chart.ChartData.SetValue(3, 2, 490);
+ chart.ChartData.SetValue(4, 2, 700);
+ chart.ChartType = OfficeChartType.Area;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to slide
+ Dim chart As IPresentationChart = slide.Shapes.AddChart(100, 120, 500, 300)
+ 'Sets the data range of chart
+ chart.DataRange = chart.ChartData(1, 2, 4, 3)
+ 'Set data to the chart- RowIndex, columnIndex and data
+ chart.ChartData.SetValue(1, 2, "2012")
+ chart.ChartData.SetValue(2, 2, 330)
+ chart.ChartData.SetValue(3, 2, 490)
+ chart.ChartData.SetValue(4, 2, 700)
+ chart.ChartType = OfficeChartType.Area
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Specify the chart title
+ chart.ChartTitle = "Sales Analysis";
+ //Specify the chart type
+ chart.ChartType = OfficeChartType.Column_Clustered;
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the data range of the category axis
+ chart.PrimaryCategoryAxis.CategoryLabels = chart.ChartData[2, 1, 4, 1];
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 700, 500)
+ 'Specify the chart title
+ chart.ChartTitle = "Sales Analysis"
+ 'Specify the chart type
+ chart.ChartType = OfficeChartType.Column_Clustered
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the data range of the category axis
+ chart.PrimaryCategoryAxis.CategoryLabels = chart.ChartData(2, 1, 4, 1)
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Specify the chart title
+ chart.ChartTitle = "Sales Analysis";
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Specify the chart type
+ chart.ChartType = OfficeChartType.Surface_3D;
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the data range of the category axis
+ chart.PrimaryCategoryAxis.CategoryLabels = chart.ChartData[2, 1, 4, 1];
+ //Get the chart title text area
+ IOfficeChartTextArea textArea = chart.ChartTitleArea;
+ //Set the background mode of the title area
+ textArea.BackgroundMode = OfficeChartBackgroundMode.Transparent;
+ //Set bold font style
+ textArea.Bold = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 700, 500)
+ 'Specify the chart title
+ chart.ChartTitle = "Sales Analysis"
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Specify the chart type
+ chart.ChartType = OfficeChartType.Surface_3D
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the data range of the category axis
+ chart.PrimaryCategoryAxis.CategoryLabels = chart.ChartData(2, 1, 4, 1)
+ 'Get the chart title text area
+ Dim textArea As IOfficeChartTextArea = chart.ChartTitleArea
+ 'Set the background mode of the title area
+ textArea.BackgroundMode = OfficeChartBackgroundMode.Transparent
+ 'Set bold font style
+ textArea.Bold = True
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the x - position of the chart
+ chart.XPos = 300;
+ //Set the y - position of the chart
+ chart.YPos = 140;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the x - position of the chart
+ chart.XPos = 300
+ 'Set the y - position of the chart
+ chart.YPos = 140
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the x - position of the chart
+ chart.XPos = 300;
+ //Set the y - position of the chart
+ chart.YPos = 140;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the x - position of the chart
+ chart.XPos = 300
+ 'Set the y - position of the chart
+ chart.YPos = 140
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ //Open the presentation
+ IPresentation presentation = Presentation.Open("Sample.pptx");
+ //Get the first slide
+ ISlide slide = presentation.Slides[0];
+ //Get the chart in slide
+ IPresentationChart chart = slide.Shapes[0] as IPresentationChart;
+ //Modify the chart height
+ chart.Height = 500;
+ //Modify the chart width
+ chart.Width = 700;
+ //Change the title
+ chart.ChartTitle = "New title";
+ //Change the serie name of first chart serie
+ chart.Series[0].Name = "Modified serie name";
+ //Hiding the category labels
+ chart.CategoryLabelLevel = OfficeCategoriesLabelLevel.CategoriesLabelLevelNone;
+ //Show Data Table.
+ chart.HasDataTable = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open the presentation
+ Dim presentation As IPresentation = Presentation.Open("Sample.pptx")
+ 'Get the first slide
+ Dim slide As ISlide = presentation.Slides(0)
+ 'Get the chart in slide
+ Dim chart As IPresentationChart = TryCast(slide.Shapes(0), IPresentationChart)
+ 'Modify the chart height
+ chart.Height = 500
+ 'Modify the chart width
+ chart.Width = 700
+ 'Change the title
+ chart.ChartTitle = "New title"
+ 'Change the serie name of first chart serie
+ chart.Series(0).Name = "Modified serie name"
+ 'Hiding the category labels
+ chart.CategoryLabelLevel = OfficeCategoriesLabelLevel.CategoriesLabelLevelNone
+ 'Show Data Table.
+ chart.HasDataTable = True
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ //Open the presentation
+ IPresentation presentation = Presentation.Open("Sample.pptx");
+ //Get the first slide
+ ISlide slide = presentation.Slides[0];
+ //Get the chart in slide
+ IPresentationChart chart = slide.Shapes[0] as IPresentationChart;
+ //Modify the chart height
+ chart.Height = 500;
+ //Modify the chart width
+ chart.Width = 700;
+ //Change the title
+ chart.ChartTitle = "New title";
+ //Change the serie name of first chart serie
+ chart.Series[0].Name = "Modified serie name";
+ //Hiding the category labels
+ chart.CategoryLabelLevel = OfficeCategoriesLabelLevel.CategoriesLabelLevelNone;
+ //Show Data Table.
+ chart.HasDataTable = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open the presentation
+ Dim presentation As IPresentation = Presentation.Open("Sample.pptx")
+ 'Get the first slide
+ Dim slide As ISlide = presentation.Slides(0)
+ 'Get the chart in slide
+ Dim chart As IPresentationChart = TryCast(slide.Shapes(0), IPresentationChart)
+ 'Modify the chart height
+ chart.Height = 500
+ 'Modify the chart width
+ chart.Width = 700
+ 'Change the title
+ chart.ChartTitle = "New title"
+ 'Change the serie name of first chart serie
+ chart.Series(0).Name = "Modified serie name"
+ 'Hiding the category labels
+ chart.CategoryLabelLevel = OfficeCategoriesLabelLevel.CategoriesLabelLevelNone
+ 'Show Data Table.
+ chart.HasDataTable = True
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ //Open the presentation
+ IPresentation presentation = Presentation.Open("Sample.pptx");
+ //Get the first slide
+ ISlide slide = presentation.Slides[0];
+ //Get the chart in slide
+ IPresentationChart chart = slide.Shapes[0] as IPresentationChart;
+ //Modify the chart height
+ chart.Height = 500;
+ //Modify the chart width
+ chart.Width = 700;
+ //Change the title
+ chart.ChartTitle = "New title";
+ //Change the serie name of first chart serie
+ chart.Series[0].Name = "Modified serie name";
+ //Hiding the category labels
+ chart.CategoryLabelLevel = OfficeCategoriesLabelLevel.CategoriesLabelLevelNone;
+ //Show Data Table.
+ chart.HasDataTable = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open the presentation
+ Dim presentation As IPresentation = Presentation.Open("Sample.pptx")
+ 'Get the first slide
+ Dim slide As ISlide = presentation.Slides(0)
+ 'Get the chart in slide
+ Dim chart As IPresentationChart = TryCast(slide.Shapes(0), IPresentationChart)
+ 'Modify the chart height
+ chart.Height = 500
+ 'Modify the chart width
+ chart.Width = 700
+ 'Change the title
+ chart.ChartTitle = "New title"
+ 'Change the serie name of first chart serie
+ chart.Series(0).Name = "Modified serie name"
+ 'Hiding the category labels
+ chart.CategoryLabelLevel = OfficeCategoriesLabelLevel.CategoriesLabelLevelNone
+ 'Show Data Table.
+ chart.HasDataTable = True
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the primary category axis
+ IOfficeChartCategoryAxis primaryCategoryAxis = chart.PrimaryCategoryAxis;
+ //Set the data range of the category axis
+ primaryCategoryAxis.CategoryLabels = chart.ChartData[2, 1, 4, 1];
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the primary category axis
+ Dim primaryCategoryAxis As IOfficeChartCategoryAxis = chart.PrimaryCategoryAxis
+ 'Set the data range of the category axis
+ primaryCategoryAxis.CategoryLabels = chart.ChartData(2, 1, 4, 1)
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the primary value axis
+ IOfficeChartValueAxis primaryValueAxis = chart.PrimaryValueAxis;
+ //Set bold font style
+ primaryValueAxis.Font.Bold = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the primary value axis
+ Dim primaryValueAxis As IOfficeChartValueAxis = chart.PrimaryValueAxis
+ 'Set bold font style
+ primaryValueAxis.Font.Bold = True
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the chart type
+ chart.ChartType = OfficeChartType.Column_3D;
+ //Get the primary serie axis
+ IOfficeChartSeriesAxis primarySerieAxis = chart.PrimarySerieAxis;
+ //Set the font style of serie axis
+ primarySerieAxis.Font.Italic = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the chart type
+ chart.ChartType = OfficeChartType.Column_3D
+ 'Get the primary serie axis
+ Dim primarySerieAxis As IOfficeChartSeriesAxis = chart.PrimarySerieAxis
+ 'Set the font style of serie axis
+ primarySerieAxis.Font.Italic = True
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ //Open a presentation with Combinational chart type
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ ISlide slide = presentation.Slides[0];
+ //Get the chart from slide
+ IPresentationChart chart = slide.Shapes[0] as IPresentationChart;
+ //Get the secondary category axis
+ IOfficeChartCategoryAxis secondaryCategoryAxis = chart.PrimaryCategoryAxis;
+ //Set the minor grid lines
+ secondaryCategoryAxis.HasMinorGridLines = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open a presentation with Combinational chart type
+ Dim presentation As IPresentation = Presentation.Open("Template.pptx")
+ Dim slide As ISlide = presentation.Slides(0)
+ 'Get the chart from slide
+ Dim chart As IPresentationChart = TryCast(slide.Shapes(0), IPresentationChart)
+ 'Get the secondary category axis
+ Dim secondaryCategoryAxis As IOfficeChartCategoryAxis = chart.PrimaryCategoryAxis
+ 'Set the minor grid lines
+ secondaryCategoryAxis.HasMinorGridLines = True
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ //Open a presentation with Combinational chart type
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ ISlide slide = presentation.Slides[0];
+ //Get the chart from slide
+ IPresentationChart chart = slide.Shapes[0] as IPresentationChart;
+ //Get the secondary value axis
+ IOfficeChartValueAxis secondaryValueAxis = chart.SecondaryValueAxis;
+ //Set the tick label position
+ secondaryValueAxis.TickLabelPosition = OfficeTickLabelPosition.TickLabelPosition_NextToAxis;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open a presentation with Combinational chart type
+ Dim presentation As IPresentation = Presentation.Open("Template.pptx")
+ Dim slide As ISlide = presentation.Slides(0)
+ 'Get the chart from slide
+ Dim chart As IPresentationChart = TryCast(slide.Shapes(0), IPresentationChart)
+ 'Get the secondary value axis
+ Dim secondaryValueAxis As IOfficeChartValueAxis = chart.SecondaryValueAxis
+ 'Set the tick label position
+ secondaryValueAxis.TickLabelPosition = OfficeTickLabelPosition.TickLabelPosition_NextToAxis
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ //Create a new presentation
+ IPresentation presentation = Presentation.Create();
+ //Add slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to slide
+ IPresentationChart chart = slide.Shapes.AddChart(100, 100, 400, 300);
+ //Set the chart data value
+ chart.ChartData.SetValue(1, 2, "1");
+ chart.ChartData.SetValue(2, 1, "A");
+ chart.ChartData.SetValue(2, 2, 20);
+ //Set chart data range
+ chart.DataRange = chart.ChartData[2, 2, 4, 4];
+ //Set the chart type
+ chart.ChartType = OfficeChartType.Column_Clustered;
+ //Get the chart area
+ IOfficeChartFrameFormat chartArea = chart.ChartArea;
+ //Set the line pattern of chart border
+ chartArea.Border.LinePattern = OfficeChartLinePattern.DashDotDot;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a new presentation
+ Dim presentation As IPresentation = Presentation.Create()
+ 'Add slide to the presentation
+ Dim slide As ISlide = presentation.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to slide
+ Dim chart As IPresentationChart = slide.Shapes.AddChart(100, 100, 400, 300)
+ 'Set the chart data value
+ chart.ChartData.SetValue(1, 2, "1")
+ chart.ChartData.SetValue(2, 1, "A")
+ chart.ChartData.SetValue(2, 2, 20)
+ 'Set chart data range
+ chart.DataRange = chart.ChartData(2, 2, 4, 4)
+ 'Set the chart type
+ chart.ChartType = OfficeChartType.Column_Clustered
+ 'Get the chart area
+ Dim chartArea As IOfficeChartFrameFormat = chart.ChartArea
+ 'Set the line pattern of chart border
+ chartArea.Border.LinePattern = OfficeChartLinePattern.DashDotDot
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the chart type
+ chart.ChartType = OfficeChartType.Column_3D;
+ //Set the fill type of wall as pattern
+ chart.Walls.Fill.FillType = OfficeFillType.Pattern;
+ //set the back color of the pattern fill
+ chart.Walls.Fill.BackColor = Color.AliceBlue;
+ //Set the fore color of the pattern fill
+ chart.Walls.Fill.ForeColor = Color.Brown;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the chart type
+ chart.ChartType = OfficeChartType.Column_3D
+ 'Set the fill type of wall as pattern
+ chart.Walls.Fill.FillType = OfficeFillType.Pattern
+ 'set the back color of the pattern fill
+ chart.Walls.Fill.BackColor = Color.AliceBlue
+ 'Set the fore color of the pattern fill
+ chart.Walls.Fill.ForeColor = Color.Brown
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ //Open the presentation
+ IPresentation presentation = Presentation.Open("Sample.pptx");
+ //Get the first slide
+ ISlide slide = presentation.Slides[0];
+ //Get the chart in slide
+ IPresentationChart chart = slide.Shapes[0] as IPresentationChart;
+ //Change the chart type to 3D
+ chart.ChartType = OfficeChartType.Bar_Clustered_3D;
+ //Set the rotation
+ chart.Rotation = 80;
+ //Set the shadow angle
+ chart.SideWall.Shadow.Angle = 60;
+ //Set the backwall border weight
+ chart.BackWall.Border.LineWeight = OfficeChartLineWeight.Narrow;
+ //Save the presentation
+ presentation.Save("output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open the presentation
+ Dim presentation As IPresentation = Presentation.Open("Sample.pptx")
+ 'Get the first slide
+ Dim slide As ISlide = presentation.Slides(0)
+ 'Get the chart in slide
+ Dim chart As IPresentationChart = TryCast(slide.Shapes(0), IPresentationChart)
+ 'Change the chart type to 3D
+ chart.ChartType = OfficeChartType.Bar_Clustered_3D
+ 'Set the rotation
+ chart.Rotation = 80
+ 'Set the shadow angle
+ chart.SideWall.Shadow.Angle = 60
+ 'Set the backwall border weight
+ chart.BackWall.Border.LineWeight = OfficeChartLineWeight.Narrow
+ 'Save the presentation
+ presentation.Save("output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Specify the chart title
+ chart.ChartTitle = "Sales Analysis";
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the data range of the category axis
+ chart.PrimaryCategoryAxis.CategoryLabels = chart.ChartData[2, 1, 4, 1];
+ //Specify the chart type
+ chart.ChartType = OfficeChartType.Surface_3D;
+ //Get the back wall of the chart
+ IOfficeChartWallOrFloor backWall = chart.BackWall;
+ //Set the line properties of the back wall
+ backWall.LineProperties.LineWeight = OfficeChartLineWeight.Narrow;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 700, 500)
+ 'Specify the chart title
+ chart.ChartTitle = "Sales Analysis"
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the data range of the category axis
+ chart.PrimaryCategoryAxis.CategoryLabels = chart.ChartData(2, 1, 4, 1)
+ 'Specify the chart type
+ chart.ChartType = OfficeChartType.Surface_3D
+ 'Get the back wall of the chart
+ Dim backWall As IOfficeChartWallOrFloor = chart.BackWall
+ 'Set the line properties of the back wall
+ backWall.LineProperties.LineWeight = OfficeChartLineWeight.Narrow
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the chart type
+ chart.ChartType = OfficeChartType.Column_3D;
+ //Get the floor of chart
+ IOfficeChartWallOrFloor floor = chart.Floor;
+ //Set the filltype of floor as pattern fill
+ floor.Fill.FillType = OfficeFillType.Pattern;
+ //Set the back and fore color of the pattern fill
+ floor.Fill.BackColor = Color.Blue;
+ floor.Fill.ForeColor = Color.Brown;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the chart type
+ chart.ChartType = OfficeChartType.Column_3D
+ 'Get the floor of chart
+ Dim floor As IOfficeChartWallOrFloor = chart.Floor
+ 'Set the filltype of floor as pattern fill
+ floor.Fill.FillType = OfficeFillType.Pattern
+ 'Set the back and fore color of the pattern fill
+ floor.Fill.BackColor = Color.Blue
+ floor.Fill.ForeColor = Color.Brown
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ ISlide slide = presentation.Slides[0];
+ //Get the chart from slide
+ IPresentationChart chart = slide.Shapes[0] as IPresentationChart;
+ //Set the chart with data table
+ chart.HasDataTable = true;
+ //Get the data table, read only
+ IOfficeChartDataTable dataTable = chart.DataTable;
+ //set borders for data table
+ dataTable.HasBorders = true;
+ //Set the show serie keys
+ dataTable.ShowSeriesKeys = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation As IPresentation = Presentation.Open("Template.pptx")
+ Dim slide As ISlide = presentation.Slides(0)
+ 'Get the chart from slide
+ Dim chart As IPresentationChart = TryCast(slide.Shapes(0), IPresentationChart)
+ 'Set the chart with data table
+ chart.HasDataTable = True
+ 'Get the data table, read only
+ Dim dataTable As IOfficeChartDataTable = chart.DataTable
+ 'set borders for data table
+ dataTable.HasBorders = True
+ 'Set the show serie keys
+ dataTable.ShowSeriesKeys = True
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ //Open the presentation
+ IPresentation presentation = Presentation.Open("Sample.pptx");
+ //Get the first slide
+ ISlide slide = presentation.Slides[0];
+ //Get the chart in slide
+ IPresentationChart chart = slide.Shapes[0] as IPresentationChart;
+ //Modify the chart height
+ chart.Height = 500;
+ //Modify the chart width
+ chart.Width = 700;
+ //Change the title
+ chart.ChartTitle = "New title";
+ //Change the serie name of first chart serie
+ chart.Series[0].Name = "Modified serie name";
+ //Hiding the category labels
+ chart.CategoryLabelLevel = OfficeCategoriesLabelLevel.CategoriesLabelLevelNone;
+ //Show Data Table.
+ chart.HasDataTable = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open the presentation
+ Dim presentation As IPresentation = Presentation.Open("Sample.pptx")
+ 'Get the first slide
+ Dim slide As ISlide = presentation.Slides(0)
+ 'Get the chart in slide
+ Dim chart As IPresentationChart = TryCast(slide.Shapes(0), IPresentationChart)
+ 'Modify the chart height
+ chart.Height = 500
+ 'Modify the chart width
+ chart.Width = 700
+ 'Change the title
+ chart.ChartTitle = "New title"
+ 'Change the serie name of first chart serie
+ chart.Series(0).Name = "Modified serie name"
+ 'Hiding the category labels
+ chart.CategoryLabelLevel = OfficeCategoriesLabelLevel.CategoriesLabelLevelNone
+ 'Show Data Table.
+ chart.HasDataTable = True
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to slide
+ IPresentationChart chart = slide.Shapes.AddChart(100, 120, 500, 300);
+ //Sets the data range of chart
+ chart.DataRange = chart.ChartData[1, 2, 4, 3];
+ //Set data to the chart- RowIndex, columnIndex and data
+ chart.ChartData.SetValue(1, 2, "2012");
+ chart.ChartData.SetValue(2, 2, 330);
+ chart.ChartData.SetValue(3, 2, 490);
+ chart.ChartData.SetValue(4, 2, 700);
+ chart.ChartType = OfficeChartType.Area;
+ //Edge: Specifies that the width or Height will be interpreted as right or bottom of the chart element
+ //Factor: Specifies that the width or Height will be interpreted as the width or height of the chart element
+ chart.PlotArea.Layout.LeftMode = LayoutModes.auto;
+ chart.PlotArea.Layout.TopMode = LayoutModes.factor;
+ //Value in points should not be a negative value if LayoutMode is Edge
+ //It can be a negative value if the LayoutMode is Factor.
+ chart.ChartTitleArea.Layout.Left = 10;
+ chart.ChartTitleArea.Layout.Top = 100;
+ //Manually positioning chart plot area
+ chart.PlotArea.Layout.LayoutTarget = LayoutTargets.outer;
+ chart.PlotArea.Layout.LeftMode = LayoutModes.edge;
+ chart.PlotArea.Layout.TopMode = LayoutModes.edge;
+ //Manually positioning chart legend
+ chart.Legend.Layout.LeftMode = LayoutModes.factor;
+ chart.Legend.Layout.TopMode = LayoutModes.factor;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to slide
+ Dim chart As IPresentationChart = slide.Shapes.AddChart(100, 120, 500, 300)
+ 'Sets the data range of chart
+ chart.DataRange = chart.ChartData(1, 2, 4, 3)
+ 'Set data to the chart- RowIndex, columnIndex and data
+ chart.ChartData.SetValue(1, 2, "2012")
+ chart.ChartData.SetValue(2, 2, 330)
+ chart.ChartData.SetValue(3, 2, 490)
+ chart.ChartData.SetValue(4, 2, 700)
+ chart.ChartType = OfficeChartType.Area
+ 'Edge: Specifies that the width or Height will be interpreted as right or bottom of the chart element
+ 'Factor: Specifies that the width or Height will be interpreted as the width or height of the chart element
+ chart.PlotArea.Layout.LeftMode = LayoutModes.auto
+ chart.PlotArea.Layout.TopMode = LayoutModes.factor
+ 'Value in points should not be a negative value if LayoutMode is Edge
+ 'It can be a negative value if the LayoutMode is Factor.
+ chart.ChartTitleArea.Layout.Left = 10
+ chart.ChartTitleArea.Layout.Top = 100
+ 'Manually positioning chart plot area
+ chart.PlotArea.Layout.LayoutTarget = LayoutTargets.outer
+ chart.PlotArea.Layout.LeftMode = LayoutModes.edge
+ chart.PlotArea.Layout.TopMode = LayoutModes.edge
+ 'Manually positioning chart legend
+ chart.Legend.Layout.LeftMode = LayoutModes.factor
+ chart.Legend.Layout.TopMode = LayoutModes.factor
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Hide the legend
+ chart.HasLegend = false;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Hide the legend
+ chart.HasLegend = False
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Hide the chart title
+ chart.HasTitle = false;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Hide the chart title
+ chart.HasTitle = False
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ //Open the presentation
+ IPresentation presentation = Presentation.Open("Sample.pptx");
+ //Get the first slide
+ ISlide slide = presentation.Slides[0];
+ //Get the chart in slide
+ IPresentationChart chart = slide.Shapes[0] as IPresentationChart;
+ //Change the chart type to 3D
+ chart.ChartType = OfficeChartType.Bar_Clustered_3D;
+ //Set the rotation
+ chart.Rotation = 80;
+ //Set the shadow angle
+ chart.SideWall.Shadow.Angle = 60;
+ //Set the backwall border weight
+ chart.BackWall.Border.LineWeight = OfficeChartLineWeight.Narrow;
+ //Save the presentation
+ presentation.Save("output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open the presentation
+ Dim presentation As IPresentation = Presentation.Open("Sample.pptx")
+ 'Get the first slide
+ Dim slide As ISlide = presentation.Slides(0)
+ 'Get the chart in slide
+ Dim chart As IPresentationChart = TryCast(slide.Shapes(0), IPresentationChart)
+ 'Change the chart type to 3D
+ chart.ChartType = OfficeChartType.Bar_Clustered_3D
+ 'Set the rotation
+ chart.Rotation = 80
+ 'Set the shadow angle
+ chart.SideWall.Shadow.Angle = 60
+ 'Set the backwall border weight
+ chart.BackWall.Border.LineWeight = OfficeChartLineWeight.Narrow
+ 'Save the presentation
+ presentation.Save("output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //set the chart type
+ chart.ChartType = OfficeChartType.Column_3D;
+ //Set the elevation of chart
+ chart.Elevation = -50;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'set the chart type
+ chart.ChartType = OfficeChartType.Column_3D
+ 'Set the elevation of chart
+ chart.Elevation = -50
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //set the chart type
+ chart.ChartType = OfficeChartType.Column_3D;
+ //Set the perspective
+ chart.Perspective = 100;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'set the chart type
+ chart.ChartType = OfficeChartType.Column_3D
+ 'Set the perspective of chart
+ chart.Perspective = 100
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ ISlide slide = presentation.Slides[0];
+ //Get the chart from slide
+ IPresentationChart chart = slide.Shapes[0] as IPresentationChart;
+ //set the chart type
+ chart.ChartType = OfficeChartType.Column_3D;
+ //Set the height percent
+ chart.HeightPercent = 400;
+ //Set the Depth percent
+ chart.DepthPercent = 200;
+ //Set the gap depth of data series
+ chart.GapDepth = 400;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation As IPresentation = Presentation.Open("Template.pptx")
+ Dim slide As ISlide = presentation.Slides(0)
+ 'Get the chart from slide
+ Dim chart As IPresentationChart = TryCast(slide.Shapes(0), IPresentationChart)
+ 'set the chart type
+ chart.ChartType = OfficeChartType.Column_3D
+ 'Set the height percent
+ chart.HeightPercent = 400
+ 'Set the Depth percent
+ chart.DepthPercent = 200
+ 'Set the gap depth of data series
+ chart.GapDepth = 400
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ ISlide slide = presentation.Slides[0];
+ //Get the chart from slide
+ IPresentationChart chart = slide.Shapes[0] as IPresentationChart;
+ //set the chart type
+ chart.ChartType = OfficeChartType.Column_3D;
+ //Set the height percent
+ chart.HeightPercent = 400;
+ //Set the Depth percent
+ chart.DepthPercent = 200;
+ //Set the gap depth of data series
+ chart.GapDepth = 400;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation As IPresentation = Presentation.Open("Template.pptx")
+ Dim slide As ISlide = presentation.Slides(0)
+ 'Get the chart from slide
+ Dim chart As IPresentationChart = TryCast(slide.Shapes(0), IPresentationChart)
+ 'set the chart type
+ chart.ChartType = OfficeChartType.Column_3D
+ 'Set the height percent
+ chart.HeightPercent = 400
+ 'Set the Depth percent
+ chart.DepthPercent = 200
+ 'Set the gap depth of data series
+ chart.GapDepth = 400
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ ISlide slide = presentation.Slides[0];
+ //Get the chart from slide
+ IPresentationChart chart = slide.Shapes[0] as IPresentationChart;
+ //set the chart type
+ chart.ChartType = OfficeChartType.Column_3D;
+ //Set the height percent
+ chart.HeightPercent = 400;
+ //Set the Depth percent
+ chart.DepthPercent = 200;
+ //Set the gap depth of data series
+ chart.GapDepth = 400;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation As IPresentation = Presentation.Open("Template.pptx")
+ Dim slide As ISlide = presentation.Slides(0)
+ 'Get the chart from slide
+ Dim chart As IPresentationChart = TryCast(slide.Shapes(0), IPresentationChart)
+ 'set the chart type
+ chart.ChartType = OfficeChartType.Column_3D
+ 'Set the height percent
+ chart.HeightPercent = 400
+ 'Set the Depth percent
+ chart.DepthPercent = 200
+ 'Set the gap depth of data series
+ chart.GapDepth = 400
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the right angle axes
+ chart.RightAngleAxes = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the right angle axes
+ chart.RightAngleAxes = True
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Specify the chart title
+ chart.ChartTitle = "Sales Analysis";
+ //Specify the chart type
+ chart.ChartType = OfficeChartType.Column_Clustered;
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the data range of the category axis
+ chart.PrimaryCategoryAxis.CategoryLabels = chart.ChartData[2, 1, 4, 1];
+ //Set the right angle axes property of the chart
+ chart.RightAngleAxes = true;
+ //Set the auto scaling of chart
+ chart.AutoScaling = true;
+ //Save the presentation
+ presentation.Save("sample.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the right angle axes
+ chart.RightAngleAxes = True
+ 'Set the auto scaling of chart
+ chart.AutoScaling = True
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //set the chart type
+ chart.ChartType = OfficeChartType.Column_3D;
+ //Set the 2D gridlines for chart
+ chart.WallsAndGridlines2D = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'set the chart type
+ chart.ChartType = OfficeChartType.Column_3D
+ 'Set the 2D gridlines for chart
+ chart.WallsAndGridlines2D = True
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ ISlide slide = presentation.Slides[0];
+ //Get the chart from slide
+ IPresentationChart chart = slide.Shapes[0] as IPresentationChart;
+ //set the chart type
+ chart.ChartType = OfficeChartType.Column_3D;
+ //Set the way blank cells to be plotted
+ chart.DisplayBlanksAs = OfficeChartPlotEmpty.Interpolated;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation As IPresentation = Presentation.Open("Template.pptx")
+ Dim slide As ISlide = presentation.Slides(0)
+ 'Get the chart from slide
+ Dim chart As IPresentationChart = TryCast(slide.Shapes(0), IPresentationChart)
+ 'set the chart type
+ chart.ChartType = OfficeChartType.Column_3D
+ 'Set the way blank cells to be plotted
+ chart.DisplayBlanksAs = OfficeChartPlotEmpty.Interpolated
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ ISlide slide = presentation.Slides[0];
+ //Get the chart from slide
+ IPresentationChart chart = slide.Shapes[0] as IPresentationChart;
+ //set the chart type
+ chart.ChartType = OfficeChartType.Column_3D;
+ //Hide the plot visiblity of cells
+ chart.PlotVisibleOnly = false;
+ //Hide the chart size with sheet window
+ chart.SizeWithWindow = false;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation As IPresentation = Presentation.Open("Template.pptx")
+ Dim slide As ISlide = presentation.Slides(0)
+ 'Get the chart from slide
+ Dim chart As IPresentationChart = TryCast(slide.Shapes(0), IPresentationChart)
+ 'set the chart type
+ chart.ChartType = OfficeChartType.Column_3D
+ 'Hide the plot visiblity of cells
+ chart.PlotVisibleOnly = False
+ 'Hide the chart size with sheet window
+ chart.SizeWithWindow = False
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ ISlide slide = presentation.Slides[0];
+ //Get the chart from slide
+ IPresentationChart chart = slide.Shapes[0] as IPresentationChart;
+ //set the chart type
+ chart.ChartType = OfficeChartType.Column_3D;
+ //Hide the plot visiblity of cells
+ chart.PlotVisibleOnly = false;
+ //Hide the chart size with sheet window
+ chart.SizeWithWindow = false;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation As IPresentation = Presentation.Open("Template.pptx")
+ Dim slide As ISlide = presentation.Slides(0)
+ 'Get the chart from slide
+ Dim chart As IPresentationChart = TryCast(slide.Shapes(0), IPresentationChart)
+ 'set the chart type
+ chart.ChartType = OfficeChartType.Column_3D
+ 'Hide the plot visiblity of cells
+ chart.PlotVisibleOnly = False
+ 'Hide the chart size with sheet window
+ chart.SizeWithWindow = False
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //set the serie name level
+ chart.SeriesNameLevel = OfficeSeriesNameLevel.SeriesNameLevelNone;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'set the serie name level
+ chart.SeriesNameLevel = OfficeSeriesNameLevel.SeriesNameLevelNone
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Specify the chart title
+ chart.ChartTitle = "Sales Analysis";
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the data range of the category axis
+ chart.PrimaryCategoryAxis.CategoryLabels = chart.ChartData[2, 1, 4, 1];
+ //Specify the chart type
+ chart.ChartType = OfficeChartType.Surface_3D;
+ //Set the category label level
+ chart.CategoryLabelLevel = OfficeCategoriesLabelLevel.CategoriesLabelLevelAll;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 700, 500)
+ 'Specify the chart title
+ chart.ChartTitle = "Sales Analysis"
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the data range of the category axis
+ chart.PrimaryCategoryAxis.CategoryLabels = chart.ChartData(2, 1, 4, 1)
+ 'Specify the chart type
+ chart.ChartType = OfficeChartType.Surface_3D
+ 'Set the category label level
+ chart.CategoryLabelLevel = OfficeCategoriesLabelLevel.CategoriesLabelLevelAll
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //set the chart style
+ chart.Style = 14;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'set the chart style
+ chart.Style = 14
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Specify the chart title
+ chart.ChartTitle = "Sales Analysis";
+ //Specify the chart type
+ chart.ChartType = OfficeChartType.Column_Clustered;
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the data range of the category axis
+ chart.PrimaryCategoryAxis.CategoryLabels = chart.ChartData[2, 1, 4, 1];
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 700, 500)
+ 'Specify the chart title
+ chart.ChartTitle = "Sales Analysis"
+ 'Specify the chart type
+ chart.ChartType = OfficeChartType.Column_Clustered
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the data range of the category axis
+ chart.PrimaryCategoryAxis.CategoryLabels = chart.ChartData(2, 1, 4, 1)
+ 'Save the presentation
+ presentation.Save("Output.pptx")
+ 'Close the presentation
+ presentation.Close()
+
+
+ //Open a presentation
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ //Get the chart from the first slide
+ IPresentationChart chart = presentation.Slides[0].Charts[0] as IPresentationChart;
+ //Set the legend position
+ chart.Legend.Position = OfficeLegendPosition.Top;
+ //Get the legend layout
+ IOfficeChartLayout layout = chart.Legend.Layout;
+ //Get the manual layout
+ IOfficeChartManualLayout manualLayout = layout.ManualLayout;
+ //Modify the manual layout left position
+ manualLayout.Left = 100;
+ //Modify the manual layout left mode
+ manualLayout.LeftMode = LayoutModes.factor;
+ //Modify the manual layout top position
+ manualLayout.Top = 100;
+ //Modify the manual layout top mode
+ manualLayout.TopMode = LayoutModes.factor;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open a presentation
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ 'Get the chart from the first slide
+ Dim chart As IPresentationChart = TryCast(presentation__1.Slides(0).Charts(0), IPresentationChart)
+ 'Set the legend position
+ chart.Legend.Position = OfficeLegendPosition.Top
+ 'Get the legend layout
+ Dim layout As IOfficeChartLayout = chart.Legend.Layout
+ 'Get the manual layout
+ Dim manualLayout As IOfficeChartManualLayout = layout.ManualLayout
+ 'Modify the manual layout left position
+ manualLayout.Left = 100
+ 'Modify the manual layout left mode
+ manualLayout.LeftMode = LayoutModes.factor
+ 'Modify the manual layout top position
+ manualLayout.Top = 100
+ 'Modify the manual layout top mode
+ manualLayout.TopMode = LayoutModes.factor
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Open a presentation
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ //Get the chart from the first slide
+ IPresentationChart chart = presentation.Slides[0].Charts[0] as IPresentationChart;
+ //Set the legend position
+ chart.Legend.Position = OfficeLegendPosition.Top;
+ //Get the legend layout
+ IOfficeChartLayout layout = chart.Legend.Layout;
+ //Modify the legend layout height
+ layout.Height = 120;
+ //Modify the legend layout height mode
+ layout.HeightMode = LayoutModes.factor;
+ //Modify the legend layout width
+ layout.Width = 100;
+ //Modify the legend layout width mode
+ layout.WidthMode = LayoutModes.edge;
+ //Modify the legend layout left position
+ layout.Left = 100;
+ //Modify the legend layout left mode
+ layout.LeftMode = LayoutModes.factor;
+ //Modify the legend layout top position
+ layout.Top = 100;
+ //Modify the legend layout top mode
+ layout.TopMode = LayoutModes.factor;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open a presentation
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ 'Get the chart from the first slide
+ Dim chart As IPresentationChart = TryCast(presentation__1.Slides(0).Charts(0), IPresentationChart)
+ 'Set the legend position
+ chart.Legend.Position = OfficeLegendPosition.Top
+ 'Get the legend layout
+ Dim layout As IOfficeChartLayout = chart.Legend.Layout
+ 'Modify the legend layout height
+ layout.Height = 120
+ 'Modify the legend layout height mode
+ layout.HeightMode = LayoutModes.factor
+ 'Modify the legend layout width
+ layout.Width = 100
+ 'Modify the legend layout width mode
+ layout.WidthMode = LayoutModes.edge
+ 'Modify the legend layout left position
+ layout.Left = 100
+ 'Modify the legend layout left mode
+ layout.LeftMode = LayoutModes.factor
+ 'Modify the legend layout top position
+ layout.Top = 100
+ 'Modify the legend layout top mode
+ layout.TopMode = LayoutModes.factor
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Open a presentation
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ //Get the chart from the first slide
+ IPresentationChart chart = presentation.Slides[0].Charts[0] as IPresentationChart;
+ //Set the legend position
+ chart.Legend.Position = OfficeLegendPosition.Top;
+ //Get the legend layout
+ IOfficeChartLayout layout = chart.Legend.Layout;
+ //Modify the legend layout height
+ layout.Height = 120;
+ //Modify the legend layout height mode
+ layout.HeightMode = LayoutModes.factor;
+ //Modify the legend layout width
+ layout.Width = 100;
+ //Modify the legend layout width mode
+ layout.WidthMode = LayoutModes.edge;
+ //Modify the legend layout left position
+ layout.Left = 100;
+ //Modify the legend layout left mode
+ layout.LeftMode = LayoutModes.factor;
+ //Modify the legend layout top position
+ layout.Top = 100;
+ //Modify the legend layout top mode
+ layout.TopMode = LayoutModes.factor;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open a presentation
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ 'Get the chart from the first slide
+ Dim chart As IPresentationChart = TryCast(presentation__1.Slides(0).Charts(0), IPresentationChart)
+ 'Set the legend position
+ chart.Legend.Position = OfficeLegendPosition.Top
+ 'Get the legend layout
+ Dim layout As IOfficeChartLayout = chart.Legend.Layout
+ 'Modify the legend layout height
+ layout.Height = 120
+ 'Modify the legend layout height mode
+ layout.HeightMode = LayoutModes.factor
+ 'Modify the legend layout width
+ layout.Width = 100
+ 'Modify the legend layout width mode
+ layout.WidthMode = LayoutModes.edge
+ 'Modify the legend layout left position
+ layout.Left = 100
+ 'Modify the legend layout left mode
+ layout.LeftMode = LayoutModes.factor
+ 'Modify the legend layout top position
+ layout.Top = 100
+ 'Modify the legend layout top mode
+ layout.TopMode = LayoutModes.factor
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Open a presentation
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ //Get the chart from the first slide
+ IPresentationChart chart = presentation.Slides[0].Charts[0] as IPresentationChart;
+ //Set the legend position
+ chart.Legend.Position = OfficeLegendPosition.Top;
+ //Get the legend layout
+ IOfficeChartLayout layout = chart.Legend.Layout;
+ //Modify the legend layout height
+ layout.Height = 120;
+ //Modify the legend layout height mode
+ layout.HeightMode = LayoutModes.factor;
+ //Modify the legend layout width
+ layout.Width = 100;
+ //Modify the legend layout width mode
+ layout.WidthMode = LayoutModes.edge;
+ //Modify the legend layout left position
+ layout.Left = 100;
+ //Modify the legend layout left mode
+ layout.LeftMode = LayoutModes.factor;
+ //Modify the legend layout top position
+ layout.Top = 100;
+ //Modify the legend layout top mode
+ layout.TopMode = LayoutModes.factor;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open a presentation
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ 'Get the chart from the first slide
+ Dim chart As IPresentationChart = TryCast(presentation__1.Slides(0).Charts(0), IPresentationChart)
+ 'Set the legend position
+ chart.Legend.Position = OfficeLegendPosition.Top
+ 'Get the legend layout
+ Dim layout As IOfficeChartLayout = chart.Legend.Layout
+ 'Modify the legend layout height
+ layout.Height = 120
+ 'Modify the legend layout height mode
+ layout.HeightMode = LayoutModes.factor
+ 'Modify the legend layout width
+ layout.Width = 100
+ 'Modify the legend layout width mode
+ layout.WidthMode = LayoutModes.edge
+ 'Modify the legend layout left position
+ layout.Left = 100
+ 'Modify the legend layout left mode
+ layout.LeftMode = LayoutModes.factor
+ 'Modify the legend layout top position
+ layout.Top = 100
+ 'Modify the legend layout top mode
+ layout.TopMode = LayoutModes.factor
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Open a presentation
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ //Get the chart from the first slide
+ IPresentationChart chart = presentation.Slides[0].Charts[0] as IPresentationChart;
+ //Set the legend position
+ chart.Legend.Position = OfficeLegendPosition.Top;
+ //Get the legend layout
+ IOfficeChartLayout layout = chart.Legend.Layout;
+ //Modify the legend layout height
+ layout.Height = 120;
+ //Modify the legend layout height mode
+ layout.HeightMode = LayoutModes.factor;
+ //Modify the legend layout width
+ layout.Width = 100;
+ //Modify the legend layout width mode
+ layout.WidthMode = LayoutModes.edge;
+ //Modify the legend layout left position
+ layout.Left = 100;
+ //Modify the legend layout left mode
+ layout.LeftMode = LayoutModes.factor;
+ //Modify the legend layout top position
+ layout.Top = 100;
+ //Modify the legend layout top mode
+ layout.TopMode = LayoutModes.factor;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open a presentation
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ 'Get the chart from the first slide
+ Dim chart As IPresentationChart = TryCast(presentation__1.Slides(0).Charts(0), IPresentationChart)
+ 'Set the legend position
+ chart.Legend.Position = OfficeLegendPosition.Top
+ 'Get the legend layout
+ Dim layout As IOfficeChartLayout = chart.Legend.Layout
+ 'Modify the legend layout height
+ layout.Height = 120
+ 'Modify the legend layout height mode
+ layout.HeightMode = LayoutModes.factor
+ 'Modify the legend layout width
+ layout.Width = 100
+ 'Modify the legend layout width mode
+ layout.WidthMode = LayoutModes.edge
+ 'Modify the legend layout left position
+ layout.Left = 100
+ 'Modify the legend layout left mode
+ layout.LeftMode = LayoutModes.factor
+ 'Modify the legend layout top position
+ layout.Top = 100
+ 'Modify the legend layout top mode
+ layout.TopMode = LayoutModes.factor
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Open a presentation
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ //Get the chart from the first slide
+ IPresentationChart chart = presentation.Slides[0].Charts[0] as IPresentationChart;
+ //Set the legend position
+ chart.Legend.Position = OfficeLegendPosition.Top;
+ //Get the legend layout
+ IOfficeChartLayout layout = chart.Legend.Layout;
+ //Modify the legend layout height
+ layout.Height = 120;
+ //Modify the legend layout height mode
+ layout.HeightMode = LayoutModes.factor;
+ //Modify the legend layout width
+ layout.Width = 100;
+ //Modify the legend layout width mode
+ layout.WidthMode = LayoutModes.edge;
+ //Modify the legend layout left position
+ layout.Left = 100;
+ //Modify the legend layout left mode
+ layout.LeftMode = LayoutModes.factor;
+ //Modify the legend layout top position
+ layout.Top = 100;
+ //Modify the legend layout top mode
+ layout.TopMode = LayoutModes.factor;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open a presentation
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ 'Get the chart from the first slide
+ Dim chart As IPresentationChart = TryCast(presentation__1.Slides(0).Charts(0), IPresentationChart)
+ 'Set the legend position
+ chart.Legend.Position = OfficeLegendPosition.Top
+ 'Get the legend layout
+ Dim layout As IOfficeChartLayout = chart.Legend.Layout
+ 'Modify the legend layout height
+ layout.Height = 120
+ 'Modify the legend layout height mode
+ layout.HeightMode = LayoutModes.factor
+ 'Modify the legend layout width
+ layout.Width = 100
+ 'Modify the legend layout width mode
+ layout.WidthMode = LayoutModes.edge
+ 'Modify the legend layout left position
+ layout.Left = 100
+ 'Modify the legend layout left mode
+ layout.LeftMode = LayoutModes.factor
+ 'Modify the legend layout top position
+ layout.Top = 100
+ 'Modify the legend layout top mode
+ layout.TopMode = LayoutModes.factor
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Open a presentation
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ //Get the chart from the first slide
+ IPresentationChart chart = presentation.Slides[0].Charts[0] as IPresentationChart;
+ //Set the legend position
+ chart.Legend.Position = OfficeLegendPosition.Top;
+ //Get the legend layout
+ IOfficeChartLayout layout = chart.Legend.Layout;
+ //Modify the legend layout height
+ layout.Height = 120;
+ //Modify the legend layout height mode
+ layout.HeightMode = LayoutModes.factor;
+ //Modify the legend layout width
+ layout.Width = 100;
+ //Modify the legend layout width mode
+ layout.WidthMode = LayoutModes.edge;
+ //Modify the legend layout left position
+ layout.Left = 100;
+ //Modify the legend layout left mode
+ layout.LeftMode = LayoutModes.factor;
+ //Modify the legend layout top position
+ layout.Top = 100;
+ //Modify the legend layout top mode
+ layout.TopMode = LayoutModes.factor;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open a presentation
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ 'Get the chart from the first slide
+ Dim chart As IPresentationChart = TryCast(presentation__1.Slides(0).Charts(0), IPresentationChart)
+ 'Set the legend position
+ chart.Legend.Position = OfficeLegendPosition.Top
+ 'Get the legend layout
+ Dim layout As IOfficeChartLayout = chart.Legend.Layout
+ 'Modify the legend layout height
+ layout.Height = 120
+ 'Modify the legend layout height mode
+ layout.HeightMode = LayoutModes.factor
+ 'Modify the legend layout width
+ layout.Width = 100
+ 'Modify the legend layout width mode
+ layout.WidthMode = LayoutModes.edge
+ 'Modify the legend layout left position
+ layout.Left = 100
+ 'Modify the legend layout left mode
+ layout.LeftMode = LayoutModes.factor
+ 'Modify the legend layout top position
+ layout.Top = 100
+ 'Modify the legend layout top mode
+ layout.TopMode = LayoutModes.factor
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Open a presentation
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ //Get the chart from the first slide
+ IPresentationChart chart = presentation.Slides[0].Charts[0] as IPresentationChart;
+ //Set the legend position
+ chart.Legend.Position = OfficeLegendPosition.Top;
+ //Get the legend layout
+ IOfficeChartLayout layout = chart.Legend.Layout;
+ //Modify the legend layout height
+ layout.Height = 120;
+ //Modify the legend layout height mode
+ layout.HeightMode = LayoutModes.factor;
+ //Modify the legend layout width
+ layout.Width = 100;
+ //Modify the legend layout width mode
+ layout.WidthMode = LayoutModes.edge;
+ //Modify the legend layout left position
+ layout.Left = 100;
+ //Modify the legend layout left mode
+ layout.LeftMode = LayoutModes.factor;
+ //Modify the legend layout top position
+ layout.Top = 100;
+ //Modify the legend layout top mode
+ layout.TopMode = LayoutModes.factor;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open a presentation
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ 'Get the chart from the first slide
+ Dim chart As IPresentationChart = TryCast(presentation__1.Slides(0).Charts(0), IPresentationChart)
+ 'Set the legend position
+ chart.Legend.Position = OfficeLegendPosition.Top
+ 'Get the legend layout
+ Dim layout As IOfficeChartLayout = chart.Legend.Layout
+ 'Modify the legend layout height
+ layout.Height = 120
+ 'Modify the legend layout height mode
+ layout.HeightMode = LayoutModes.factor
+ 'Modify the legend layout width
+ layout.Width = 100
+ 'Modify the legend layout width mode
+ layout.WidthMode = LayoutModes.edge
+ 'Modify the legend layout left position
+ layout.Left = 100
+ 'Modify the legend layout left mode
+ layout.LeftMode = LayoutModes.factor
+ 'Modify the legend layout top position
+ layout.Top = 100
+ 'Modify the legend layout top mode
+ layout.TopMode = LayoutModes.factor
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Open a presentation
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ //Get the chart from the first slide
+ IPresentationChart chart = presentation.Slides[0].Charts[0] as IPresentationChart;
+ //Set the legend position
+ chart.Legend.Position = OfficeLegendPosition.Top;
+ //Get the legend layout
+ IOfficeChartLayout layout = chart.Legend.Layout;
+ //Modify the legend layout height
+ layout.Height = 120;
+ //Modify the legend layout height mode
+ layout.HeightMode = LayoutModes.factor;
+ //Modify the legend layout width
+ layout.Width = 100;
+ //Modify the legend layout width mode
+ layout.WidthMode = LayoutModes.edge;
+ //Modify the legend layout left position
+ layout.Left = 100;
+ //Modify the legend layout left mode
+ layout.LeftMode = LayoutModes.factor;
+ //Modify the legend layout top position
+ layout.Top = 100;
+ //Modify the legend layout top mode
+ layout.TopMode = LayoutModes.factor;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open a presentation
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ 'Get the chart from the first slide
+ Dim chart As IPresentationChart = TryCast(presentation__1.Slides(0).Charts(0), IPresentationChart)
+ 'Set the legend position
+ chart.Legend.Position = OfficeLegendPosition.Top
+ 'Get the legend layout
+ Dim layout As IOfficeChartLayout = chart.Legend.Layout
+ 'Modify the legend layout height
+ layout.Height = 120
+ 'Modify the legend layout height mode
+ layout.HeightMode = LayoutModes.factor
+ 'Modify the legend layout width
+ layout.Width = 100
+ 'Modify the legend layout width mode
+ layout.WidthMode = LayoutModes.edge
+ 'Modify the legend layout left position
+ layout.Left = 100
+ 'Modify the legend layout left mode
+ layout.LeftMode = LayoutModes.factor
+ 'Modify the legend layout top position
+ layout.Top = 100
+ 'Modify the legend layout top mode
+ layout.TopMode = LayoutModes.factor
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the legend entries
+ IChartLegendEntries legendEntries = chart.Legend.LegendEntries;
+ //Get the count of the legend entries
+ int count = legendEntries.Count;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the legend entries
+ Dim legendEntries As IChartLegendEntries = chart.Legend.LegendEntries
+ 'Get the count of the legend entries
+ Dim count As Integer = legendEntries.Count
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the legend entries
+ IChartLegendEntries legendEntries = chart.Legend.LegendEntries;
+ //Get the count of the legend entries
+ int count = legendEntries.Count;
+ //Set the bold style for text area
+ legendEntries[0].TextArea.Bold = true;
+ //Set the color of the text area
+ legendEntries[0].TextArea.Color = OfficeKnownColors.Magenta;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the legend entries
+ Dim legendEntries As IChartLegendEntries = chart.Legend.LegendEntries
+ 'Get the count of the legend entries
+ Dim count As Integer = legendEntries.Count
+ 'Set the bold style for text area
+ legendEntries(0).TextArea.Bold = True
+ 'Set the color of the text area
+ legendEntries(0).TextArea.Color = OfficeKnownColors.Magenta
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the chart legend
+ IOfficeChartLegend legend = chart.Legend;
+ //Set the legend border format
+ legend.FrameFormat.Border.AutoFormat = false;
+ //Set the legend border auto line color
+ legend.FrameFormat.Border.IsAutoLineColor = false;
+ //Set the border line color
+ legend.FrameFormat.Border.LineColor = Color.Blue;
+ //Set the border line pattern
+ legend.FrameFormat.Border.LinePattern = OfficeChartLinePattern.DashDot;
+ //Set the legend border line weight
+ legend.FrameFormat.Border.LineWeight = OfficeChartLineWeight.Wide;
+ //Reset the legend format
+ legend.Clear();
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the chart legend
+ Dim legend As IOfficeChartLegend = chart.Legend
+ 'Set the legend border format
+ legend.FrameFormat.Border.AutoFormat = False
+ 'Set the legend border auto line color
+ legend.FrameFormat.Border.IsAutoLineColor = False
+ 'Set the border line color
+ legend.FrameFormat.Border.LineColor = Color.Blue
+ 'Set the border line pattern
+ legend.FrameFormat.Border.LinePattern = OfficeChartLinePattern.DashDot
+ 'Set the legend border line weight
+ legend.FrameFormat.Border.LineWeight = OfficeChartLineWeight.Wide
+ 'Reset the legend format
+ legend.Clear()
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the chart legend
+ IOfficeChartLegend legend = chart.Legend;
+ //Delete the chart's legend
+ legend.Delete();
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the chart legend
+ Dim legend As IOfficeChartLegend = chart.Legend
+ 'Delete the chart's legend
+ legend.Delete()
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Open a presentation
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ //Get the chart from the first slide
+ IPresentationChart chart = presentation.Slides[0].Charts[0] as IPresentationChart;
+ //Get the chart legend
+ IOfficeChartLegend legend = chart.Legend;
+ //Set the legend border format
+ legend.FrameFormat.Border.AutoFormat = false;
+ //Set the legend border auto line color
+ legend.FrameFormat.Border.IsAutoLineColor = false;
+ //Set the border line color
+ legend.FrameFormat.Border.LineColor = System.Drawing.Color.Blue;
+ //Set the border line pattern
+ legend.FrameFormat.Border.LinePattern = OfficeChartLinePattern.DashDot;
+ //Set the legend border line weight
+ legend.FrameFormat.Border.LineWeight = OfficeChartLineWeight.Wide;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open a presentation
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ 'Get the chart from the first slide
+ Dim chart As IPresentationChart = TryCast(presentation__1.Slides(0).Charts(0), IPresentationChart)
+ 'Get the chart legend
+ Dim legend As IOfficeChartLegend = chart.Legend
+ 'Set the legend border format
+ legend.FrameFormat.Border.AutoFormat = False
+ 'Set the legend border auto line color
+ legend.FrameFormat.Border.IsAutoLineColor = False
+ 'Set the border line color
+ legend.FrameFormat.Border.LineColor = System.Drawing.Color.Blue
+ 'Set the border line pattern
+ legend.FrameFormat.Border.LinePattern = OfficeChartLinePattern.DashDot
+ 'Set the legend border line weight
+ legend.FrameFormat.Border.LineWeight = OfficeChartLineWeight.Wide
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Open a presentation
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ //Get the chart from the first slide
+ IPresentationChart chart = presentation.Slides[0].Charts[0] as IPresentationChart;
+ //Get the chart legend
+ IOfficeChartLegend legend = chart.Legend;
+ //Set the text area font weight
+ legend.TextArea.Bold = true;
+ //Set the legend text area forecolor
+ legend.TextArea.Color = OfficeKnownColors.Sky_blue;
+ //Set the legend text area font name
+ legend.TextArea.FontName = "Times New Roman";
+ //Set the legend text area font size
+ legend.TextArea.Size = 15;
+ //Set the legend text area' strike through
+ legend.TextArea.Strikethrough = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open a presentation
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ 'Get the chart from the first slide
+ Dim chart As IPresentationChart = TryCast(presentation__1.Slides(0).Charts(0), IPresentationChart)
+ 'Get the chart legend
+ Dim legend As IOfficeChartLegend = chart.Legend
+ 'Set the text area font weight
+ legend.TextArea.Bold = True
+ 'Set the legend text area forecolor
+ legend.TextArea.Color = OfficeKnownColors.Sky_blue
+ 'Set the legend text area font name
+ legend.TextArea.FontName = "Times New Roman"
+ 'Set the legend text area font size
+ legend.TextArea.Size = 15
+ 'Set the legend text area' strike through
+ legend.TextArea.Strikethrough = True
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Open a presentation
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ //Get the chart from the first slide
+ IPresentationChart chart = presentation.Slides[0].Charts[0] as IPresentationChart;
+ //Get the chart legend
+ IOfficeChartLegend legend = chart.Legend;
+ //Set the legend position
+ legend.Position = OfficeLegendPosition.Top;
+ //Set the position of legend
+ legend.X = 120;
+ legend.Y = 25;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open a presentation
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ 'Get the chart from the first slide
+ Dim chart As IPresentationChart = TryCast(presentation__1.Slides(0).Charts(0), IPresentationChart)
+ 'Get the chart legend
+ Dim legend As IOfficeChartLegend = chart.Legend
+ 'Set the legend position
+ legend.Position = OfficeLegendPosition.Top
+ 'Set the position of legend
+ legend.X = 120
+ legend.Y = 25
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Open a presentation
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ //Get the chart from the first slide
+ IPresentationChart chart = presentation.Slides[0].Charts[0] as IPresentationChart;
+ //Get the chart legend
+ IOfficeChartLegend legend = chart.Legend;
+ //Set the legend position
+ legend.Position = OfficeLegendPosition.Top;
+ //Set the position of legend
+ legend.X = 120;
+ legend.Y = 25;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open a presentation
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ 'Get the chart from the first slide
+ Dim chart As IPresentationChart = TryCast(presentation__1.Slides(0).Charts(0), IPresentationChart)
+ 'Get the chart legend
+ Dim legend As IOfficeChartLegend = chart.Legend
+ 'Set the legend position
+ legend.Position = OfficeLegendPosition.Top
+ 'Set the position of legend
+ legend.X = 120
+ legend.Y = 25
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Open a presentation
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ //Get the chart from the first slide
+ IPresentationChart chart = presentation.Slides[0].Charts[0] as IPresentationChart;
+ //Get the chart legend
+ IOfficeChartLegend legend = chart.Legend;
+ //Set the legend position
+ legend.Position = OfficeLegendPosition.Left;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open a presentation
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ 'Get the chart from the first slide
+ Dim chart As IPresentationChart = TryCast(presentation__1.Slides(0).Charts(0), IPresentationChart)
+ 'Get the chart legend
+ Dim legend As IOfficeChartLegend = chart.Legend
+ 'Set the legend position
+ legend.Position = OfficeLegendPosition.Left
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Open a presentation
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ //Get the chart from the first slide
+ IPresentationChart chart = presentation.Slides[0].Charts[0] as IPresentationChart;
+ //Get the chart legend
+ IOfficeChartLegend legend = chart.Legend;
+ //Set the legend position
+ legend.Position = OfficeLegendPosition.Left;
+ //Enable the vertical legend
+ legend.IsVerticalLegend = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open a presentation
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ 'Get the chart from the first slide
+ Dim chart As IPresentationChart = TryCast(presentation__1.Slides(0).Charts(0), IPresentationChart)
+ 'Get the chart legend
+ Dim legend As IOfficeChartLegend = chart.Legend
+ 'Set the legend position
+ legend.Position = OfficeLegendPosition.Left
+ 'Enable the vertical legend
+ legend.IsVerticalLegend = True
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Open a presentation
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ //Get the chart from the first slide
+ IPresentationChart chart = presentation.Slides[0].Charts[0] as IPresentationChart;
+ //Get the chart legend
+ IOfficeChartLegend legend = chart.Legend;
+ //Set the text area font weight
+ legend.TextArea.Bold = true;
+ //Set the legend text area forecolor
+ legend.TextArea.Color = OfficeKnownColors.Sky_blue;
+ //Set the legend text area font name
+ legend.TextArea.FontName = "Times New Roman";
+ //Set the legend text area font size
+ legend.TextArea.Size = 15;
+ //Modify the legend entry
+ legend.LegendEntries[0].IsDeleted = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open a presentation
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ 'Get the chart from the first slide
+ Dim chart As IPresentationChart = TryCast(presentation__1.Slides(0).Charts(0), IPresentationChart)
+ 'Get the chart legend
+ Dim legend As IOfficeChartLegend = chart.Legend
+ 'Set the text area font weight
+ legend.TextArea.Bold = True
+ 'Set the legend text area forecolor
+ legend.TextArea.Color = OfficeKnownColors.Sky_blue
+ 'Set the legend text area font name
+ legend.TextArea.FontName = "Times New Roman"
+ 'Set the legend text area font size
+ legend.TextArea.Size = 15
+ 'Modify the legend entry
+ legend.LegendEntries(0).IsDeleted = True
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Open a presentation
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ //Get the chart from the first slide
+ IPresentationChart chart = presentation.Slides[0].Charts[0] as IPresentationChart;
+ //Get the chart legend
+ IOfficeChartLegend legend = chart.Legend;
+ //Set the layout inclusion
+ legend.IncludeInLayout = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open a presentation
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ 'Get the chart from the first slide
+ Dim chart As IPresentationChart = TryCast(presentation__1.Slides(0).Charts(0), IPresentationChart)
+ 'Get the chart legend
+ Dim legend As IOfficeChartLegend = chart.Legend
+ 'Set the layout inclusion
+ legend.IncludeInLayout = True
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Open a presentation
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ //Get the chart from the first slide
+ IPresentationChart chart = presentation.Slides[0].Charts[0] as IPresentationChart;
+ //Get the chart legend
+ IOfficeChartLegend legend = chart.Legend;
+ //Modify the legend layout height
+ legend.Layout.Height = 100;
+ //Modify the legend layout height mode
+ legend.Layout.HeightMode = LayoutModes.factor;
+ //Modify the legend layout left position
+ legend.Layout.Left = 100;
+ //Modify the legend layout left mode
+ legend.Layout.LeftMode = LayoutModes.factor;
+ //Modify the legend layout top position
+ legend.Layout.Top = 100;
+ //Modify the legend layout top mode
+ legend.Layout.TopMode = LayoutModes.factor;
+ //Modify the legend layout width
+ legend.Layout.Width = 150;
+ //Modify the legend layout width mode
+ legend.Layout.WidthMode = LayoutModes.factor;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open a presentation
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ 'Get the chart from the first slide
+ Dim chart As IPresentationChart = TryCast(presentation__1.Slides(0).Charts(0), IPresentationChart)
+ 'Get the chart legend
+ Dim legend As IOfficeChartLegend = chart.Legend
+ 'Modify the legend layout height
+ legend.Layout.Height = 100
+ 'Modify the legend layout height mode
+ legend.Layout.HeightMode = LayoutModes.factor
+ 'Modify the legend layout left position
+ legend.Layout.Left = 100
+ 'Modify the legend layout left mode
+ legend.Layout.LeftMode = LayoutModes.factor
+ 'Modify the legend layout top position
+ legend.Layout.Top = 100
+ 'Modify the legend layout top mode
+ legend.Layout.TopMode = LayoutModes.factor
+ 'Modify the legend layout width
+ legend.Layout.Width = 150
+ 'Modify the legend layout width mode
+ legend.Layout.WidthMode = LayoutModes.factor
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Open a presentation
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ //Get the chart from the first slide
+ IOfficeChart chart = presentation.Slides[0].Charts[0] as IOfficeChart;
+ //Set the legend position
+ chart.Legend.Position = OfficeLegendPosition.Top;
+ //Get the legend layout
+ IOfficeChartLayout layout = chart.Legend.Layout;
+ //Get the manual layout
+ IOfficeChartManualLayout manualLayout = layout.ManualLayout;
+ //Modify the manual layout left position
+ manualLayout.Left = 100;
+ //Modify the manual layout left mode
+ manualLayout.LeftMode = LayoutModes.factor;
+ //Modify the manual layout top position
+ manualLayout.Top = 100;
+ //Modify the manual layout top mode
+ manualLayout.TopMode = LayoutModes.factor;
+ //Modify the manual layout height
+ manualLayout.Height = 120;
+ //Modify the manual layout height mode
+ manualLayout.HeightMode = LayoutModes.factor;
+ //Modify the manual layout width
+ manualLayout.Width = 100;
+ //Modify the manual layout width mode
+ manualLayout.WidthMode = LayoutModes.edge;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open a presentation
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ 'Get the chart from the first slide
+ Dim chart As IOfficeChart = TryCast(presentation__1.Slides(0).Charts(0), IOfficeChart)
+ 'Set the legend position
+ chart.Legend.Position = OfficeLegendPosition.Top
+ 'Get the legend layout
+ Dim layout As IOfficeChartLayout = chart.Legend.Layout
+ 'Get the manual layout
+ Dim manualLayout As IOfficeChartManualLayout = layout.ManualLayout
+ 'Modify the manual layout left position
+ manualLayout.Left = 100
+ 'Modify the manual layout left mode
+ manualLayout.LeftMode = LayoutModes.factor
+ 'Modify the manual layout top position
+ manualLayout.Top = 100
+ 'Modify the manual layout top mode
+ manualLayout.TopMode = LayoutModes.factor
+ 'Modify the manual layout height
+ manualLayout.Height = 120
+ 'Modify the manual layout height mode
+ manualLayout.HeightMode = LayoutModes.factor
+ 'Modify the manual layout width
+ manualLayout.Width = 100
+ 'Modify the manual layout width mode
+ manualLayout.WidthMode = LayoutModes.edge
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Open a presentation
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ //Get the chart from the first slide
+ IOfficeChart chart = presentation.Slides[0].Charts[0] as IOfficeChart;
+ //Set the legend position
+ chart.Legend.Position = OfficeLegendPosition.Top;
+ //Get the legend layout
+ IOfficeChartLayout layout = chart.Legend.Layout;
+ //Get the manual layout
+ IOfficeChartManualLayout manualLayout = layout.ManualLayout;
+ //Modify the manual layout left position
+ manualLayout.Left = 100;
+ //Modify the manual layout left mode
+ manualLayout.LeftMode = LayoutModes.factor;
+ //Modify the manual layout top position
+ manualLayout.Top = 100;
+ //Modify the manual layout top mode
+ manualLayout.TopMode = LayoutModes.factor;
+ //Modify the manual layout height
+ manualLayout.Height = 120;
+ //Modify the manual layout height mode
+ manualLayout.HeightMode = LayoutModes.factor;
+ //Modify the manual layout width
+ manualLayout.Width = 100;
+ //Modify the manual layout width mode
+ manualLayout.WidthMode = LayoutModes.edge;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open a presentation
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ 'Get the chart from the first slide
+ Dim chart As IOfficeChart = TryCast(presentation__1.Slides(0).Charts(0), IOfficeChart)
+ 'Set the legend position
+ chart.Legend.Position = OfficeLegendPosition.Top
+ 'Get the legend layout
+ Dim layout As IOfficeChartLayout = chart.Legend.Layout
+ 'Get the manual layout
+ Dim manualLayout As IOfficeChartManualLayout = layout.ManualLayout
+ 'Modify the manual layout left position
+ manualLayout.Left = 100
+ 'Modify the manual layout left mode
+ manualLayout.LeftMode = LayoutModes.factor
+ 'Modify the manual layout top position
+ manualLayout.Top = 100
+ 'Modify the manual layout top mode
+ manualLayout.TopMode = LayoutModes.factor
+ 'Modify the manual layout height
+ manualLayout.Height = 120
+ 'Modify the manual layout height mode
+ manualLayout.HeightMode = LayoutModes.factor
+ 'Modify the manual layout width
+ manualLayout.Width = 100
+ 'Modify the manual layout width mode
+ manualLayout.WidthMode = LayoutModes.edge
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Open a presentation
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ //Get the chart from the first slide
+ IOfficeChart chart = presentation.Slides[0].Charts[0] as IOfficeChart;
+ //Set the legend position
+ chart.Legend.Position = OfficeLegendPosition.Top;
+ //Get the legend layout
+ IOfficeChartLayout layout = chart.Legend.Layout;
+ //Get the manual layout
+ IOfficeChartManualLayout manualLayout = layout.ManualLayout;
+ //Modify the manual layout left position
+ manualLayout.Left = 100;
+ //Modify the manual layout left mode
+ manualLayout.LeftMode = LayoutModes.factor;
+ //Modify the manual layout top position
+ manualLayout.Top = 100;
+ //Modify the manual layout top mode
+ manualLayout.TopMode = LayoutModes.factor;
+ //Modify the manual layout height
+ manualLayout.Height = 120;
+ //Modify the manual layout height mode
+ manualLayout.HeightMode = LayoutModes.factor;
+ //Modify the manual layout width
+ manualLayout.Width = 100;
+ //Modify the manual layout width mode
+ manualLayout.WidthMode = LayoutModes.edge;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open a presentation
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ 'Get the chart from the first slide
+ Dim chart As IOfficeChart = TryCast(presentation__1.Slides(0).Charts(0), IOfficeChart)
+ 'Set the legend position
+ chart.Legend.Position = OfficeLegendPosition.Top
+ 'Get the legend layout
+ Dim layout As IOfficeChartLayout = chart.Legend.Layout
+ 'Get the manual layout
+ Dim manualLayout As IOfficeChartManualLayout = layout.ManualLayout
+ 'Modify the manual layout left position
+ manualLayout.Left = 100
+ 'Modify the manual layout left mode
+ manualLayout.LeftMode = LayoutModes.factor
+ 'Modify the manual layout top position
+ manualLayout.Top = 100
+ 'Modify the manual layout top mode
+ manualLayout.TopMode = LayoutModes.factor
+ 'Modify the manual layout height
+ manualLayout.Height = 120
+ 'Modify the manual layout height mode
+ manualLayout.HeightMode = LayoutModes.factor
+ 'Modify the manual layout width
+ manualLayout.Width = 100
+ 'Modify the manual layout width mode
+ manualLayout.WidthMode = LayoutModes.edge
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Open a presentation
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ //Get the chart from the first slide
+ IOfficeChart chart = presentation.Slides[0].Charts[0] as IOfficeChart;
+ //Set the legend position
+ chart.Legend.Position = OfficeLegendPosition.Top;
+ //Get the legend layout
+ IOfficeChartLayout layout = chart.Legend.Layout;
+ //Get the manual layout
+ IOfficeChartManualLayout manualLayout = layout.ManualLayout;
+ //Modify the manual layout left position
+ manualLayout.Left = 100;
+ //Modify the manual layout left mode
+ manualLayout.LeftMode = LayoutModes.factor;
+ //Modify the manual layout top position
+ manualLayout.Top = 100;
+ //Modify the manual layout top mode
+ manualLayout.TopMode = LayoutModes.factor;
+ //Modify the manual layout height
+ manualLayout.Height = 120;
+ //Modify the manual layout height mode
+ manualLayout.HeightMode = LayoutModes.factor;
+ //Modify the manual layout width
+ manualLayout.Width = 100;
+ //Modify the manual layout width mode
+ manualLayout.WidthMode = LayoutModes.edge;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open a presentation
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ 'Get the chart from the first slide
+ Dim chart As IOfficeChart = TryCast(presentation__1.Slides(0).Charts(0), IOfficeChart)
+ 'Set the legend position
+ chart.Legend.Position = OfficeLegendPosition.Top
+ 'Get the legend layout
+ Dim layout As IOfficeChartLayout = chart.Legend.Layout
+ 'Get the manual layout
+ Dim manualLayout As IOfficeChartManualLayout = layout.ManualLayout
+ 'Modify the manual layout left position
+ manualLayout.Left = 100
+ 'Modify the manual layout left mode
+ manualLayout.LeftMode = LayoutModes.factor
+ 'Modify the manual layout top position
+ manualLayout.Top = 100
+ 'Modify the manual layout top mode
+ manualLayout.TopMode = LayoutModes.factor
+ 'Modify the manual layout height
+ manualLayout.Height = 120
+ 'Modify the manual layout height mode
+ manualLayout.HeightMode = LayoutModes.factor
+ 'Modify the manual layout width
+ manualLayout.Width = 100
+ 'Modify the manual layout width mode
+ manualLayout.WidthMode = LayoutModes.edge
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Open a presentation
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ //Get the chart from the first slide
+ IOfficeChart chart = presentation.Slides[0].Charts[0] as IOfficeChart;
+ //Set the legend position
+ chart.Legend.Position = OfficeLegendPosition.Top;
+ //Get the legend layout
+ IOfficeChartLayout layout = chart.Legend.Layout;
+ //Get the manual layout
+ IOfficeChartManualLayout manualLayout = layout.ManualLayout;
+ //Modify the manual layout left position
+ manualLayout.Left = 100;
+ //Modify the manual layout left mode
+ manualLayout.LeftMode = LayoutModes.factor;
+ //Modify the manual layout top position
+ manualLayout.Top = 100;
+ //Modify the manual layout top mode
+ manualLayout.TopMode = LayoutModes.factor;
+ //Modify the manual layout height
+ manualLayout.Height = 120;
+ //Modify the manual layout height mode
+ manualLayout.HeightMode = LayoutModes.factor;
+ //Modify the manual layout width
+ manualLayout.Width = 100;
+ //Modify the manual layout width mode
+ manualLayout.WidthMode = LayoutModes.edge;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open a presentation
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ 'Get the chart from the first slide
+ Dim chart As IOfficeChart = TryCast(presentation__1.Slides(0).Charts(0), IOfficeChart)
+ 'Set the legend position
+ chart.Legend.Position = OfficeLegendPosition.Top
+ 'Get the legend layout
+ Dim layout As IOfficeChartLayout = chart.Legend.Layout
+ 'Get the manual layout
+ Dim manualLayout As IOfficeChartManualLayout = layout.ManualLayout
+ 'Modify the manual layout left position
+ manualLayout.Left = 100
+ 'Modify the manual layout left mode
+ manualLayout.LeftMode = LayoutModes.factor
+ 'Modify the manual layout top position
+ manualLayout.Top = 100
+ 'Modify the manual layout top mode
+ manualLayout.TopMode = LayoutModes.factor
+ 'Modify the manual layout height
+ manualLayout.Height = 120
+ 'Modify the manual layout height mode
+ manualLayout.HeightMode = LayoutModes.factor
+ 'Modify the manual layout width
+ manualLayout.Width = 100
+ 'Modify the manual layout width mode
+ manualLayout.WidthMode = LayoutModes.edge
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Open a presentation
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ //Get the chart from the first slide
+ IOfficeChart chart = presentation.Slides[0].Charts[0] as IOfficeChart;
+ //Set the legend position
+ chart.Legend.Position = OfficeLegendPosition.Top;
+ //Get the legend layout
+ IOfficeChartLayout layout = chart.Legend.Layout;
+ //Get the manual layout
+ IOfficeChartManualLayout manualLayout = layout.ManualLayout;
+ //Modify the manual layout left position
+ manualLayout.Left = 100;
+ //Modify the manual layout left mode
+ manualLayout.LeftMode = LayoutModes.factor;
+ //Modify the manual layout top position
+ manualLayout.Top = 100;
+ //Modify the manual layout top mode
+ manualLayout.TopMode = LayoutModes.factor;
+ //Modify the manual layout height
+ manualLayout.Height = 120;
+ //Modify the manual layout height mode
+ manualLayout.HeightMode = LayoutModes.factor;
+ //Modify the manual layout width
+ manualLayout.Width = 100;
+ //Modify the manual layout width mode
+ manualLayout.WidthMode = LayoutModes.edge;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open a presentation
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ 'Get the chart from the first slide
+ Dim chart As IOfficeChart = TryCast(presentation__1.Slides(0).Charts(0), IOfficeChart)
+ 'Set the legend position
+ chart.Legend.Position = OfficeLegendPosition.Top
+ 'Get the legend layout
+ Dim layout As IOfficeChartLayout = chart.Legend.Layout
+ 'Get the manual layout
+ Dim manualLayout As IOfficeChartManualLayout = layout.ManualLayout
+ 'Modify the manual layout left position
+ manualLayout.Left = 100
+ 'Modify the manual layout left mode
+ manualLayout.LeftMode = LayoutModes.factor
+ 'Modify the manual layout top position
+ manualLayout.Top = 100
+ 'Modify the manual layout top mode
+ manualLayout.TopMode = LayoutModes.factor
+ 'Modify the manual layout height
+ manualLayout.Height = 120
+ 'Modify the manual layout height mode
+ manualLayout.HeightMode = LayoutModes.factor
+ 'Modify the manual layout width
+ manualLayout.Width = 100
+ 'Modify the manual layout width mode
+ manualLayout.WidthMode = LayoutModes.edge
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Open a presentation
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ //Get the chart from the first slide
+ IOfficeChart chart = presentation.Slides[0].Charts[0] as IOfficeChart;
+ //Set the legend position
+ chart.Legend.Position = OfficeLegendPosition.Top;
+ //Get the legend layout
+ IOfficeChartLayout layout = chart.Legend.Layout;
+ //Get the manual layout
+ IOfficeChartManualLayout manualLayout = layout.ManualLayout;
+ //Modify the manual layout left position
+ manualLayout.Left = 100;
+ //Modify the manual layout left mode
+ manualLayout.LeftMode = LayoutModes.factor;
+ //Modify the manual layout top position
+ manualLayout.Top = 100;
+ //Modify the manual layout top mode
+ manualLayout.TopMode = LayoutModes.factor;
+ //Modify the manual layout height
+ manualLayout.Height = 120;
+ //Modify the manual layout height mode
+ manualLayout.HeightMode = LayoutModes.factor;
+ //Modify the manual layout width
+ manualLayout.Width = 100;
+ //Modify the manual layout width mode
+ manualLayout.WidthMode = LayoutModes.edge;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open a presentation
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ 'Get the chart from the first slide
+ Dim chart As IOfficeChart = TryCast(presentation__1.Slides(0).Charts(0), IOfficeChart)
+ 'Set the legend position
+ chart.Legend.Position = OfficeLegendPosition.Top
+ 'Get the legend layout
+ Dim layout As IOfficeChartLayout = chart.Legend.Layout
+ 'Get the manual layout
+ Dim manualLayout As IOfficeChartManualLayout = layout.ManualLayout
+ 'Modify the manual layout left position
+ manualLayout.Left = 100
+ 'Modify the manual layout left mode
+ manualLayout.LeftMode = LayoutModes.factor
+ 'Modify the manual layout top position
+ manualLayout.Top = 100
+ 'Modify the manual layout top mode
+ manualLayout.TopMode = LayoutModes.factor
+ 'Modify the manual layout height
+ manualLayout.Height = 120
+ 'Modify the manual layout height mode
+ manualLayout.HeightMode = LayoutModes.factor
+ 'Modify the manual layout width
+ manualLayout.Width = 100
+ 'Modify the manual layout width mode
+ manualLayout.WidthMode = LayoutModes.edge
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Open a presentation
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ //Get the chart from the first slide
+ IOfficeChart chart = presentation.Slides[0].Charts[0] as IOfficeChart;
+ //Set the legend position
+ chart.Legend.Position = OfficeLegendPosition.Top;
+ //Get the legend layout
+ IOfficeChartLayout layout = chart.Legend.Layout;
+ //Get the manual layout
+ IOfficeChartManualLayout manualLayout = layout.ManualLayout;
+ //Modify the manual layout left position
+ manualLayout.Left = 100;
+ //Modify the manual layout left mode
+ manualLayout.LeftMode = LayoutModes.factor;
+ //Modify the manual layout top position
+ manualLayout.Top = 100;
+ //Modify the manual layout top mode
+ manualLayout.TopMode = LayoutModes.factor;
+ //Modify the manual layout height
+ manualLayout.Height = 120;
+ //Modify the manual layout height mode
+ manualLayout.HeightMode = LayoutModes.factor;
+ //Modify the manual layout width
+ manualLayout.Width = 100;
+ //Modify the manual layout width mode
+ manualLayout.WidthMode = LayoutModes.edge;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Open a presentation
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ 'Get the chart from the first slide
+ Dim chart As IOfficeChart = TryCast(presentation__1.Slides(0).Charts(0), IOfficeChart)
+ 'Set the legend position
+ chart.Legend.Position = OfficeLegendPosition.Top
+ 'Get the legend layout
+ Dim layout As IOfficeChartLayout = chart.Legend.Layout
+ 'Get the manual layout
+ Dim manualLayout As IOfficeChartManualLayout = layout.ManualLayout
+ 'Modify the manual layout left position
+ manualLayout.Left = 100
+ 'Modify the manual layout left mode
+ manualLayout.LeftMode = LayoutModes.factor
+ 'Modify the manual layout top position
+ manualLayout.Top = 100
+ 'Modify the manual layout top mode
+ manualLayout.TopMode = LayoutModes.factor
+ 'Modify the manual layout height
+ manualLayout.Height = 120
+ 'Modify the manual layout height mode
+ manualLayout.HeightMode = LayoutModes.factor
+ 'Modify the manual layout width
+ manualLayout.Width = 100
+ 'Modify the manual layout width mode
+ manualLayout.WidthMode = LayoutModes.edge
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Set the chart type
+ chart.ChartType = OfficeChartType.Scatter_Line;
+ //Add error bars to series
+ serieJan.ErrorBar(true);
+ serieFeb.ErrorBar(false);
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Set the chart type
+ chart.ChartType = OfficeChartType.Scatter_Line
+ 'Add error bars to series
+ serieJan.ErrorBar(True)
+ serieFeb.ErrorBar(False)
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Set the chart type
+ chart.ChartType = OfficeChartType.Scatter_Line;
+ //Add error bars to series
+ serieJan.ErrorBar(true,OfficeErrorBarInclude.Both);
+ serieFeb.ErrorBar(false,OfficeErrorBarInclude.Minus);
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Set the chart type
+ chart.ChartType = OfficeChartType.Scatter_Line
+ 'Add error bars to series
+ serieJan.ErrorBar(True, OfficeErrorBarInclude.Both)
+ serieFeb.ErrorBar(False, OfficeErrorBarInclude.Minus)
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Set the chart type
+ chart.ChartType = OfficeChartType.Scatter_Line;
+ //Add error bars to series
+ serieJan.ErrorBar(true, OfficeErrorBarInclude.Both, OfficeErrorBarType.StandardDeviation);
+ serieFeb.ErrorBar(false, OfficeErrorBarInclude.Plus, OfficeErrorBarType.StandardError);
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Set the chart type
+ chart.ChartType = OfficeChartType.Scatter_Line
+ 'Add error bars to series
+ serieJan.ErrorBar(True, OfficeErrorBarInclude.Both, OfficeErrorBarType.StandardDeviation)
+ serieFeb.ErrorBar(False, OfficeErrorBarInclude.Plus, OfficeErrorBarType.StandardError)
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Set the chart type
+ chart.ChartType = OfficeChartType.Scatter_Line;
+ //Add error bars to series
+ serieJan.ErrorBar(true, OfficeErrorBarInclude.Both, OfficeErrorBarType.StandardDeviation, 12.34);
+ serieFeb.ErrorBar(false, OfficeErrorBarInclude.Plus, OfficeErrorBarType.StandardError, 25.89);
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Set the chart type
+ chart.ChartType = OfficeChartType.Scatter_Line
+ 'Add error bars to series
+ serieJan.ErrorBar(True, OfficeErrorBarInclude.Both, OfficeErrorBarType.StandardDeviation, 12.34)
+ serieFeb.ErrorBar(False, OfficeErrorBarInclude.Plus, OfficeErrorBarType.StandardError, 25.89)
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Set the chart type
+ chart.ChartType = OfficeChartType.Scatter_Line;
+ //Set the error bar X for serie
+ serieJan.HasErrorBarsX = true;
+ //Set the plus range
+ serieJan.ErrorBarsX.PlusRange = chart.ChartData[2, 2, 4, 2];
+ //Set the minus range
+ serieJan.ErrorBarsX.MinusRange = chart.ChartData[2, 3, 4, 3];
+ //Add Error bar to serie
+ serieJan.ErrorBar(true, serieJan.ErrorBarsX.PlusRange, serieJan.ErrorBarsX.MinusRange);
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Set the chart type
+ chart.ChartType = OfficeChartType.Scatter_Line
+ 'Set the error bar X for serie
+ serieJan.HasErrorBarsX = True
+ 'Set the plus range
+ serieJan.ErrorBarsX.PlusRange = chart.ChartData(2, 2, 4, 2)
+ 'Set the minus range
+ serieJan.ErrorBarsX.MinusRange = chart.ChartData(2, 3, 4, 3)
+ 'Add Error bar to serie
+ serieJan.ErrorBar(True, serieJan.ErrorBarsX.PlusRange, serieJan.ErrorBarsX.MinusRange)
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentationDocument = Presentation.Create();
+ ISlide slide = presentationDocument.Slides.Add(SlideLayoutType.Blank);
+ //Loads the excel file as stream
+ Stream excelStream = File.OpenRead("Excel_Template.xlsx");
+ //Creates and Appends chart to the paragraph with excel stream as parameter
+ IPresentationChart chart = slide.Shapes.AddChart(excelStream, 1, "A1:C6", new RectangleF(0, 0, 470, 300));
+ foreach (IOfficeChartSerie serie in chart.Series)
+ {
+ serie.InvertIfNegative = true;
+ series.InvertIfNegativeColor = Color.Red;
+ }
+ chart.PrimaryCategoryAxis.CategoryLabels = chart.ChartData[2, 1, 6, 1];
+ //Sets chart type and title
+ chart.ChartType = OfficeChartType.Bar_Clustered;
+ chart.ChartTitle = "Purchase Details";
+ chart.ChartTitleArea.FontName = "Calibri";
+ chart.ChartTitleArea.Size = 14;
+ chart.PrimaryValueAxis.CrossesAt = 1500;
+ presentationDocument.Save("Output.pptx");
+ presentationDocument.Close();
+
+
+ Dim presentationDocument As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentationDocument.Slides.Add(SlideLayoutType.Blank)
+ 'Loads the excel file as stream
+ Dim excelStream As Stream = File.OpenRead("Excel_Template.xlsx")
+ 'Creates and Appends chart to the paragraph with excel stream as parameter
+ Dim chart As IPresentationChart = slide.Shapes.AddChart(excelStream, 1, "A1:C6", New RectangleF(0, 0, 470, 300))
+ For Each serie As IOfficeChartSerie In chart.Series
+ serie.InvertIfNegative = False
+ series.InvertIfNegativeColor = Color.Red
+ Next
+ chart.PrimaryCategoryAxis.CategoryLabels = chart.ChartData(2, 1, 6, 1)
+ 'Sets chart type and title
+ chart.ChartType = OfficeChartType.Bar_Clustered
+ chart.ChartTitle = "Purchase Details"
+ chart.ChartTitleArea.FontName = "Calibri"
+ chart.ChartTitleArea.Size = 14
+ chart.PrimaryValueAxis.CrossesAt = 1500
+ presentationDocument.Save("Output.pptx")
+ presentationDocument.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentationDocument As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentationDocument.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Save the presentation
+ presentationDocument.Save("Output.pptx")
+ 'Close the presentation
+ presentationDocument.Close()
+
+
+ IPresentation presentationDocument = Presentation.Create();
+ ISlide slide = presentationDocument.Slides.Add(SlideLayoutType.Blank);
+ //Loads the excel file as stream
+ Stream excelStream = File.OpenRead("Excel_Template.xlsx");
+ //Creates and Appends chart to the paragraph with excel stream as parameter
+ IPresentationChart chart = slide.Shapes.AddChart(excelStream, 1, "A1:C6", new RectangleF(0, 0, 470, 300));
+ foreach (IOfficeChartSerie serie in chart.Series)
+ {
+ serie.InvertIfNegative = false;
+ }
+ chart.PrimaryCategoryAxis.CategoryLabels = chart.ChartData[2, 1, 6, 1];
+ //Sets chart type and title
+ chart.ChartType = OfficeChartType.Bar_Clustered;
+ chart.ChartTitle = "Purchase Details";
+ chart.ChartTitleArea.FontName = "Calibri";
+ chart.ChartTitleArea.Size = 14;
+ chart.PrimaryValueAxis.CrossesAt = 1500;
+ presentationDocument.Save("Output.pptx");
+ presentationDocument.Close();
+
+
+ Dim presentationDocument As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentationDocument.Slides.Add(SlideLayoutType.Blank)
+ 'Loads the excel file as stream
+ Dim excelStream As Stream = File.OpenRead("Excel_Template.xlsx")
+ 'Creates and Appends chart to the paragraph with excel stream as parameter
+ Dim chart As IPresentationChart = slide.Shapes.AddChart(excelStream, 1, "A1:C6", New RectangleF(0, 0, 470, 300))
+ For Each serie As IOfficeChartSerie In chart.Series
+ serie.InvertIfNegative = False
+ Next
+ chart.PrimaryCategoryAxis.CategoryLabels = chart.ChartData(2, 1, 6, 1)
+ 'Sets chart type and title
+ chart.ChartType = OfficeChartType.Bar_Clustered
+ chart.ChartTitle = "Purchase Details"
+ chart.ChartTitleArea.FontName = "Calibri"
+ chart.ChartTitleArea.Size = 14
+ chart.PrimaryValueAxis.CrossesAt = 1500
+ presentationDocument.Save("Output.pptx")
+ presentationDocument.Close()
+
+
+ //Creates a Presentation instance
+ IPresentation presentation = Presentation.Open("BubbleChart.pptx");
+ ISlide slide = presentation.Slides[0];
+ IPresentationChart chart = slide.Charts[0];
+ //Retrieves the range of category labels
+ IOfficeDataRange dataRange = chart.Series[0].CategoryLabels;
+ //Changes the category label of a specific cell within the data range.
+ dataRange.SetValue(dataRange.FirstRow, dataRange.FirstColumn, 2.4);
+ //Saves the presentation
+ presentation.Save("Output.pptx");
+ //Closes the presentation
+ presentation.Close();
+
+
+ 'Creates a Presentation instance
+ Dim presentationDocument As IPresentation = Presentation.Open("BubbleChart.pptx")
+ Dim slide As ISlide = presentationDocument.Slides(0)
+ Dim chart As IPresentationChart = slide.Charts(0)
+ Retrieves the range of category labels
+ Dim dataRange As IOfficeDataRange = chart.Series(0).CategoryLabels
+ 'Changes the category label of a specific cell within the data range.
+ dataRange.SetValue(dataRange.FirstRow, dataRange.FirstColumn, 2.4)
+ 'Saves the presentation
+ presentationDocument.Save("Output.pptx")
+ 'Closes the presentation
+ presentationDocument.Close()
+
+
+ //Creates a Presentation instance
+ IPresentation presentation = Presentation.Open("BubbleChart.pptx");
+ ISlide slide = presentation.Slides[0];
+ IPresentationChart chart = slide.Charts[0];
+ //Retrieves the range of bubble sizes of the chart
+ IOfficeDataRange dataRange = chart.Series[0].Bubbles;
+ //Changes the bubble size in a specific cell within the data range.
+ dataRange.SetValue(dataRange.FirstRow, dataRange.FirstColumn, 20);
+ //Saves the presentation
+ presentation.Save("Output.pptx");
+ //Closes the presentation
+ presentation.Close();
+
+
+ 'Creates a Presentation instance
+ Dim presentationDocument As IPresentation = Presentation.Open("BubbleChart.pptx")
+ Dim slide As ISlide = presentationDocument.Slides(0)
+ Dim chart As IPresentationChart = slide.Charts(0)
+ 'Retrieves the range of bubble sizes of the chart
+ Dim dataRange As IOfficeDataRange = chart.Series(0).Bubbles
+ 'Changes the bubble size in a specific cell within the data range.
+ dataRange.SetValue(dataRange.FirstRow, dataRange.FirstColumn, 20)
+ 'Saves the presentation
+ presentationDocument.Save("Output.pptx")
+ 'Closes the presentation
+ presentationDocument.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the chart type as Radar
+ chart.ChartType = OfficeChartType.Radar;
+ //Reset the name of the serie
+ serieFeb.Name = "February";
+ //Get the Serie Format
+ IOfficeChartSerieDataFormat serieFormat = serieFeb.SerieFormat;
+ //Set the radar axis labels
+ serieFormat.CommonSerieOptions.HasRadarAxisLabels = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the chart type as Radar
+ chart.ChartType = OfficeChartType.Radar
+ 'Reset the name of the serie
+ serieFeb.Name = "February"
+ 'Get the Serie Format
+ Dim serieFormat As IOfficeChartSerieDataFormat = serieFeb.SerieFormat
+ 'Set the radar axis labels
+ serieFormat.CommonSerieOptions.HasRadarAxisLabels = True
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Creates a Presentation instance
+ IPresentation presentation = Presentation.Open("BubbleChart.pptx");
+ ISlide slide = presentation.Slides[0];
+ IPresentationChart chart = slide.Charts[0];
+ //Retrieves the name range of the series
+ IOfficeDataRange dataRange = chart.Series[0].NameRange;
+ //Sets a new name to the series
+ dataRange.SetValue(dataRange.FirstRow, dataRange.FirstColumn, "My serie Name");
+ //Saves the presentation
+ presentation.Save("Output.pptx");
+ //Closes the presentation
+ presentation.Close();
+
+
+ 'Creates a Presentation instance
+ Dim presentationDocument As IPresentation = Presentation.Open("BubbleChart.pptx")
+ Dim slide As ISlide = presentationDocument.Slides(0)
+ Dim chart As IPresentationChart = slide.Charts(0)
+ 'Retrieves the name range of the series
+ Dim dataRange As IOfficeDataRange = chart.Series(0).NameRange
+ 'Sets a new name to the series
+ dataRange.SetValue(dataRange.FirstRow, dataRange.FirstColumn, "My serie Name")
+ 'Saves the presentation
+ presentationDocument.Save("Output.pptx")
+ 'Closes the presentation
+ presentationDocument.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the primary axis for the serie
+ serieMarch.UsePrimaryAxis = true;
+ //Add the trendline to chart serie
+ serieJan.TrendLines.Add();
+ serieJan.TrendLines.Add(OfficeTrendLineType.Moving_Average);
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()///Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the primary axis for the serie
+ serieMarch.UsePrimaryAxis = True
+ 'Add the trendline to chart serie
+ serieJan.TrendLines.Add()
+ serieJan.TrendLines.Add(OfficeTrendLineType.Moving_Average)
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the series data points
+ IOfficeChartDataPoints dataPoints = chart.Series[0].DataPoints;
+ //Get the data point using the index, read only
+ IOfficeChartDataPoint dataPoint = dataPoints[0];
+ //Get the data labels of data point
+ IOfficeChartDataLabels dataLabels = dataPoint.DataLabels;
+ //Set the position of the data label
+ dataLabels.Position = OfficeDataLabelPosition.Center;
+ //Set the series name
+ dataLabels.IsSeriesName = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the series data points
+ Dim dataPoints As IOfficeChartDataPoints = chart.Series(0).DataPoints
+ 'Get the data point using the index, read only
+ Dim dataPoint As IOfficeChartDataPoint = dataPoints(0)
+ 'Get the data labels of data point
+ Dim dataLabels As IOfficeChartDataLabels = dataPoint.DataLabels
+ 'Set the position of the data label
+ dataLabels.Position = OfficeDataLabelPosition.Center
+ 'Set the series name
+ dataLabels.IsSeriesName = True
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the chart type as Radar
+ chart.ChartType = OfficeChartType.Radar;
+ //Reset the name of the serie
+ serieFeb.Name = "February";
+ //Get the Serie Format
+ IOfficeChartSerieDataFormat serieFormat = serieFeb.SerieFormat;
+ //Set the radar axis labels
+ serieFormat.CommonSerieOptions.HasRadarAxisLabels = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the chart type as Radar
+ chart.ChartType = OfficeChartType.Radar
+ 'Reset the name of the serie
+ serieFeb.Name = "February"
+ 'Get the Serie Format
+ Dim serieFormat As IOfficeChartSerieDataFormat = serieFeb.SerieFormat
+ 'Set the radar axis labels
+ serieFormat.CommonSerieOptions.HasRadarAxisLabels = True
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the serie type for each serie
+ serieFeb.SerieType = OfficeChartType.Line;
+ serieJan.SerieType = OfficeChartType.Area;
+ serieMarch.SerieType = OfficeChartType.Bar_Clustered;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the serie type for each serie
+ serieFeb.SerieType = OfficeChartType.Line
+ serieJan.SerieType = OfficeChartType.Area
+ serieMarch.SerieType = OfficeChartType.Bar_Clustered
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the chart type as Scatter line
+ chart.ChartType = OfficeChartType.Scatter_Line;
+ //Set the error Bar Y
+ serieJan.HasErrorBarsY = true;
+ //Set the color of error barX border
+ serieJan.ErrorBarsY.Border.LineColor = System.Drawing.Color.Red;
+ //Set the has cap
+ serieJan.ErrorBarsY.HasCap = true;
+ //Set the include
+ serieJan.ErrorBarsY.Include = OfficeErrorBarInclude.Minus;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the chart type as Scatter line
+ chart.ChartType = OfficeChartType.Scatter_Line
+ 'Set the error Bar Y
+ serieJan.HasErrorBarsY = True
+ 'Set the color of error barX border
+ serieJan.ErrorBarsY.Border.LineColor = System.Drawing.Color.Red
+ 'Set the has cap
+ serieJan.ErrorBarsY.HasCap = True
+ 'Set the include
+ serieJan.ErrorBarsY.Include = OfficeErrorBarInclude.Minus
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the chart type as Scatter line
+ chart.ChartType = OfficeChartType.Scatter_Line;
+ //Set the error Bar Y
+ serieJan.HasErrorBarsY = true;
+ //Set the color of error barX border
+ serieJan.ErrorBarsY.Border.LineColor = System.Drawing.Color.Red;
+ //Set the has cap
+ serieJan.ErrorBarsY.HasCap = true;
+ //Set the include
+ serieJan.ErrorBarsY.Include = OfficeErrorBarInclude.Minus;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the chart type as Scatter line
+ chart.ChartType = OfficeChartType.Scatter_Line
+ 'Set the error Bar Y
+ serieJan.HasErrorBarsY = True
+ 'Set the color of error barX border
+ serieJan.ErrorBarsY.Border.LineColor = System.Drawing.Color.Red
+ 'Set the has cap
+ serieJan.ErrorBarsY.HasCap = True
+ 'Set the include
+ serieJan.ErrorBarsY.Include = OfficeErrorBarInclude.Minus
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the chart type as Scatter line
+ chart.ChartType = OfficeChartType.Scatter_Line;
+ //Set the error Bar X
+ serieJan.HasErrorBarsX = true;
+ //Set the color of error barX border
+ serieJan.ErrorBarsX.Border.LineColor = System.Drawing.Color.Red;
+ //Set the has cap
+ serieJan.ErrorBarsX.HasCap = true;
+ //Set the include
+ serieJan.ErrorBarsX.Include = OfficeErrorBarInclude.Minus;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the chart type as Scatter line
+ chart.ChartType = OfficeChartType.Scatter_Line
+ 'Set the error Bar X
+ serieJan.HasErrorBarsX = True
+ 'Set the color of error barX border
+ serieJan.ErrorBarsX.Border.LineColor = System.Drawing.Color.Red
+ 'Set the has cap
+ serieJan.ErrorBarsX.HasCap = True
+ 'Set the include
+ serieJan.ErrorBarsX.Include = OfficeErrorBarInclude.Minus
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the chart type as Scatter line
+ chart.ChartType = OfficeChartType.Scatter_Line;
+ //Set the error Bar X
+ serieJan.HasErrorBarsX = true;
+ //Set the color of error barX border
+ serieJan.ErrorBarsX.Border.LineColor = System.Drawing.Color.Red;
+ //Set the has cap
+ serieJan.ErrorBarsX.HasCap = true;
+ //Set the include
+ serieJan.ErrorBarsX.Include = OfficeErrorBarInclude.Minus;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the chart type as Scatter line
+ chart.ChartType = OfficeChartType.Scatter_Line
+ 'Set the error Bar X
+ serieJan.HasErrorBarsX = True
+ 'Set the color of error barX border
+ serieJan.ErrorBarsX.Border.LineColor = System.Drawing.Color.Red
+ 'Set the has cap
+ serieJan.ErrorBarsX.HasCap = True
+ 'Set the include
+ serieJan.ErrorBarsX.Include = OfficeErrorBarInclude.Minus
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the primary axis for the serie
+ serieMarch.UsePrimaryAxis = true;
+ //Add the trendline to chart serie
+ serieJan.TrendLines.Add();
+ serieJan.TrendLines.Add(OfficeTrendLineType.Moving_Average);
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the primary axis for the serie
+ serieMarch.UsePrimaryAxis = True
+ 'Add the trendline to chart serie
+ serieJan.TrendLines.Add()
+ serieJan.TrendLines.Add(OfficeTrendLineType.Moving_Average)
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Filter the serie value
+ serieJan.IsFiltered = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Filter the serie value
+ serieJan.IsFiltered = True
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Creates a Presentation instance
+ IPresentation presentation = Presentation.Open("BubbleChart.pptx");
+ ISlide slide = presentation.Slides[0];
+ IPresentationChart chart = slide.Charts[0];
+ //Retrieves the name range of the series
+ IOfficeDataRange dataRange = chart.Series[0].NameRange;
+ //Sets a new name to the series
+ dataRange.SetValue(dataRange.FirstRow, dataRange.FirstColumn, "My serie Name");
+ //Saves the presentation
+ presentation.Save("Output.pptx");
+ //Closes the presentation
+ presentation.Close();
+
+
+ 'Creates a Presentation instance
+ Dim presentationDocument As IPresentation = Presentation.Open("BubbleChart.pptx")
+ Dim slide As ISlide = presentationDocument.Slides(0)
+ Dim chart As IPresentationChart = slide.Charts(0)
+ 'Retrieves the name range of the series
+ Dim dataRange As IOfficeDataRange = chart.Series(0).NameRange
+ 'Sets a new name to the series
+ dataRange.SetValue(dataRange.FirstRow, dataRange.FirstColumn, "My serie Name")
+ 'Saves the presentation
+ presentationDocument.Save("Output.pptx")
+ 'Closes the presentation
+ presentationDocument.Close()
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie - start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie - start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series - start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ Dim presentationDocument As IPresentation = Presentation.Create()
+ Dim slide As ISlide = presentationDocument.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie - start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie - start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series - start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Save the presentation
+ presentationDocument.Save("Output.pptx")
+ 'Close the presentation
+ presentationDocument.Close()
+
+
+ //Creates a Presentation instance
+ IPresentation presentation = Presentation.Open("BubbleChart.pptx");
+ ISlide slide = presentation.Slides[0];
+ IPresentationChart chart = slide.Charts[0];
+ //Retrieves the range of category labels
+ IOfficeDataRange dataRange = chart.Series[0].CategoryLabels;
+ //Changes the category label of a specific cell within the data range.
+ dataRange.SetValue(dataRange.FirstRow, dataRange.FirstColumn, 2.4);
+ //Saves the presentation
+ presentation.Save("Output.pptx");
+ //Closes the presentation
+ presentation.Close();
+
+
+ 'Creates a Presentation instance
+ Dim presentationDocument As IPresentation = Presentation.Open("BubbleChart.pptx")
+ Dim slide As ISlide = presentationDocument.Slides(0)
+ Dim chart As IPresentationChart = slide.Charts(0)
+ Retrieves the range of category labels
+ Dim dataRange As IOfficeDataRange = chart.Series(0).CategoryLabels
+ 'Changes the category label of a specific cell within the data range.
+ dataRange.SetValue(dataRange.FirstRow, dataRange.FirstColumn, 2.4)
+ 'Saves the presentation
+ presentationDocument.Save("Output.pptx")
+ 'Closes the presentation
+ presentationDocument.Close()
+
+
+ //Creates a Presentation instance
+ IPresentation presentation = Presentation.Open("BubbleChart.pptx");
+ ISlide slide = presentation.Slides[0];
+ IPresentationChart chart = slide.Charts[0];
+ //Retrieves the range of bubble sizes of the chart
+ IOfficeDataRange dataRange = chart.Series[0].Bubbles;
+ //Changes the bubble size in a specific cell within the data range.
+ dataRange.SetValue(dataRange.FirstRow, dataRange.FirstColumn, 20);
+ //Saves the presentation
+ presentation.Save("Output.pptx");
+ //Closes the presentation
+ presentation.Close();
+
+
+ 'Creates a Presentation instance
+ Dim presentationDocument As IPresentation = Presentation.Open("BubbleChart.pptx")
+ Dim slide As ISlide = presentationDocument.Slides(0)
+ Dim chart As IPresentationChart = slide.Charts(0)
+ 'Retrieves the range of bubble sizes of the chart
+ Dim dataRange As IOfficeDataRange = chart.Series(0).Bubbles
+ 'Changes the bubble size in a specific cell within the data range.
+ dataRange.SetValue(dataRange.FirstRow, dataRange.FirstColumn, 20)
+ 'Saves the presentation
+ presentationDocument.Save("Output.pptx")
+ 'Closes the presentation
+ presentationDocument.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Set the chart type
+ chart.ChartType = OfficeChartType.Column_3D;
+ //Set the number of series between tick-mark labels
+ chart.PrimarySerieAxis.TickLabelSpacing = 10;
+ //Sets the number of series between tick marks.
+ chart.PrimarySerieAxis.TickMarkSpacing = 15;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Set the chart type
+ chart.ChartType = OfficeChartType.Column_3D
+ 'Set the number of series between tick-mark labels
+ chart.PrimarySerieAxis.TickLabelSpacing = 10
+ 'Sets the number of series between tick marks.
+ chart.PrimarySerieAxis.TickMarkSpacing = 15
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Set the chart type
+ chart.ChartType = OfficeChartType.Column_3D;
+ //Set the number of series between tick-mark labels
+ chart.PrimarySerieAxis.TickLabelSpacing = 10;
+ //Sets the number of series between tick marks.
+ chart.PrimarySerieAxis.TickMarkSpacing = 15;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Set the chart type
+ chart.ChartType = OfficeChartType.Column_3D
+ 'Set the number of series between tick-mark labels
+ chart.PrimarySerieAxis.TickLabelSpacing = 10
+ 'Sets the number of series between tick marks.
+ chart.PrimarySerieAxis.TickMarkSpacing = 15
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add();
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb",OfficeChartType.Area);
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add()
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb", OfficeChartType.Area)
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add();
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb",OfficeChartType.Area);
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add()
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb", OfficeChartType.Area)
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add();
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb",OfficeChartType.Area);
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add()
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb", OfficeChartType.Area)
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add();
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb",OfficeChartType.Area);
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Remove a serie using the index position
+ chart.Series.RemoveAt(0);
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add()
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb", OfficeChartType.Area)
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Remove a serie using the index position
+ chart.Series.RemoveAt(0)
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add();
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb",OfficeChartType.Area);
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Remove a specific serie from collection
+ chart.Series.Remove(serieJan);
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add()
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb", OfficeChartType.Area)
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Remove a specific serie from collection
+ chart.Series.Remove(serieJan)
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add();
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb",OfficeChartType.Area);
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the count of the series
+ int count = chart.Series.Count;
+ //Set the data range of chart serie � start row, start column, end row, end column
+ chart.Series[0].Values = chart.ChartData[2, 2, 4, 2];
+ chart.Series["Feb"].Values = chart.ChartData[2, 3, 4, 3];
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add()
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb", OfficeChartType.Area)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the count of the series
+ Dim count As Integer = chart.Series.Count
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ chart.Series(0).Values = chart.ChartData(2, 2, 4, 2)
+ chart.Series("Feb").Values = chart.ChartData(2, 3, 4, 3)
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add();
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb",OfficeChartType.Area);
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the count of the series
+ int count = chart.Series.Count;
+ //Set the data range of chart serie � start row, start column, end row, end column
+ chart.Series[0].Values = chart.ChartData[2, 2, 4, 2];
+ chart.Series["Feb"].Values = chart.ChartData[2, 3, 4, 3];
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add()
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb", OfficeChartType.Area)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the count of the series
+ Dim count As Integer = chart.Series.Count
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ chart.Series(0).Values = chart.ChartData(2, 2, 4, 2)
+ chart.Series("Feb").Values = chart.ChartData(2, 3, 4, 3)
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add();
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb",OfficeChartType.Area);
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the count of the series
+ int count = chart.Series.Count;
+ //Set the data range of chart serie � start row, start column, end row, end column
+ chart.Series[0].Values = chart.ChartData[2, 2, 4, 2];
+ chart.Series["Feb"].Values = chart.ChartData[2, 3, 4, 3];
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 500, 300)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add()
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb", OfficeChartType.Area)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Get the count of the series
+ Dim count As Integer = chart.Series.Count
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ chart.Series(0).Values = chart.ChartData(2, 2, 4, 2)
+ chart.Series("Feb").Values = chart.ChartData(2, 3, 4, 3)
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Specify the chart title
+ chart.ChartTitle = "Sales Analysis";
+ //Specify the chart type
+ chart.ChartType = OfficeChartType.Column_Clustered;
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Add trendline to the serie
+ serieJan.TrendLines.Add();
+ //Add trendline with specific type
+ serieFeb.TrendLines.Add(OfficeTrendLineType.Moving_Average);
+ //Set the trendline color and weight
+ serieFeb.TrendLines[0].Border.LineWeight = OfficeChartLineWeight.Wide;
+ serieFeb.TrendLines[0].Border.LineColor = System.Drawing.Color.Blue;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 700, 500)
+ 'Specify the chart title
+ chart.ChartTitle = "Sales Analysis"
+ 'Specify the chart type
+ chart.ChartType = OfficeChartType.Column_Clustered
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Add trendline to the serie
+ serieJan.TrendLines.Add()
+ 'Add trendline with specific type
+ serieFeb.TrendLines.Add(OfficeTrendLineType.Moving_Average)
+ 'Set the trendline color and weight
+ serieFeb.TrendLines(0).Border.LineWeight = OfficeChartLineWeight.Wide
+ serieFeb.TrendLines(0).Border.LineColor = System.Drawing.Color.Blue
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Specify the chart title
+ chart.ChartTitle = "Sales Analysis";
+ //Specify the chart type
+ chart.ChartType = OfficeChartType.Column_Clustered;
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Add trendline to the serie
+ serieJan.TrendLines.Add();
+ //Add trendline with specific type
+ serieFeb.TrendLines.Add(OfficeTrendLineType.Moving_Average);
+ //Set the trendline color and weight
+ serieFeb.TrendLines[0].Border.LineWeight = OfficeChartLineWeight.Wide;
+ serieFeb.TrendLines[0].Border.LineColor = System.Drawing.Color.Blue;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 700, 500)
+ 'Specify the chart title
+ chart.ChartTitle = "Sales Analysis"
+ 'Specify the chart type
+ chart.ChartType = OfficeChartType.Column_Clustered
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Add trendline to the serie
+ serieJan.TrendLines.Add()
+ 'Add trendline with specific type
+ serieFeb.TrendLines.Add(OfficeTrendLineType.Moving_Average)
+ 'Set the trendline color and weight
+ serieFeb.TrendLines(0).Border.LineWeight = OfficeChartLineWeight.Wide
+ serieFeb.TrendLines(0).Border.LineColor = System.Drawing.Color.Blue
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Specify the chart title
+ chart.ChartTitle = "Sales Analysis";
+ //Specify the chart type
+ chart.ChartType = OfficeChartType.Column_Clustered;
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Add trendline to the serie
+ serieJan.TrendLines.Add();
+ serieFeb.TrendLines.Add();
+ //Add trendline with specific type
+ serieFeb.TrendLines.Add(OfficeTrendLineType.Moving_Average);
+ //Get the count of the trendline
+ int count = serieFeb.TrendLines.Count;
+ //Get the trendline instance from collection
+ IOfficeChartTrendLine trendline = serieFeb.TrendLines[0];
+ //Set the trendline color and weight
+ trendline.Border.LineWeight = OfficeChartLineWeight.Wide;
+ trendline.Border.LineColor = System.Drawing.Color.Blue;
+ //Remove a trendline object using index
+ serieFeb.TrendLines.RemoveAt(1);
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 700, 500)
+ 'Specify the chart title
+ chart.ChartTitle = "Sales Analysis"
+ 'Specify the chart type
+ chart.ChartType = OfficeChartType.Column_Clustered
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Add trendline to the serie
+ serieJan.TrendLines.Add()
+ serieFeb.TrendLines.Add()
+ 'Add trendline with specific type
+ serieFeb.TrendLines.Add(OfficeTrendLineType.Moving_Average)
+ 'Get the count of the trendline
+ Dim count As Integer = serieFeb.TrendLines.Count
+ 'Get the trendline instance from collection
+ Dim trendline As IOfficeChartTrendLine = serieFeb.TrendLines(0)
+ 'Set the trendline color and weight
+ trendline.Border.LineWeight = OfficeChartLineWeight.Wide
+ trendline.Border.LineColor = System.Drawing.Color.Blue
+ 'Remove a trendline object using index
+ serieFeb.TrendLines.RemoveAt(1)
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Specify the chart title
+ chart.ChartTitle = "Sales Analysis";
+ //Specify the chart type
+ chart.ChartType = OfficeChartType.Column_Clustered;
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Add trendline to the serie
+ serieJan.TrendLines.Add();
+ serieFeb.TrendLines.Add();
+ //Add trendline with specific type
+ serieFeb.TrendLines.Add(OfficeTrendLineType.Moving_Average);
+ //Get the count of the trendline
+ int count = serieFeb.TrendLines.Count;
+ //Get the trendline instance from collection
+ IOfficeChartTrendLine trendline = serieFeb.TrendLines[0];
+ //Set the trendline color and weight
+ trendline.Border.LineWeight = OfficeChartLineWeight.Wide;
+ trendline.Border.LineColor = System.Drawing.Color.Blue;
+ //Clear the trendlines in serie
+ serieFeb.TrendLines.Clear();
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 700, 500)
+ 'Specify the chart title
+ chart.ChartTitle = "Sales Analysis"
+ 'Specify the chart type
+ chart.ChartType = OfficeChartType.Column_Clustered
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Add trendline to the serie
+ serieJan.TrendLines.Add()
+ serieFeb.TrendLines.Add()
+ 'Add trendline with specific type
+ serieFeb.TrendLines.Add(OfficeTrendLineType.Moving_Average)
+ 'Get the count of the trendline
+ Dim count As Integer = serieFeb.TrendLines.Count
+ 'Get the trendline instance from collection
+ Dim trendline As IOfficeChartTrendLine = serieFeb.TrendLines(0)
+ 'Set the trendline color and weight
+ trendline.Border.LineWeight = OfficeChartLineWeight.Wide
+ trendline.Border.LineColor = System.Drawing.Color.Blue
+ 'Clear the trendlines in serie
+ serieFeb.TrendLines.Clear()
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Specify the chart title
+ chart.ChartTitle = "Sales Analysis";
+ //Specify the chart type
+ chart.ChartType = OfficeChartType.Column_Clustered;
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Add trendline to the serie
+ serieJan.TrendLines.Add();
+ serieFeb.TrendLines.Add();
+ //Add trendline with specific type
+ serieFeb.TrendLines.Add(OfficeTrendLineType.Moving_Average);
+ //Get the count of the trendline
+ int count = serieFeb.TrendLines.Count;
+ //Get the trendline instance from collection
+ IOfficeChartTrendLine trendline = serieFeb.TrendLines[0];
+ //Set the trendline color and weight
+ trendline.Border.LineWeight = OfficeChartLineWeight.Wide;
+ trendline.Border.LineColor = System.Drawing.Color.Blue;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 700, 500)
+ 'Specify the chart title
+ chart.ChartTitle = "Sales Analysis"
+ 'Specify the chart type
+ chart.ChartType = OfficeChartType.Column_Clustered
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Add trendline to the serie
+ serieJan.TrendLines.Add()
+ serieFeb.TrendLines.Add()
+ 'Add trendline with specific type
+ serieFeb.TrendLines.Add(OfficeTrendLineType.Moving_Average)
+ 'Get the count of the trendline
+ Dim count As Integer = serieFeb.TrendLines.Count
+ 'Get the trendline instance from collection
+ Dim trendline As IOfficeChartTrendLine = serieFeb.TrendLines(0)
+ 'Set the trendline color and weight
+ trendline.Border.LineWeight = OfficeChartLineWeight.Wide
+ trendline.Border.LineColor = System.Drawing.Color.Blue
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Specify the chart title
+ chart.ChartTitle = "Sales Analysis";
+ //Specify the chart type
+ chart.ChartType = OfficeChartType.Column_Clustered;
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Add trendline to the serie
+ serieJan.TrendLines.Add();
+ serieFeb.TrendLines.Add();
+ //Add trendline with specific type
+ serieFeb.TrendLines.Add(OfficeTrendLineType.Moving_Average);
+ //Get the count of the trendline
+ int count = serieFeb.TrendLines.Count;
+ //Get the trendline instance from collection
+ IOfficeChartTrendLine trendline = serieFeb.TrendLines[0];
+ //Set the trendline color and weight
+ trendline.Border.LineWeight = OfficeChartLineWeight.Wide;
+ trendline.Border.LineColor = System.Drawing.Color.Blue;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 700, 500)
+ 'Specify the chart title
+ chart.ChartTitle = "Sales Analysis"
+ 'Specify the chart type
+ chart.ChartType = OfficeChartType.Column_Clustered
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData(2, 3, 4, 3)
+ 'Add trendline to the serie
+ serieJan.TrendLines.Add()
+ serieFeb.TrendLines.Add()
+ 'Add trendline with specific type
+ serieFeb.TrendLines.Add(OfficeTrendLineType.Moving_Average)
+ 'Get the count of the trendline
+ Dim count As Integer = serieFeb.TrendLines.Count
+ 'Get the trendline instance from collection
+ Dim trendline As IOfficeChartTrendLine = serieFeb.TrendLines(0)
+ 'Set the trendline color and weight
+ trendline.Border.LineWeight = OfficeChartLineWeight.Wide
+ trendline.Border.LineColor = System.Drawing.Color.Blue
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Add trendline to the serie
+ serieJan.TrendLines.Add();
+ //Get the trendline of serie
+ IOfficeChartTrendLine trendline = serieJan.TrendLines[0];
+ //Set the type of trendline
+ trendline.Type = OfficeTrendLineType.Polynomial;
+ //Set the intercept of trendline
+ trendline.Intercept = 0.8;
+ //Set the name for trendline
+ trendline.Name = "Trendline";
+ //Set the order
+ trendline.Order = 3;
+ //Clear the trendline formats
+ trendline.ClearFormats();
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 700, 500)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Add trendline to the serie
+ serieJan.TrendLines.Add()
+ 'Get the trendline of serie
+ Dim trendline As IOfficeChartTrendLine = serieJan.TrendLines(0)
+ 'Set the type of trendline
+ trendline.Type = OfficeTrendLineType.Polynomial
+ 'Set the intercept of trendline
+ trendline.Intercept = 0.8
+ 'Set the name for trendline
+ trendline.Name = "Trendline"
+ 'Set the order
+ trendline.Order = 3
+ 'Clear the trendline formats
+ trendline.ClearFormats()
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the chart type
+ chart.ChartType = OfficeChartType.Bar_Clustered;
+ //Add trendline to the serie
+ serieJan.TrendLines.Add();
+ //Get the trendline of serie
+ IOfficeChartTrendLine trendline = serieJan.TrendLines[0];
+ //Set the line color of border
+ trendline.Border.LineColor = System.Drawing.Color.Green;
+ //Set the line weight
+ trendline.Border.LineWeight = OfficeChartLineWeight.Medium;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 700, 500)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the chart type
+ chart.ChartType = OfficeChartType.Bar_Clustered
+ 'Add trendline to the serie
+ serieJan.TrendLines.Add()
+ 'Get the trendline of serie
+ Dim trendline As IOfficeChartTrendLine = serieJan.TrendLines(0)
+ 'Set the line color of border
+ trendline.Border.LineColor = System.Drawing.Color.Green
+ 'Set the line weight
+ trendline.Border.LineWeight = OfficeChartLineWeight.Medium
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the chart type
+ chart.ChartType = OfficeChartType.Bar_Clustered;
+ //Add trendline to the serie
+ serieJan.TrendLines.Add();
+ //Get the trendline of serie
+ IOfficeChartTrendLine trendline = serieJan.TrendLines[0];
+ //Set the backward
+ trendline.Backward = 0.3;
+ //Set the line color of border
+ trendline.Border.LineColor = System.Drawing.Color.Green;
+ //Set the line weight
+ trendline.Border.LineWeight = OfficeChartLineWeight.Medium;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 700, 500)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the chart type
+ chart.ChartType = OfficeChartType.Bar_Clustered
+ 'Add trendline to the serie
+ serieJan.TrendLines.Add()
+ 'Get the trendline of serie
+ Dim trendline As IOfficeChartTrendLine = serieJan.TrendLines(0)
+ 'Set the backward
+ trendline.Backward = 0.3
+ 'Set the line color of border
+ trendline.Border.LineColor = System.Drawing.Color.Green
+ 'Set the line weight
+ trendline.Border.LineWeight = OfficeChartLineWeight.Medium
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Add trendline to the serie
+ serieJan.TrendLines.Add();
+ //Get the trendline of serie
+ IOfficeChartTrendLine trendline = serieJan.TrendLines[0];
+ //Set the intercept as auto
+ trendline.InterceptIsAuto = true;
+ //Set the name as auto
+ trendline.NameIsAuto = true;
+ //Set the forward
+ trendline.Forward = 0.3;
+ //Set the type of trendline
+ trendline.Type = OfficeTrendLineType.Logarithmic;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 700, 500)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Add trendline to the serie
+ serieJan.TrendLines.Add()
+ 'Get the trendline of serie
+ Dim trendline As IOfficeChartTrendLine = serieJan.TrendLines(0)
+ 'Set the intercept as auto
+ trendline.InterceptIsAuto = True
+ 'Set the name as auto
+ trendline.NameIsAuto = True
+ 'Set the forward
+ trendline.Forward = 0.3
+ 'Set the type of trendline
+ trendline.Type = OfficeTrendLineType.Logarithmic
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Add trendline to the serie
+ serieJan.TrendLines.Add();
+ //Get the trendline of serie
+ IOfficeChartTrendLine trendline = serieJan.TrendLines[0];
+ //Set the display equation
+ trendline.DisplayEquation = true;
+ //Set the display RSSquared
+ trendline.DisplayRSquared = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 700, 500)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Add trendline to the serie
+ serieJan.TrendLines.Add()
+ 'Get the trendline of serie
+ Dim trendline As IOfficeChartTrendLine = serieJan.TrendLines(0)
+ 'Set the display equation
+ trendline.DisplayEquation = True
+ 'Set the display RSSquared
+ trendline.DisplayRSquared = True
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Add trendline to the serie
+ serieJan.TrendLines.Add();
+ //Get the trendline of serie
+ IOfficeChartTrendLine trendline = serieJan.TrendLines[0];
+ //Set the display equation
+ trendline.DisplayEquation = true;
+ //Set the display RSSquared
+ trendline.DisplayRSquared = true;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 700, 500)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Add trendline to the serie
+ serieJan.TrendLines.Add()
+ 'Get the trendline of serie
+ Dim trendline As IOfficeChartTrendLine = serieJan.TrendLines(0)
+ 'Set the display equation
+ trendline.DisplayEquation = True
+ 'Set the display RSSquared
+ trendline.DisplayRSquared = True
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Add trendline to the serie
+ serieJan.TrendLines.Add();
+ //Get the trendline of serie
+ IOfficeChartTrendLine trendline = serieJan.TrendLines[0];
+ //Set the type of trendline
+ trendline.Type = OfficeTrendLineType.Polynomial;
+ //Set the intercept of trendline
+ trendline.Intercept = 0.8;
+ //Set the name for trendline
+ trendline.Name = "Trendline";
+ //Set the order
+ trendline.Order = 3;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 700, 500)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Add trendline to the serie
+ serieJan.TrendLines.Add()
+ 'Get the trendline of serie
+ Dim trendline As IOfficeChartTrendLine = serieJan.TrendLines(0)
+ 'Set the type of trendline
+ trendline.Type = OfficeTrendLineType.Polynomial
+ 'Set the intercept of trendline
+ trendline.Intercept = 0.8
+ 'Set the name for trendline
+ trendline.Name = "Trendline"
+ 'Set the order
+ trendline.Order = 3
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Add trendline to the serie
+ serieJan.TrendLines.Add();
+ //Get the trendline of serie
+ IOfficeChartTrendLine trendline = serieJan.TrendLines[0];
+ //Set the intercept as auto
+ trendline.InterceptIsAuto = true;
+ //Set the name as auto
+ trendline.NameIsAuto = true;
+ //Set the forward
+ trendline.Forward = 0.3;
+ //Set the type of trendline
+ trendline.Type = OfficeTrendLineType.Logarithmic;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance///Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 700, 500)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Add trendline to the serie
+ serieJan.TrendLines.Add()
+ 'Get the trendline of serie
+ Dim trendline As IOfficeChartTrendLine = serieJan.TrendLines(0)
+ 'Set the intercept as auto
+ trendline.InterceptIsAuto = True
+ 'Set the name as auto
+ trendline.NameIsAuto = True
+ 'Set the forward
+ trendline.Forward = 0.3
+ 'Set the type of trendline
+ trendline.Type = OfficeTrendLineType.Logarithmic
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Add trendline to the serie
+ serieJan.TrendLines.Add();
+ //Get the trendline of serie
+ IOfficeChartTrendLine trendline = serieJan.TrendLines[0];
+ //Set the intercept as auto
+ trendline.InterceptIsAuto = true;
+ //Set the name as auto
+ trendline.NameIsAuto = true;
+ //Set the forward
+ trendline.Forward = 0.3;
+ //Set the type of trendline
+ trendline.Type = OfficeTrendLineType.Logarithmic;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 700, 500)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Add trendline to the serie
+ serieJan.TrendLines.Add()
+ 'Get the trendline of serie
+ Dim trendline As IOfficeChartTrendLine = serieJan.TrendLines(0)
+ 'Set the intercept as auto
+ trendline.InterceptIsAuto = True
+ 'Set the name as auto
+ trendline.NameIsAuto = True
+ 'Set the forward
+ trendline.Forward = 0.3
+ 'Set the type of trendline
+ trendline.Type = OfficeTrendLineType.Logarithmic
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Add trendline to the serie
+ serieJan.TrendLines.Add();
+ //Get the trendline of serie
+ IOfficeChartTrendLine trendline = serieJan.TrendLines[0];
+ //Set the type of trendline
+ trendline.Type = OfficeTrendLineType.Polynomial;
+ //Set the intercept of trendline
+ trendline.Intercept = 0.8;
+ //Set the name for trendline
+ trendline.Name = "Trendline";
+ //Set the order
+ trendline.Order = 3;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 700, 500)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Add trendline to the serie
+ serieJan.TrendLines.Add()
+ 'Get the trendline of serie
+ Dim trendline As IOfficeChartTrendLine = serieJan.TrendLines(0)
+ 'Set the type of trendline
+ trendline.Type = OfficeTrendLineType.Polynomial
+ 'Set the intercept of trendline
+ trendline.Intercept = 0.8
+ 'Set the name for trendline
+ trendline.Name = "Trendline"
+ 'Set the order
+ trendline.Order = 3
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Add trendline to the serie
+ serieJan.TrendLines.Add();
+ //Get the trendline of serie
+ IOfficeChartTrendLine trendline = serieJan.TrendLines[0];
+ //Set the intercept as auto
+ trendline.InterceptIsAuto = true;
+ //Set the name as auto
+ trendline.NameIsAuto = true;
+ //Set the forward
+ trendline.Forward = 0.3;
+ //Set the type of trendline
+ trendline.Type = OfficeTrendLineType.Logarithmic;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 700, 500)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Add trendline to the serie
+ serieJan.TrendLines.Add()
+ 'Get the trendline of serie
+ Dim trendline As IOfficeChartTrendLine = serieJan.TrendLines(0)
+ 'Set the intercept as auto
+ trendline.InterceptIsAuto = True
+ 'Set the name as auto
+ trendline.NameIsAuto = True
+ 'Set the forward
+ trendline.Forward = 0.3
+ 'Set the type of trendline
+ trendline.Type = OfficeTrendLineType.Logarithmic
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Add trendline to the serie
+ serieJan.TrendLines.Add();
+ //Get the trendline of serie
+ IOfficeChartTrendLine trendline = serieJan.TrendLines[0];
+ //Set the type of trendline
+ trendline.Type = OfficeTrendLineType.Polynomial;
+ //Set the intercept of trendline
+ trendline.Intercept = 0.8;
+ //Set the name for trendline
+ trendline.Name = "Trendline";
+ //Set the order
+ trendline.Order = 3;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 700, 500)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Add trendline to the serie
+ serieJan.TrendLines.Add()
+ 'Get the trendline of serie
+ Dim trendline As IOfficeChartTrendLine = serieJan.TrendLines(0)
+ 'Set the type of trendline
+ trendline.Type = OfficeTrendLineType.Polynomial
+ 'Set the intercept of trendline
+ trendline.Intercept = 0.8
+ 'Set the name for trendline
+ trendline.Name = "Trendline"
+ 'Set the order
+ trendline.Order = 3
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Create a presentation instance
+ IPresentation presentation = Presentation.Create();
+ //Add a blank slide to the presentation
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Set the chart type
+ chart.ChartType = OfficeChartType.Bar_Clustered;
+ //Add trendline to the serie
+ serieJan.TrendLines.Add();
+ //Get the trendline of serie
+ IOfficeChartTrendLine trendline = serieJan.TrendLines[0];
+ //Set the bold font style for data label
+ trendline.DataLabel.Bold = true;
+ //Set the color of data label
+ trendline.DataLabel.Color = OfficeKnownColors.Red;
+ //Set the font name
+ trendline.DataLabel.FontName = "Helvetica";
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ 'Create a presentation instance
+ Dim presentation__1 As IPresentation = Presentation.Create()
+ 'Add a blank slide to the presentation
+ Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
+ 'Add chart to the slide with position and size
+ Dim chart As IPresentationChart = slide.Charts.AddChart(100, 10, 700, 500)
+ 'Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan")
+ chart.ChartData.SetValue(1, 3, "Feb")
+ chart.ChartData.SetValue(1, 4, "March")
+ 'Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2010")
+ chart.ChartData.SetValue(2, 2, "60")
+ chart.ChartData.SetValue(2, 3, "70")
+ chart.ChartData.SetValue(2, 4, "80")
+ 'Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2011")
+ chart.ChartData.SetValue(3, 2, "80")
+ chart.ChartData.SetValue(3, 3, "70")
+ chart.ChartData.SetValue(3, 4, "60")
+ 'Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2012")
+ chart.ChartData.SetValue(4, 2, "60")
+ chart.ChartData.SetValue(4, 3, "70")
+ chart.ChartData.SetValue(4, 4, "80")
+ 'Create a new chart series with the name
+ Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
+ 'Set the data range of chart serie � start row, start column, end row, end column
+ serieJan.Values = chart.ChartData(2, 2, 4, 2)
+ 'Create a new chart series with the name
+ Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
+ 'Set the data range of chart series � start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData(2, 4, 4, 4)
+ 'Set the chart type
+ chart.ChartType = OfficeChartType.Bar_Clustered
+ 'Add trendline to the serie
+ serieJan.TrendLines.Add()
+ 'Get the trendline of serie
+ Dim trendline As IOfficeChartTrendLine = serieJan.TrendLines(0)
+ 'Set the bold font style for data label
+ trendline.DataLabel.Bold = True
+ 'Set the color of data label
+ trendline.DataLabel.Color = OfficeKnownColors.Red
+ 'Set the font name
+ trendline.DataLabel.FontName = "Helvetica"
+ 'Save the presentation
+ presentation__1.Save("Output.pptx")
+ 'Close the presentation
+ presentation__1.Close()
+
+
+ //Open a presentation
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ //Get a bubble chart from the slide
+ IPresentationChart chart = presentation.Slides[0].Charts[0];
+ //Change the chart type to 3D
+ chart.ChartType = OfficeChartType.Bar_Clustered_3D;
+ //Get the side wall of chart
+ IOfficeChartWallOrFloor sideWall = chart.SideWall;
+ //Set the picture unit of side wall
+ sideWall.PictureUnit = OfficeChartPictureType.stretch;
+ //Set the thickness
+ sideWall.Thickness = 40;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Open a presentation
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ //Get a bubble chart from the slide
+ IPresentationChart chart = presentation.Slides[0].Charts[0];
+ //Change the chart type to 3D
+ chart.ChartType = OfficeChartType.Bar_Clustered_3D;
+ //Get the side wall of chart
+ IOfficeChartWallOrFloor sideWall = chart.SideWall;
+ //Set the picture unit of side wall
+ sideWall.PictureUnit = OfficeChartPictureType.stretch;
+ //Set the thickness
+ sideWall.Thickness = 40;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+ This is a memory efficient way to represent a table where values can remain empty. Only rows + that actually contain data will allocate an SFArrayList and the array only holds + as many objects as the specific row contains columns.
+When you access data that are out of range, an empty () object will be returned. + If you set data that are out of range, an exception will be thrown. If you set data for + a row that is empty, the row will be allocated before the value is stored.
+SFTable provides methods that let you insert, remove or rearrange columns or m_arrRows + in the table.
+This is a memory efficient way to represent a table where values can remain empty. Only rows + that actually contain data will allocate an SFArrayList and the array only holds + as many objects as the specific row contains columns.
+When you access data that are out of range, an empty () object will be returned. + If you set data that are out of range, an exception will be thrown. If you set data for + a row that is empty, the row will be allocated before the value is stored.
+SFTable provides methods that let you insert, remove or rearrange columns or m_arrRows + in the table.
+
+ using (ExcelEngine excelEngine = new ExcelEngine())
+ {
+ //Create worksheet
+ IApplication application = excelEngine.Excel;
+ application.DefaultVersion = ExcelVersion.Excel2013;
+ IWorkbook workbook = application.Workbooks.Create(1);
+ IWorksheet worksheet = workbook.Worksheets[0];
+
+ //Create image stream from svg
+ Stream svgStream = new FileStream("image.svg", FileMode.Open);
+
+ //Create image stream from png
+ Stream stream = new FileStream("image.png", FileMode.Open);
+
+ //Add image
+ IPictureShape picture = worksheet.Pictures.AddPicture(1, 1, svgStream, stream, 50, 50);
+
+ //Check
+ Console.Write(picture.FileName);
+
+ //Save and dispose
+ workbook.SaveAs("Shapes.xlsx");
+ workbook.Close();
+ Console.ReadKey();
+ }
+ //Output will be
+ //Picture0
+
+
+ using (ExcelEngine excelEngine = new ExcelEngine())
+ {
+ //Create worksheet
+ IApplication application = excelEngine.Excel;
+ application.DefaultVersion = ExcelVersion.Excel2013;
+ IWorkbook workbook = application.Workbooks.Create(1);
+ IWorksheet worksheet = workbook.Worksheets[0];
+
+ //Create image stream from svg
+ Stream svgStream = new FileStream("image.svg", FileMode.Open);
+
+ //Create image stream from png
+ Stream stream = new FileStream("image.png", FileMode.Open);
+
+ //Add image
+ IPictureShape picture = worksheet.Pictures.AddPicture(1, 1, svgStream, stream, 50, 50);
+
+ //Check
+ Console.Write(picture.Picture != null);
+
+ //Save and dispose
+ workbook.SaveAs("Shapes.xlsx");
+ workbook.Close();
+ Console.ReadKey();
+ }
+ //Output will be
+ //True
+
+
+ using (ExcelEngine excelEngine = new ExcelEngine())
+ {
+ //Create worksheet
+ IApplication application = excelEngine.Excel;
+ application.DefaultVersion = ExcelVersion.Excel2013;
+ IWorkbook workbook = application.Workbooks.Create(1);
+ IWorksheet worksheet = workbook.Worksheets[0];
+
+ //Create image stream from svg
+ Stream svgStream = new FileStream("image.svg", FileMode.Open);
+
+ //Create image stream from png
+ Stream stream = new FileStream("image.png", FileMode.Open);
+
+ //Add image
+ IPictureShape picture = worksheet.Pictures.AddPicture(1, 1, svgStream, stream, 50, 50);
+
+ //Check
+ Console.Write(picture.SvgData != null);
+
+ //Save and dispose
+ workbook.SaveAs("Shapes.xlsx");
+ workbook.Close();
+ Console.ReadKey();
+ }
+ //Output will be
+ //True
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie – start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie – start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series – start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the 3D format of chart serie
+ IThreeDFormat format = chart.Series[0].SerieFormat.ThreeD;
+ //Set the bevel top
+ format.BevelTop = Office2007ChartBevelProperties.CoolSlant;
+ //Set the height of bevel top
+ format.BevelTopHeight = 300;
+ //Set the width of bevel top
+ format.BevelTopWidth = 320;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie – start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie – start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series – start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the 3D format of chart serie
+ IThreeDFormat format = chart.Series[0].SerieFormat.ThreeD;
+ //Set the bevel bottom
+ format.BevelBottom = Office2007ChartBevelProperties.Angle;
+ //Set the height of bevel bottom
+ format.BevelBottomHeight = 100;
+ //Set the width of bevel bottom
+ format.BevelBottomWidth = 120;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie – start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie – start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series – start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the 3D format of chart serie
+ IThreeDFormat format = chart.Series[0].SerieFormat.ThreeD;
+ //Set the 3D lightning
+ format.Lighting = Office2007ChartLightingProperties.Chilly;
+ //Set the 3D material
+ format.Material = Office2007ChartMaterialProperties.DarkEdge;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie – start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie – start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series – start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the 3D format of chart serie
+ IThreeDFormat format = chart.Series[0].SerieFormat.ThreeD;
+ //Set the 3D lightning
+ format.Lighting = Office2007ChartLightingProperties.Chilly;
+ //Set the 3D material
+ format.Material = Office2007ChartMaterialProperties.DarkEdge;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie – start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie – start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series – start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the 3D format of chart serie
+ IThreeDFormat format = chart.Series[0].SerieFormat.ThreeD;
+ //Set the bevel top
+ format.BevelTop = Office2007ChartBevelProperties.CoolSlant;
+ //Set the height of bevel top
+ format.BevelTopHeight = 300;
+ //Set the width of bevel top
+ format.BevelTopWidth = 320;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie – start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie – start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series – start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the 3D format of chart serie
+ IThreeDFormat format = chart.Series[0].SerieFormat.ThreeD;
+ //Set the bevel top
+ format.BevelTop = Office2007ChartBevelProperties.CoolSlant;
+ //Set the height of bevel top
+ format.BevelTopHeight = 300;
+ //Set the width of bevel top
+ format.BevelTopWidth = 320;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie – start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie – start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series – start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the 3D format of chart serie
+ IThreeDFormat format = chart.Series[0].SerieFormat.ThreeD;
+ //Set the bevel bottom
+ format.BevelBottom = Office2007ChartBevelProperties.Angle;
+ //Set the height of bevel bottom
+ format.BevelBottomHeight = 100;
+ //Set the width of bevel bottom
+ format.BevelBottomWidth = 120;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ IPresentation presentation = Presentation.Create();
+ ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
+ //Add chart to the slide with position and size
+ IPresentationChart chart = slide.Charts.AddChart(100, 10, 500, 300);
+ //Set chart data - Row1
+ chart.ChartData.SetValue(1, 2, "Jan");
+ chart.ChartData.SetValue(1, 3, "Feb");
+ chart.ChartData.SetValue(1, 4, "March");
+ //Set chart data - Row2
+ chart.ChartData.SetValue(2, 1, "2011");
+ chart.ChartData.SetValue(2, 2, "60");
+ chart.ChartData.SetValue(2, 3, "70");
+ chart.ChartData.SetValue(2, 4, "80");
+ //Set chart data - Row3
+ chart.ChartData.SetValue(3, 1, "2009");
+ chart.ChartData.SetValue(3, 2, "80");
+ chart.ChartData.SetValue(3, 3, "70");
+ chart.ChartData.SetValue(3, 4, "60");
+ //Set chart data - Row4
+ chart.ChartData.SetValue(4, 1, "2010");
+ chart.ChartData.SetValue(4, 2, "60");
+ chart.ChartData.SetValue(4, 3, "70");
+ chart.ChartData.SetValue(4, 4, "80");
+ //Create a new chart series with the name
+ IOfficeChartSerie serieJan = chart.Series.Add("Jan");
+ //Set the data range of chart serie – start row, start column, end row, end column
+ serieJan.Values = chart.ChartData[2, 2, 4, 2];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
+ //Set the data range of chart serie – start row, start column, end row, end column
+ serieFeb.Values = chart.ChartData[2, 3, 4, 3];
+ //Create a new chart series with the name
+ IOfficeChartSerie serieMarch = chart.Series.Add("March");
+ //Set the data range of chart series – start row, start column, end row, end column
+ serieMarch.Values = chart.ChartData[2, 4, 4, 4];
+ //Get the 3D format of chart serie
+ IThreeDFormat format = chart.Series[0].SerieFormat.ThreeD;
+ //Set the bevel bottom
+ format.BevelBottom = Office2007ChartBevelProperties.Angle;
+ //Set the height of bevel bottom
+ format.BevelBottomHeight = 100;
+ //Set the width of bevel bottom
+ format.BevelBottomWidth = 120;
+ //Save the presentation
+ presentation.Save("Output.pptx");
+ //Close the presentation
+ presentation.Close();
+
+
+ //Open a PowerPoint presentation file
+ IPresentation presentation = Presentation.Open("Template.pptx");
+ //Create an instance of ChartToImageConverter
+ presentation.ChartToImageConverter = new ChartToImageConverter();
+ //Set the scaling mode as best
+ presentation.ChartToImageConverter.ScalingMode = Syncfusion.OfficeChart.ScalingMode.Best;
+ //Convert the first slide into image
+ System.Drawing.Image image = presentation.Slides[0].ConvertToImage(Syncfusion.Drawing.ImageType.Metafile);
+ //Save the image as file
+ image.Save("slide1.png");
+ //close the presentation instance
+ presentation.Close();
+
+
+ 'Open a PowerPoint presentation file
+ Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
+ 'Create an instance of ChartToImageConverter
+ presentation__1.ChartToImageConverter = New ChartToImageConverter()
+ 'Set the scaling mode as best
+ presentation__1.ChartToImageConverter.ScalingMode = Syncfusion.OfficeChart.ScalingMode.Best
+ 'Convert the first slide into image
+ Dim image As System.Drawing.Image = presentation__1.Slides(0).ConvertToImage(Syncfusion.Drawing.ImageType.Metafile)
+ 'Save the image as file
+ image.Save("slide1.png")
+ 'close the presentation instance
+ presentation__1.Close()
+
+
+ using (ExcelEngine excelEngine = new ExcelEngine())
+ {
+ //Create worksheet
+ IApplication application = excelEngine.Excel;
+ application.DefaultVersion = ExcelVersion.Excel2013;
+ IWorkbook workbook = application.Workbooks.Open("GroupShapes.xlsx");
+ IWorksheet worksheet = workbook.Worksheets[0];
+
+ IShapes shapes = worksheet.Shapes;
+ IShape[] groupItems = (shapes[0] as IGroupShape).Items;
+
+ //Save and dispose
+ workbook.SaveAs("GroupShapes.xlsx");
+ workbook.Close();
+ }
+
+
+ using (ExcelEngine excelEngine = new ExcelEngine())
+ {
+ //Create worksheet
+ IApplication application = excelEngine.Excel;
+ application.DefaultVersion = ExcelVersion.Excel2013;
+ IWorkbook workbook = application.Workbooks.Create(1);
+ IWorksheet worksheet = workbook.Worksheets[0];
+
+ //Add pictures
+ worksheet.Pictures.AddPicture("image.png");
+ worksheet.Pictures.AddPicture("image.png");
+
+ //Get count
+ Console.Write(worksheet.Pictures.Count);
+
+ //Save and dispose
+ workbook.SaveAs("Pictures.xlsx");
+ workbook.Close();
+ Console.ReadKey();
+ }
+
+
+ using (ExcelEngine excelEngine = new ExcelEngine())
+ {
+ //Create worksheet
+ IApplication application = excelEngine.Excel;
+ application.DefaultVersion = ExcelVersion.Excel2013;
+ IWorkbook workbook = application.Workbooks.Create(1);
+ IWorksheet worksheet = workbook.Worksheets[0];
+
+ //Add picture
+ worksheet.Pictures.AddPicture("image.png");
+
+ //Set picture
+ IPictureShape picture = worksheet.Pictures[0];
+
+ //Set dimension
+ picture.Left = 3;
+ picture.Top = 3;
+ picture.Height = 50;
+ picture.Width = 50;
+
+ //Save and dispose
+ workbook.SaveAs("Pictures.xlsx");
+ workbook.Close();
+ }
+
+
+ using (ExcelEngine excelEngine = new ExcelEngine())
+ {
+ //Create worksheet
+ IApplication application = excelEngine.Excel;
+ application.DefaultVersion = ExcelVersion.Excel2013;
+ IWorkbook workbook = application.Workbooks.Create(1);
+ IWorksheet worksheet = workbook.Worksheets[0];
+
+ //Add picture
+ worksheet.Pictures.AddPicture("image.png");
+
+ //Set picture
+ IPictureShape picture = worksheet.Pictures["image"];
+
+ //Set dimension
+ picture.Left = 3;
+ picture.Top = 3;
+ picture.Height = 50;
+ picture.Width = 50;
+
+ //Save and dispose
+ workbook.SaveAs("OLEObjects.xlsx");
+ workbook.Close();
+ }
+
+
+ public static GridModel LoadSoap(Stream s)
+ {
+ try
+ {
+ AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(GridAssembly.AssemblyResolver);
+ SoapFormatter b = new SoapFormatter();
+ b.AssemblyFormat = FormatterAssemblyStyle.Simple;
+ GridModel t = b.Deserialize(s) as GridModel;
+ t.Modified = false;
+ return t;
+ }
+ finally
+ {
+ AppDomain.CurrentDomain.AssemblyResolve -= new ResolveEventHandler(GridAssembly.AssemblyResolver);
+ }
+ }
+
+
+ report1.Preview = previewControl1;
+ report1.Show();
+
+
+ Report report = new Report();
+ report.Load("reportfile.frx");
+ report.RegisterData(application_dataset);
+ report.Show();
+
+
+ Report report = new Report();
+ // create the report page
+ ReportPage page = new ReportPage();
+ page.Name = "ReportPage1";
+ // set paper width and height. Note: these properties are measured in millimeters.
+ page.PaperWidth = 210;
+ page.PaperHeight = 297;
+ // add a page to the report
+ report.Pages.Add(page);
+ // create report title
+ page.ReportTitle = new ReportTitleBand();
+ page.ReportTitle.Name = "ReportTitle1";
+ page.ReportTitle.Height = Units.Millimeters * 10;
+ // create Text object and put it to the title
+ TextObject text = new TextObject();
+ text.Name = "Text1";
+ text.Bounds = new RectangleF(0, 0, Units.Millimeters * 100, Units.Millimeters * 5);
+ page.ReportTitle.Objects.Add(text);
+ // create data band
+ DataBand data = new DataBand();
+ data.Name = "Data1";
+ data.Height = Units.Millimeters * 10;
+ // add data band to a page
+ page.Bands.Add(data);
+
+
+ if (report.Prepare())
+ {
+ PrinterSettings printerSettings = null;
+ if (report.ShowPrintDialog(out printerSettings))
+ {
+ report.PrintPrepared(printerSettings);
+ }
+ }
+
+
+ if (report.Prepare())
+ {
+ PrinterSettings printerSettings = null;
+ if (report.ShowPrintDialog(out printerSettings))
+ {
+ report.PrintPrepared(printerSettings);
+ }
+ }
+
+
+ ReportPage page1 = report1.Pages[0] as ReportPage;
+
+
+ using System.Security;
+ using System.Security.Permissions;
+ ...
+ PermissionSet ps = new PermissionSet(PermissionState.None);
+ ps.AddPermission(new FileIOPermission(PermissionState.Unrestricted));
+ report1.ScriptRestrictions = ps;
+ report1.Prepare();
+
+
+ SimpleListReport report = new SimpleListReport();
+ report.RegisterData(your_dataset);
+ report.Show();
+
+
+ string employeeName = (string)report.GetColumnValue("Employees.FirstName");
+
+
+ // load the report
+ report1.Load("report.frx");
+ // setup the parameter
+ report1.SetParameterValue("MyParam", 10);
+ // show the report
+ report1.Show();
+
+ report.AddReferencedAssembly("Newtonsoft.Json.dll")
+
+ report1.Load("report.frx");
+ report1.RegisterData(dataSet1);
+
+
+ report1.Load("report.frx");
+ report1.RegisterData(dataSet1, true);
+
+
+ report1.Load("report.frx");
+ report1.RegisterData(dataSet1, "NorthWind");
+
+
+ report1.Load("report.frx");
+ report1.RegisterData(dataSet1, "NorthWind", true);
+
+
+ report1.Load("report.frx");
+ report1.RegisterData(dataSet1.Tables["Orders"], "Orders");
+
+
+ report1.Load("report.frx");
+ report1.RegisterData(myDataView, "OrdersView");
+
+
+ report1.Load("report.frx");
+ report1.RegisterData(myDataRelation, "myRelation");
+
+
+ report1.Load("report.frx");
+ report1.RegisterData(myBusinessObject, "Customers");
+
+
+ report1.Load("report.frx");
+ report1.RegisterData(myCubeLink, "Orders");
+
+
+ Report report = new Report();
+ report.Load("report1.frx");
+ report.Prepare();
+ report.Load("report2.frx");
+ report.Prepare(true);
+ report.ShowPrepared();
+
+
+ BarcodeObject barcode;
+ ...
+ barcode.Barcode = new BarcodePDF417();
+ (barcode.Barcode as BarcodePDF417).CompactionMode = CompactionMode.Text;
+
+
+ barcode.SymbologyName = "PDF417";
+ (barcode.Barcode as BarcodePDF417).CompactionMode = CompactionMode.Text;
+
+ Represents a 2D matrix of bits. In function arguments below, and throughout the common + module, x is the column position, and y is the row position. The ordering is always x, y. + The origin is at the top-left.
+Internally the bits are represented in a 1-D array of 32-bit ints. However, each row begins + with a new int. This is done intentionally so that we can copy out a row into a BitArray very + efficiently.
+The ordering of bits is row-major. Within each int, the least significant bits are used first, + meaning they represent lower x values. This is compatible with BitArray's implementation.
+Gets the requested bit, where true means black.
+ +Flips the given bit.
+ +Sets a square region of the bit matrix to true.
+ +This class contains utility methods for performing mathematical operations over + the Galois Fields. Operations use a given primitive polynomial in calculations.
+Throughout this package, elements of the GF are represented as an {@code int} + for convenience and speed (but at the cost of memory). +
+Represents a polynomial whose coefficients are elements of a GF. + Instances of this class are immutable.
+Much credit is due to William Rucklidge since portions of this code are an indirect + port of his C++ Reed-Solomon implementation.
+
+ BarcodeObject barcode;
+ ...
+ barcode.Barcode = new Barcode128();
+ (barcode.Barcode as Barcode128).AutoEncode = false;
+
+
+ BarcodeObject barcode;
+ barcode.Barcode = new Barcode128();
+ (barcode.Barcode as Barcode128).AutoEncode = false;
+ barcode.Text = "&C;1234&A;ABC";
+
+ 1.
+
+ @return the position of this MaxiCode symbol in a series of symbols using structured append
+ 1.
+
+ @return size of the series that this symbol is part of
+ | Characters | Meaning |
|---|---|
| 1-9 | Postal code data which can consist of up to 9 digits (for mode 2) or up to 6 + alphanumeric characters (for mode 3). Remaining unused characters should be + filled with the SPACE character (ASCII 32). |
| 10-12 | Three-digit country code according to ISO-3166. |
| 13-15 | Three digit service code. This depends on your parcel courier. |
+ BarcodeObject barcode;
+ ...
+ barcode.Barcode = new BarcodePDF417();
+ (barcode.Barcode as BarcodePDF417).CompactionMode = PDF417CompactionMode.Text;
+
+ Config.PreviewSettings.Exports &= ~PreviewExports.PDFExport;
+ Doing so before state is restored may not take an effect.
+
+ // register own wizard
+ RegisteredObjects.AddWizard(typeof(MyWizard), myWizBmp, "My Wizard", true);
+ // register own export filter
+ RegisteredObjects.AddExport(typeof(MyExport), "My Export");
+ // register own report object
+ RegisteredObjects.Add(typeof(MyObject), "ReportPage", myObjBmp, "My Object");
+
+
+ // register own cloud storage client
+ RegisteredObjects.AddCloud(typeof(MyCloud), "My Cloud");
+
+
+ // register own messenger
+ RegisteredObjects.AddMessenger(typeof(MyMessenger), "My Messenger");
+
+
+ // register own wizard
+ RegisteredObjects.AddWizard(typeof(MyWizard), myWizBmp, "My Wizard", true);
+
+
+ // register data connection
+ RegisteredObjects.AddConnection(typeof(MyDataConnection), "My Data Connection");
+
+
+ // register the report object
+ RegisteredObjects.Add(typeof(MyReportObject), "ReportPage", myReportObjectBmp, "My Report Object");
+ // register the dialog control
+ RegisteredObjects.Add(typeof(MyDialogControl), "DialogPage", myDialogControlBmp, "My Dialog Control");
+ // add a category and register an object inside it
+ RegisteredObjects.AddCategory("ReportPage,MyCategory", myCategoryBmp, "My Category");
+ // register another report object in MyCategory
+ RegisteredObjects.Add(typeof(MyReportObject), "ReportPage,MyCategory",
+ anotherReportObjectBmp, "Another Report Object");
+
+
+ RegisteredObjects.AddFunctionCategory("MyFuncs", "My Functions");
+
+
+ public static class MyFunctions
+ {
+ /// <summary>
+ /// Converts a specified string to uppercase.
+ /// </summary>
+ /// <param name="s">The string to convert.</param>
+ /// <returns>A string in uppercase.</returns>
+ public static string MyUpperCase(string s)
+ {
+ return s == null ? "" : s.ToUpper();
+ }
+
+ /// <summary>
+ /// Returns the larger of two 32-bit signed integers.
+ /// </summary>
+ /// <param name="val1">The first of two values to compare.</param>
+ /// <param name="val2">The second of two values to compare.</param>
+ /// <returns>Parameter val1 or val2, whichever is larger.</returns>
+ public static int MyMaximum(int val1, int val2)
+ {
+ return Math.Max(val1, val2);
+ }
+
+ /// <summary>
+ /// Returns the larger of two 64-bit signed integers.
+ /// </summary>
+ /// <param name="val1">The first of two values to compare.</param>
+ /// <param name="val2">The second of two values to compare.</param>
+ /// <returns>Parameter val1 or val2, whichever is larger.</returns>
+ public static long MyMaximum(long val1, long val2)
+ {
+ return Math.Max(val1, val2);
+ }
+ }
+
+ // register a category
+ RegisteredObjects.AddFunctionCategory("MyFuncs", "My Functions");
+
+ // obtain MethodInfo for our functions
+ Type myType = typeof(MyFunctions);
+ MethodInfo myUpperCaseFunc = myType.GetMethod("MyUpperCase");
+ MethodInfo myMaximumIntFunc = myType.GetMethod("MyMaximum", new Type[] { typeof(int), typeof(int) });
+ MethodInfo myMaximumLongFunc = myType.GetMethod("MyMaximum", new Type[] { typeof(long), typeof(long) });
+
+ // register simple function
+ RegisteredObjects.AddFunction(myUpperCaseFunc, "MyFuncs");
+
+ // register overridden functions
+ RegisteredObjects.AddFunction(myMaximumIntFunc, "MyFuncs,MyMaximum");
+ RegisteredObjects.AddFunction(myMaximumLongFunc, "MyFuncs,MyMaximum");
+
+
+ <Objects>
+ <Report Text="Report"/>
+ <Bands Text="Bands">
+ <ReportTitle Text="Report Title"/>
+ </Bands>
+ </Objects>
+
+ To get the localized "ReportTitle" value, you should pass the following ID
+ to this method: "Objects,Bands,ReportTitle".
+
+ Res.Set("Messages,SaveChanges", "My text that will appear when you close the designer");
+
+
+ <?xml version="1.0" encoding="utf-8"?>
+ <Config>
+ <Plugins>
+ <Plugin Name="c:\Program Files\MyProgram\MyPlugin.dll"/>
+ </Plugins>
+ </Config>
+
+ When you run your application and use the Report object first time, all plugins will be loaded.
+ To register objects contained in a plugin, FastReport searches for classes of type
+ AssemblyInitializerBase and instantiates them.
+
+ public class MyAssemblyInitializer : AssemblyInitializerBase
+ {
+ public MyAssemblyInitializer()
+ {
+ // register own wizard
+ RegisteredObjects.AddWizard(typeof(MyWizard), myWizBmp, "My Wizard", true);
+ // register own export filter
+ RegisteredObjects.AddExport(typeof(MyExport), "My Export");
+ // register own report object
+ RegisteredObjects.Add(typeof(MyObject), "ReportPage", myObjBmp, "My Object");
+ }
+ }
+
+
+ FastNameCreator nameCreator = new FastNameCreator(Report.AllObjects);
+ foreach (Base c in Report.AllObjects)
+ {
+ if (c.Name == "")
+ nameCreator.CreateUniqueName(c);
+ }
+
+
+ public void Deserialize(FRReader reader)
+ {
+ // read simple properties like "Text", complex properties like "Border.Lines"
+ reader.ReadProperties(this);
+
+ // moves the current reader item
+ while (reader.NextItem())
+ {
+ // read the "Styles" collection
+ if (String.Compare(reader.ItemName, "Styles", true) == 0)
+ reader.Read(Styles);
+ else if (reader.ReadChildren)
+ {
+ // if read of children is enabled, read them
+ Base obj = reader.Read();
+ if (obj != null)
+ obj.Parent = this;
+ }
+ }
+ }
+
+
+ public void Deserialize(FRReader reader)
+ {
+ // read simple properties like "Text", complex properties like "Border.Lines"
+ reader.ReadProperties(this);
+
+ // moves the current reader item
+ while (reader.NextItem())
+ {
+ // read the "Styles" collection
+ if (String.Compare(reader.ItemName, "Styles", true) == 0)
+ reader.Read(Styles);
+ else if (reader.ReadChildren)
+ {
+ // if read of children is enabled, read them
+ Base obj = reader.Read();
+ if (obj != null)
+ obj.Parent = this;
+ }
+ }
+ }
+
+
+ public void Deserialize(FRReader reader)
+ {
+ // read simple properties like "Text", complex properties like "Border.Lines"
+ reader.ReadProperties(this);
+
+ // moves the current reader item
+ while (reader.NextItem())
+ {
+ // read the "Styles" collection
+ if (String.Compare(reader.ItemName, "Styles", true) == 0)
+ reader.Read(Styles);
+ else if (reader.ReadChildren)
+ {
+ // if read of children is enabled, read them
+ Base obj = reader.Read();
+ if (obj != null)
+ obj.Parent = this;
+ }
+ }
+ }
+
+
+ public void Deserialize(FRReader reader)
+ {
+ // read simple properties like "Text", complex properties like "Border.Lines"
+ reader.ReadProperties(this);
+
+ // moves the current reader item
+ while (reader.NextItem())
+ {
+ // read the "Styles" collection
+ if (String.Compare(reader.ItemName, "Styles", true) == 0)
+ reader.Read(Styles);
+ else if (reader.ReadChildren)
+ {
+ // if read of children is enabled, read them
+ Base obj = reader.Read();
+ if (obj != null)
+ obj.Parent = this;
+ }
+ }
+ }
+
+
+ public void Serialize(FRWriter writer)
+ {
+ // get the etalon object. It will be used to write changed properties only.
+ Base c = writer.DiffObject as Base;
+
+ // write the type name
+ writer.ItemName = ClassName;
+
+ // write properties
+ if (Name != "")
+ writer.WriteStr("Name", Name);
+ if (Restrictions != c.Restrictions)
+ writer.WriteValue("Restrictions", Restrictions);
+
+ // write child objects if allowed
+ if (writer.SaveChildren)
+ {
+ foreach (Base child in ChildObjects)
+ {
+ writer.Write(child);
+ }
+ }
+ }
+
+
+ // using the Res.Get method
+ miKeepTogether = new ToolStripMenuItem(Res.Get("ComponentMenu,HeaderBand,KeepTogether"));
+ miResetPageNumber = new ToolStripMenuItem(Res.Get("ComponentMenu,HeaderBand,ResetPageNumber"));
+ miRepeatOnEveryPage = new ToolStripMenuItem(Res.Get("ComponentMenu,HeaderBand,RepeatOnEveryPage"));
+
+ // using MyRes.Get method
+ MyRes res = new MyRes("ComponentMenu,HeaderBand");
+ miKeepTogether = new ToolStripMenuItem(res.Get("KeepTogether"));
+ miResetPageNumber = new ToolStripMenuItem(res.Get("ResetPageNumber"));
+ miRepeatOnEveryPage = new ToolStripMenuItem(res.Get("RepeatOnEveryPage"));
+
+
+
+ foreach (AdvancedTextRenderer.Paragraph paragraph in renderer.Paragraphs)
+ {
+ foreach (AdvancedTextRenderer.Line line in paragraph.Lines)
+ {
+ foreach (AdvancedTextRenderer.Word word in line.Words)
+ {
+ if (renderer.HtmlTags)
+ {
+ foreach (AdvancedTextRenderer.Run run in word.Runs)
+ {
+ using (Font f = run.GetFont())
+ using (Brush b = run.GetBrush())
+ {
+ g.DrawString(run.Text, f, b, run.Left, run.Top, renderer.Format);
+ }
+ }
+ }
+ else
+ {
+ g.DrawString(word.Text, renderer.Font, renderer.Brush, word.Left, word.Top, renderer.Format);
+ }
+ }
+ }
+ }
+
+ valueInMillimeters = valueInPixels / Units.Millimeters;
+ To convert millimeters to pixels, use the following code:
+ valueInPixels = valueInMillimeters * Units.Millimeters;
+
+ Designer designer = new Designer();
+ designer.Parent = form1;
+ designer.Report = report1;
+
+
+ DesignerControl designer = new DesignerControl();
+ designer.MdiMode = true;
+ designer.ShowDialog();
+
+
+ // add an event handler that will be fired when the designer is run
+ Config.DesignerSettings.DesignerLoaded += new EventHandler(DesignerSettings_DesignerLoaded);
+
+ void DesignerSettings_DesignerLoaded(object sender, EventArgs e)
+ {
+ // override "New..." command behavior
+ (sender as Designer).cmdNew.CustomAction += new EventHandler(cmdNew_CustomAction);
+ }
+
+ void cmdNew_CustomAction(object sender, EventArgs e)
+ {
+ // show the "Label" wizard instead of standard "Add New Item" dialog
+ Designer designer = sender as Designer;
+ LabelWizard wizard = new LabelWizard();
+ wizard.Run(designer);
+ }
+
+
+ Config.DesignerSettings.DesignerLoaded += new EventHandler(DesignerSettings_DesignerLoaded);
+
+ void DesignerSettings_DesignerLoaded(object sender, EventArgs e)
+ {
+ (sender as DesignerControl).MainMenu.miFileSelectLanguage.Visible = false;
+ }
+
+
+ Config.DesignerSettings.PageAdded += new EventHandler(DesignerSettings_PageAdded);
+
+ void DesignerSettings_PageAdded(object sender, EventArgs e)
+ {
+ if (sender is ReportPage)
+ (sender as ReportPage).TopMargin = 0;
+ }
+
+
+ private void CustomOpenDialog_Handler(object sender, OpenSaveDialogEventArgs e)
+ {
+ using (OpenFileDialog dialog = new OpenFileDialog())
+ {
+ dialog.Filter = "Report files (*.frx)|*.frx";
+
+ // set e.Cancel to false if dialog was succesfully executed
+ e.Cancel = dialog.ShowDialog() != DialogResult.OK;
+ // set e.FileName to the selected file name
+ e.FileName = dialog.FileName;
+ }
+ }
+
+ private void CustomSaveDialog_Handler(object sender, OpenSaveDialogEventArgs e)
+ {
+ using (SaveFileDialog dialog = new SaveFileDialog())
+ {
+ dialog.Filter = "Report files (*.frx)|*.frx";
+ // get default file name from e.FileName
+ dialog.FileName = e.FileName;
+
+ // set e.Cancel to false if dialog was succesfully executed
+ e.Cancel = dialog.ShowDialog() != DialogResult.OK;
+ // set e.FileName to the selected file name
+ e.FileName = dialog.FileName;
+ }
+ }
+
+ private void CustomOpenReport_Handler(object sender, OpenSaveReportEventArgs e)
+ {
+ // load the report from the given e.FileName
+ e.Report.Load(e.FileName);
+ }
+
+ private void CustomSaveReport_Handler(object sender, OpenSaveReportEventArgs e)
+ {
+ // save the report to the given e.FileName
+ e.Report.Save(e.FileName);
+ }
+
+
+ private void CustomOpenDialog_Handler(object sender, OpenSaveDialogEventArgs e)
+ {
+ using (OpenFileDialog dialog = new OpenFileDialog())
+ {
+ dialog.Filter = "Report files (*.frx)|*.frx";
+
+ // set e.Cancel to false if dialog was succesfully executed
+ e.Cancel = dialog.ShowDialog() != DialogResult.OK;
+ // set e.FileName to the selected file name
+ e.FileName = dialog.FileName;
+ }
+ }
+
+ private void CustomSaveDialog_Handler(object sender, OpenSaveDialogEventArgs e)
+ {
+ using (SaveFileDialog dialog = new SaveFileDialog())
+ {
+ dialog.Filter = "Report files (*.frx)|*.frx";
+ // get default file name from e.FileName
+ dialog.FileName = e.FileName;
+
+ // set e.Cancel to false if dialog was succesfully executed
+ e.Cancel = dialog.ShowDialog() != DialogResult.OK;
+ // set e.FileName to the selected file name
+ e.FileName = dialog.FileName;
+ }
+ }
+
+ private void CustomOpenReport_Handler(object sender, OpenSaveReportEventArgs e)
+ {
+ // load the report from the given e.FileName
+ e.Report.Load(e.FileName);
+ }
+
+ private void CustomSaveReport_Handler(object sender, OpenSaveReportEventArgs e)
+ {
+ // save the report to the given e.FileName
+ e.Report.Save(e.FileName);
+ }
+
+
+ private void CustomOpenDialog_Handler(object sender, OpenSaveDialogEventArgs e)
+ {
+ using (OpenFileDialog dialog = new OpenFileDialog())
+ {
+ dialog.Filter = "Report files (*.frx)|*.frx";
+
+ // set e.Cancel to false if dialog was succesfully executed
+ e.Cancel = dialog.ShowDialog() != DialogResult.OK;
+ // set e.FileName to the selected file name
+ e.FileName = dialog.FileName;
+ }
+ }
+
+ private void CustomSaveDialog_Handler(object sender, OpenSaveDialogEventArgs e)
+ {
+ using (SaveFileDialog dialog = new SaveFileDialog())
+ {
+ dialog.Filter = "Report files (*.frx)|*.frx";
+ // get default file name from e.FileName
+ dialog.FileName = e.FileName;
+
+ // set e.Cancel to false if dialog was succesfully executed
+ e.Cancel = dialog.ShowDialog() != DialogResult.OK;
+ // set e.FileName to the selected file name
+ e.FileName = dialog.FileName;
+ }
+ }
+
+ private void CustomOpenReport_Handler(object sender, OpenSaveReportEventArgs e)
+ {
+ // load the report from the given e.FileName
+ e.Report.Load(e.FileName);
+ }
+
+ private void CustomSaveReport_Handler(object sender, OpenSaveReportEventArgs e)
+ {
+ // save the report to the given e.FileName
+ e.Report.Save(e.FileName);
+ }
+
+
+ private void CustomOpenDialog_Handler(object sender, OpenSaveDialogEventArgs e)
+ {
+ using (OpenFileDialog dialog = new OpenFileDialog())
+ {
+ dialog.Filter = "Report files (*.frx)|*.frx";
+
+ // set e.Cancel to false if dialog was succesfully executed
+ e.Cancel = dialog.ShowDialog() != DialogResult.OK;
+ // set e.FileName to the selected file name
+ e.FileName = dialog.FileName;
+ }
+ }
+
+ private void CustomSaveDialog_Handler(object sender, OpenSaveDialogEventArgs e)
+ {
+ using (SaveFileDialog dialog = new SaveFileDialog())
+ {
+ dialog.Filter = "Report files (*.frx)|*.frx";
+ // get default file name from e.FileName
+ dialog.FileName = e.FileName;
+
+ // set e.Cancel to false if dialog was succesfully executed
+ e.Cancel = dialog.ShowDialog() != DialogResult.OK;
+ // set e.FileName to the selected file name
+ e.FileName = dialog.FileName;
+ }
+ }
+
+ private void CustomOpenReport_Handler(object sender, OpenSaveReportEventArgs e)
+ {
+ // load the report from the given e.FileName
+ e.Report.Load(e.FileName);
+ }
+
+ private void CustomSaveReport_Handler(object sender, OpenSaveReportEventArgs e)
+ {
+ // save the report to the given e.FileName
+ e.Report.Save(e.FileName);
+ }
+
+
+ Config.DesignerSettings.CustomPreviewReport += new EventHandler(MyPreviewHandler);
+
+ private void MyPreviewHandler(object sender, EventArgs e)
+ {
+ Report report = sender as Report;
+ using (MyPreviewForm form = new MyPreviewForm())
+ {
+ report.Preview = form.previewControl1;
+ report.ShowPreparedReport();
+ form.ShowDialog();
+ }
+ }
+
+
+ Config.DesignerSettings.FilterConnectionTables += DesignerSettings_FilterConnectionTables;
+
+ private void DesignerSettings_FilterConnectionTables(object sender, FilterConnectionTablesEventArgs e)
+ {
+ if (e.TableName == "Table 1")
+ e.Skip = true;
+ }
+
+
+ Config.DesignerSettings.AddCustomConnection(typeof(MsAccessDataConnection), @"Data Source=c:\data.mdb");
+
+
+ public void SaveState()
+ {
+ XmlItem xi = Config.Root.FindItem("Designer").FindItem(Name);
+ xi.SetProp("ShowGrid", DialogWorkspace.ShowGrid ? "1" : "0");
+ }
+
+
+ public void RestoreState()
+ {
+ XmlItem xi = Config.Root.FindItem("Designer").FindItem(Name);
+ DialogWorkspace.ShowGrid = xi.GetProp("ShowGrid") != "0";
+ }
+
+
+ DesignerPlugins.Add(typeof(MyToolbar));
+
+
+ MessagesWindow window = designer.Plugins.Find("MessagesWindow") as MessagesWindow;
+
+
+ MessagesWindow window = designer.Plugins.FindType("MessagesWindow") as MessagesWindow;
+
+
+ DesignerPlugins.Add(typeof(MyToolbar));
+
+
+ Designer designer;
+ MessagesWindow window = designer.Plugins.FindType("MessagesWindow") as MessagesWindow;
+
+
+ DesignerPlugins.Add(typeof(MyToolWindow));
+
+
+ Designer designer;
+ DesignerMenu menu = designer.Plugins.FindType("DesignerMenu") as DesignerMenu;
+
+
+ // create an instance of AdvMatrixObject
+ AdvMatrixObject matrix = new AdvMatrixObject();
+ matrix.Name = "Matrix1";
+ // add it to the report title band of the first report page
+ matrix.Parent = (Report.Pages[0] as ReportPage).ReportTitle;
+
+ // create two nested column descriptors and a total
+ HeaderDescriptor column = new HeaderDescriptor("[MatrixDemo.Year]");
+ matrix.Data.Columns.Descriptor.Add(column);
+ HeaderDescriptor nestedColumn = new HeaderDescriptor("[MatrixDemo.Month]");
+ column.Add(nestedColumn);
+ HeaderDescriptor columnTotal = new HeaderDescriptor();
+ columnTotal.DisplayText = "Total";
+ matrix.Data.Columns.Descriptor.Add(columnTotal);
+
+ // create one row descriptor and a total
+ HeaderDescriptor row = new HeaderDescriptor("[MatrixDemo.Name]");
+ matrix.Data.Rows.Descriptor.Add(row);
+ HeaderDescriptor rowTotal = new HeaderDescriptor();
+ rowTotal.DisplayText = "Total";
+ matrix.Data.Rows.Descriptor.Add(rowTotal);
+
+ // connect matrix to a datasource
+ matrix.DataSource = Report.GetDataSource("MatrixDemo");
+
+ // create the matrix template
+ matrix.BuildTemplate();
+
+ // change the style
+ matrix.Style = "Gray";
+
+ // create data cells
+ string cellText = "[Sum([MatrixDemo.Revenue])]";
+ for (int i = matrix.Data.Rows.Size; i < matrix.ColumnCount; i++)
+ for (int j = matrix.Data.Columns.Size; j < matrix.RowCount; j++)
+ matrix[i, j].Text = cellText;
+
+
+ EmailExport export = new EmailExport();
+ export.Account.Address = "my@address.net";
+ export.Account.Host = "myhost";
+ export.Address = "recipient@address.net";
+ export.Subject = "Re: analysis report";
+ // the report1 report must be prepared at this moment
+ export.SendEmail(report1);
+
+ TextExport.Encoding = Encoding.Default;
+ Unicode UTF-8 encoding
+ TextExport.Encoding = Encoding.UTF8;
+ OEM encoding for current system locale sessings
+ TextExport.Encoding = Encoding.GetEncoding(CultureInfo.CurrentCulture.TextInfo.OEMCodePage);
+
+ TextExportPrint.PrintStream("EPSON FX-1000", "My Report", 1, txtStream)
+ inches = pixels / SizeUnitsP.Inch;
+ To convert inches to pixels, use the code:
+ pixels = inches * SizeUnitsP.Inch;
+ inches = millimeters / SizeUnitsM.Inch;
+ To convert inches to millimeters, use the code:
+ millimeters = inches * SizeUnitsM.Inch;
+
+ Report report1;
+ XmlDataConnection conn = new XmlDataConnection();
+ conn.XmlFile = @"c:\data.xml";
+ report1.Dictionary.Connections.Add(conn);
+ conn.CreateAllTables();
+
+
+ Report report1;
+ DataConnectionBase conn = report1.Dictionary.Connections.FindByName("Connection1");
+ TableDataSource table = new TableDataSource();
+ table.TableName = "Employees";
+ table.Name = "Table1";
+ conn.Tables.Add(table);
+
+
+ TableDataSource ds = report.GetDataSource("My DataSource Name") as TableDataSource;
+ ds.Parameters[0].Value = 10;
+
+ This way is not good because you hardcode the report object's name.
+
+ Report report1;
+ DataSourceBase customersTable = report1.Dictionary.DataSources.FindByAlias("Customers");
+ DataSourceBase ordersTable = report1.Dictionary.DataSources.FindByAlias("Orders");
+ Relation rel = new Relation();
+ rel.Name = "customersOrders";
+ rel.ParentDataSource = customersTable;
+ rel.ChildDataSource = ordersTable;
+ rel.ParentColumns = new string[] { "CustomerID" };
+ rel.ChildColumns = new string[] { "CustomerID" };
+ report1.Dictionary.Relations.Add(rel);
+
+
+ Report report1;
+ OleDbDataConnection conn = new OleDbDataConnection();
+ conn.ConnectionString = "your_connection_string";
+ report1.Dictionary.Connections.Add(conn);
+ conn.CreateAllTables();
+
+
+ Report report1;
+ OdbcDataConnection conn = new OdbcDataConnection();
+ conn.ConnectionString = "your_connection_string";
+ report1.Dictionary.Connections.Add(conn);
+ conn.CreateAllTables();
+
+
+ Report report1;
+ MsSqlDataConnection conn = new MsSqlDataConnection();
+ conn.ConnectionString = "your_connection_string";
+ report1.Dictionary.Connections.Add(conn);
+ conn.CreateAllTables();
+
+
+ Report report1;
+ MsAccessDataConnection conn = new MsAccessDataConnection();
+ conn.DataSource = @"c:\data.mdb";
+ report1.Dictionary.Connections.Add(conn);
+ conn.CreateAllTables();
+
+
+ Report report1;
+ MsAccessDataConnection conn = new MsAccessDataConnection();
+ conn.DataSource = @"c:\data.mdb";
+ report1.Dictionary.Connections.Add(conn);
+ conn.CreateAllTables();
+
+
+ OleDbConnectionStringBuilder builder = new OleDbConnectionStringBuilder(oleDbConnection1.ConnectionString);
+ builder.PersistSecurityInfo = false;
+ oleDbConnection1.ConnectionString = builder.ToString();
+
+
+ public override Type GetConnectionType()
+ {
+ return typeof(OleDbConnection);
+ }
+
+
+ public override DbDataAdapter GetAdapter(string selectCommand, DbConnection connection,
+ CommandParameterCollection parameters)
+ {
+ OleDbDataAdapter adapter = new OleDbDataAdapter(selectCommand, connection as OleDbConnection);
+ foreach (CommandParameter p in parameters)
+ {
+ OleDbParameter parameter = adapter.SelectCommand.Parameters.Add(p.Name, (OleDbType)p.DataType, p.Size);
+ parameter.Value = p.Value;
+ }
+ return adapter;
+ }
+
+
+ Report report1;
+ CsvDataConnection conn = new CsvDataConnection();
+ conn.CsvFile = @"c:\data.csv";
+ report1.Dictionary.Connections.Add(conn);
+ conn.CreateAllTables();
+
+
+ dataSource.Init();
+ while (dataSource.HasMoreRows)
+ {
+ // do something...
+ dataSource.Next();
+ }
+
+
+ Report report1;
+ Parameter par = new Parameter();
+ par.Name = report1.Dictionary.CreateUniqueName("Parameter");
+ report1.Parameters.Add(par);
+
+
+ Report report1;
+ DataConnectionBase conn = report1.Dictionary.Connections.FindByName("Connection1");
+ TableDataSource table = new TableDataSource();
+ table.TableName = "Employees";
+ table.Name = report1.Dictionary.CreateUniqueName("EmployeesTable");
+ table.Alias = report1.Dictionary.CreateUniqueAlias("Employees");
+ conn.Tables.Add(table);
+
+
+ private void report1_DatabaseLogin(object sender, DatabaseLoginEventArgs e)
+ {
+ using (MyLoginDialog dialog = new MyLoginDialog())
+ {
+ if (dialog.ShowDialog() == DialogResult.OK)
+ {
+ e.UserName = dialog.UserName;
+ e.Password = dialog.Password;
+ }
+ }
+ }
+
+
+ private void report1_DatabaseLogin(object sender, DatabaseLoginEventArgs e)
+ {
+ e.ConnectionString = my_connection_string;
+ }
+
+
+ RegisteredObjects.Add(typeof(ShapeObject), "ReportPage,Shapes", 108, "Objects,Shapes,Rectangle", 0);
+ RegisteredObjects.Add(typeof(ShapeObject), "ReportPage,Shapes", 109, "Objects,Shapes,RoundRectangle", 1);
+ RegisteredObjects.Add(typeof(ShapeObject), "ReportPage,Shapes", 110, "Objects,Shapes,Ellipse", 2);
+
+
+ public override void OnBeforeInsert(int flags)
+ {
+ FShape = (ShapeKind)flags;
+ }
+
+
+ TextObject text1 = report1.FindObject("Text1") as TextObject;
+
+
+ Report report1;
+ ReportPage page = new ReportPage();
+ page.Parent = report1;
+
+ public DataHeaderBand Header
+ {
+ get { return FHeader; }
+ set
+ {
+ SetProp(FHeader, value);
+ FHeader = value;
+ }
+ }
+
+ <TextObject Name="Text2" Left="18.9" Top="37.8" Width="283.5" Height="28.35"/>
+
+
+ <DataBand Name="Data1" Top="163" Width="718.2" Height="18.9">
+ <TextObject Name="Text3" Left="18.9" Top="37.8" Width="283.5" Height="28.35"/>
+ </DataBand>
+
+
+ protected override void DeserializeSubItems(FRReader reader)
+ {
+ if (String.Compare(reader.ItemName, "Styles", true) == 0)
+ reader.Read(Styles);
+ else
+ base.DeserializeSubItems(reader);
+ }
+
+
+ TextObject text1 = report1.FindObject("Text1") as TextObject;
+ if (text1 != null)
+ {
+ // object found
+ }
+
+
+ TextObject textObj = new TextObject();
+ dataBand1.Objects.Add(textObj);
+ textObj.CreateUniqueName();
+
+
+ Report report1;
+ Report report2 = new Report();
+ // copy all report settings, do not copy report objects
+ report2.Assign(report1);
+
+ Report report1;
+ Report report2 = new Report();
+ // copy all report settings and objects
+ report2.AssignAll(report1);
+
+ public void OnBeforePrint(EventArgs e)
+ {
+ if (BeforePrint != null)
+ BeforePrint(this, e);
+ InvokeEvent(BeforePrintEvent, e);
+ }
+
+ TextObject text1;
+ // set Height to 10mm
+ text1.Height = Units.Millimeters * 10;
+ // convert a value to millimeters
+ MessageBox.Show("Height = " + (text1.Height / Units.Millimeters).ToString() + "mm");
+
+ TextObject text1;
+ // set Left to 10mm
+ text1.Left = Units.Millimeters * 10;
+ // convert a value to millimeters
+ MessageBox.Show("Left = " + (text1.Left / Units.Millimeters).ToString() + "mm");
+
+ TextObject text1;
+ // set Top to 10mm
+ text1.Top = Units.Millimeters * 10;
+ // convert a value to millimeters
+ MessageBox.Show("Top = " + (text1.Top / Units.Millimeters).ToString() + "mm");
+
+ private void Data1_BeforePrint(object sender, EventArgs e)
+ {
+ Text1.Visible = [Orders.Shipped] == true;
+ }
+
+ TextObject text1;
+ // set Width to 10mm
+ text1.Width = Units.Millimeters * 10;
+ // convert a value to millimeters
+ MessageBox.Show("Width = " + (text1.Width / Units.Millimeters).ToString() + "mm");
+
+ private void report1_DatabaseLogin(object sender, DatabaseLoginEventArgs e)
+ {
+ using (MyLoginDialog dialog = new MyLoginDialog())
+ {
+ if (dialog.ShowDialog() == DialogResult.OK)
+ {
+ e.UserName = dialog.UserName;
+ e.Password = dialog.Password;
+ }
+ }
+ }
+
+
+ private void report1_DatabaseLogin(object sender, DatabaseLoginEventArgs e)
+ {
+ e.ConnectionString = my_connection_string;
+ }
+
+
+ environmentSettings1.DesignerLoaded += new EventHandler(DesignerSettings_DesignerLoaded);
+
+ void DesignerSettings_DesignerLoaded(object sender, EventArgs e)
+ {
+ (sender as DesignerControl).MainMenu.miFileSelectLanguage.Visible = false;
+ }
+
+
+ private void CustomOpenDialog_Handler(object sender, OpenSaveDialogEventArgs e)
+ {
+ using (OpenFileDialog dialog = new OpenFileDialog())
+ {
+ dialog.Filter = "Report files (*.frx)|*.frx";
+
+ // set e.Cancel to false if dialog was succesfully executed
+ e.Cancel = dialog.ShowDialog() != DialogResult.OK;
+ // set e.FileName to the selected file name
+ e.FileName = dialog.FileName;
+ }
+ }
+
+ private void CustomSaveDialog_Handler(object sender, OpenSaveDialogEventArgs e)
+ {
+ using (SaveFileDialog dialog = new SaveFileDialog())
+ {
+ dialog.Filter = "Report files (*.frx)|*.frx";
+ // get default file name from e.FileName
+ dialog.FileName = e.FileName;
+
+ // set e.Cancel to false if dialog was succesfully executed
+ e.Cancel = dialog.ShowDialog() != DialogResult.OK;
+ // set e.FileName to the selected file name
+ e.FileName = dialog.FileName;
+ }
+ }
+
+ private void CustomOpenReport_Handler(object sender, OpenSaveReportEventArgs e)
+ {
+ // load the report from the given e.FileName
+ e.Report.Load(e.FileName);
+ }
+
+ private void CustomSaveReport_Handler(object sender, OpenSaveReportEventArgs e)
+ {
+ // save the report to the given e.FileName
+ e.Report.Save(e.FileName);
+ }
+
+
+ private void CustomOpenDialog_Handler(object sender, OpenSaveDialogEventArgs e)
+ {
+ using (OpenFileDialog dialog = new OpenFileDialog())
+ {
+ dialog.Filter = "Report files (*.frx)|*.frx";
+
+ // set e.Cancel to false if dialog was succesfully executed
+ e.Cancel = dialog.ShowDialog() != DialogResult.OK;
+ // set e.FileName to the selected file name
+ e.FileName = dialog.FileName;
+ }
+ }
+
+ private void CustomSaveDialog_Handler(object sender, OpenSaveDialogEventArgs e)
+ {
+ using (SaveFileDialog dialog = new SaveFileDialog())
+ {
+ dialog.Filter = "Report files (*.frx)|*.frx";
+ // get default file name from e.FileName
+ dialog.FileName = e.FileName;
+
+ // set e.Cancel to false if dialog was succesfully executed
+ e.Cancel = dialog.ShowDialog() != DialogResult.OK;
+ // set e.FileName to the selected file name
+ e.FileName = dialog.FileName;
+ }
+ }
+
+ private void CustomOpenReport_Handler(object sender, OpenSaveReportEventArgs e)
+ {
+ // load the report from the given e.FileName
+ e.Report.Load(e.FileName);
+ }
+
+ private void CustomSaveReport_Handler(object sender, OpenSaveReportEventArgs e)
+ {
+ // save the report to the given e.FileName
+ e.Report.Save(e.FileName);
+ }
+
+
+ private void CustomOpenDialog_Handler(object sender, OpenSaveDialogEventArgs e)
+ {
+ using (OpenFileDialog dialog = new OpenFileDialog())
+ {
+ dialog.Filter = "Report files (*.frx)|*.frx";
+
+ // set e.Cancel to false if dialog was succesfully executed
+ e.Cancel = dialog.ShowDialog() != DialogResult.OK;
+ // set e.FileName to the selected file name
+ e.FileName = dialog.FileName;
+ }
+ }
+
+ private void CustomSaveDialog_Handler(object sender, OpenSaveDialogEventArgs e)
+ {
+ using (SaveFileDialog dialog = new SaveFileDialog())
+ {
+ dialog.Filter = "Report files (*.frx)|*.frx";
+ // get default file name from e.FileName
+ dialog.FileName = e.FileName;
+
+ // set e.Cancel to false if dialog was succesfully executed
+ e.Cancel = dialog.ShowDialog() != DialogResult.OK;
+ // set e.FileName to the selected file name
+ e.FileName = dialog.FileName;
+ }
+ }
+
+ private void CustomOpenReport_Handler(object sender, OpenSaveReportEventArgs e)
+ {
+ // load the report from the given e.FileName
+ e.Report.Load(e.FileName);
+ }
+
+ private void CustomSaveReport_Handler(object sender, OpenSaveReportEventArgs e)
+ {
+ // save the report to the given e.FileName
+ e.Report.Save(e.FileName);
+ }
+
+
+ private void CustomOpenDialog_Handler(object sender, OpenSaveDialogEventArgs e)
+ {
+ using (OpenFileDialog dialog = new OpenFileDialog())
+ {
+ dialog.Filter = "Report files (*.frx)|*.frx";
+
+ // set e.Cancel to false if dialog was succesfully executed
+ e.Cancel = dialog.ShowDialog() != DialogResult.OK;
+ // set e.FileName to the selected file name
+ e.FileName = dialog.FileName;
+ }
+ }
+
+ private void CustomSaveDialog_Handler(object sender, OpenSaveDialogEventArgs e)
+ {
+ using (SaveFileDialog dialog = new SaveFileDialog())
+ {
+ dialog.Filter = "Report files (*.frx)|*.frx";
+ // get default file name from e.FileName
+ dialog.FileName = e.FileName;
+
+ // set e.Cancel to false if dialog was succesfully executed
+ e.Cancel = dialog.ShowDialog() != DialogResult.OK;
+ // set e.FileName to the selected file name
+ e.FileName = dialog.FileName;
+ }
+ }
+
+ private void CustomOpenReport_Handler(object sender, OpenSaveReportEventArgs e)
+ {
+ // load the report from the given e.FileName
+ e.Report.Load(e.FileName);
+ }
+
+ private void CustomSaveReport_Handler(object sender, OpenSaveReportEventArgs e)
+ {
+ // save the report to the given e.FileName
+ e.Report.Save(e.FileName);
+ }
+
+
+ environmentSettings1.CustomPreviewReport += new EventHandler(MyPreviewHandler);
+
+ private void MyPreviewHandler(object sender, EventArgs e)
+ {
+ Report report = sender as Report;
+ using (MyPreviewForm form = new MyPreviewForm())
+ {
+ report.Preview = form.previewControl1;
+ report.ShowPreparedReport();
+ form.ShowDialog();
+ }
+ }
+
+
+ environmentSettings1.FilterConnectionTables += DesignerSettings_FilterConnectionTables;
+
+ private void DesignerSettings_FilterConnectionTables(object sender, FilterConnectionTablesEventArgs e)
+ {
+ if (e.TableName == "Table 1")
+ e.Skip = true;
+ }
+
+
+ ReportPage page = report.Pages[0] as ReportPage;
+
+ // create the main group
+ GroupHeaderBand mainGroup = new GroupHeaderBand();
+ mainGroup.Height = Units.Millimeters * 10;
+ mainGroup.Name = "MainGroup";
+ mainGroup.Condition = "[Orders.CustomerName]";
+ // add a group to the page
+ page.Bands.Add(mainGroup);
+
+ // create the nested group
+ GroupHeaderBand nestedGroup = new GroupHeaderBand();
+ nestedGroup.Height = Units.Millimeters * 10;
+ nestedGroup.Name = "NestedGroup";
+ nestedGroup.Condition = "[Orders.OrderDate]";
+ // add it to the main group
+ mainGroup.NestedGroup = nestedGroup;
+
+ // create a data band
+ DataBand dataBand = new DataBand();
+ dataBand.Height = Units.Millimeters * 10;
+ dataBand.Name = "GroupData";
+ dataBand.DataSource = report.GetDataSource("Orders");
+ // connect the databand to the nested group
+ nestedGroup.Data = dataBand;
+
+
+ ReportPage page;
+ GroupHeaderBand group = new GroupHeaderBand();
+ group.NestedGroup = new GroupHeaderBand();
+ group.NestedGroup.Data = new DataBand();
+ page.Bands.Add(group);
+
+
+ ReportPage page;
+ GroupHeaderBand group = new GroupHeaderBand();
+ group.Data = new DataBand();
+ page.Bands.Add(group);
+
+
+ myPictureObject.Image = new Bitmap("file.bmp");
+ myPictureObject.ShouldDisposeImage = true;
+
+
+ Config.PreviewSettings.Buttons = PreviewButtons.Open |
+ PreviewButtons.Save |
+ PreviewButtons.Find |
+ PreviewButtons.Zoom |
+ PreviewButtons.Outline |
+ PreviewButtons.PageSetup |
+ PreviewButtons.Edit |
+ PreviewButtons.Watermark |
+ PreviewButtons.Navigator |
+ PreviewButtons.Close;
+
+
+ textObject1.Fill = new SolidFill(Color.Green);
+ (textObject1.Fill as SolidFill).Color = Color.Red;
+
+ reportComponent1.Fill = new SolidFill(color);
+
+ ReportPage page = new ReportPage();
+ // set the paper in millimeters
+ page.PaperWidth = 210;
+ page.PaperHeight = 297;
+ // create report title
+ page.ReportTitle = new ReportTitleBand();
+ page.ReportTitle.Name = "ReportTitle1";
+ page.ReportTitle.Height = Units.Millimeters * 10;
+ // create data band
+ DataBand data = new DataBand();
+ data.Name = "Data1";
+ data.Height = Units.Millimeters * 10;
+ // add data band to the page
+ page.Bands.Add(data);
+ // add page to the report
+ report.Pages.Add(page);
+
+
+ // create the main report page
+ ReportPage reportPage = new ReportPage();
+ reportPage.Name = "Page1";
+ report.Pages.Add(reportPage);
+ // create report title band
+ reportPage.ReportTitle = new ReportTitleBand();
+ reportPage.ReportTitle.Name = "ReportTitle1";
+ reportPage.ReportTitle.Height = Units.Millimeters * 10;
+ // add subreport on it
+ SubreportObject subreport = new SubreportObject();
+ subreport.Name = "Subreport1";
+ subreport.Bounds = new RectangleF(0, 0, Units.Millimeters * 25, Units.Millimeters * 5);
+ reportPage.ReportTitle.Objects.Add(subreport);
+ // create subreport page
+ ReportPage subreportPage = new ReportPage();
+ subreportPage.Name = "SubreportPage1";
+ report.Pages.Add(subreportPage);
+ // connect the subreport to the subreport page
+ subreport.ReportPage = subreportPage;
+
+
+ text1.TextFill = new HatchFill(Color.Black, Color.White, HatchStyle.Cross);
+
+ Use the textObject1.TextFill = new SolidFill(color);
+
+ TextObject text1;
+ HighlightCondition highlight = new HighlightCondition();
+ highlight.Expression = "Value < 0";
+ highlight.Fill = new SolidFill(Color.Red);
+ highlight.ApplyFill = true;
+ text1.Highlight.Add(highlight);
+
+
+ TextObject text1;
+ text1.Format = new CurrencyFormat();
+
+
+ text1.Formats.Clear();
+ text1.Formats.Add(new DateFormat());
+ text1.Formats.Add(new NumberFormat());
+
+
+ protected override void Done()
+ {
+ base.Done();
+ ImageExport imageExport = Export as ImageExport;
+ imageExport.ImageFormat = (ImageExportFormat)cbxImageFormat.SelectedIndex;
+ imageExport.Resolution = (int)udResolution.Value;
+ imageExport.JpegQuality = (int)udQuality.Value;
+ imageExport.SeparateFiles = cbSeparateFiles.Checked;
+ }
+
+
+ public override void Init(ExportBase export)
+ {
+ base.Init(export);
+ ImageExport imageExport = Export as ImageExport;
+ cbxImageFormat.SelectedIndex = (int)imageExport.ImageFormat;
+ udResolution.Value = imageExport.Resolution;
+ udQuality.Value = imageExport.JpegQuality;
+ cbSeparateFiles.Checked = imageExport.SeparateFiles;
+ }
+
+
+ public DialogPageOptions(DialogPageDesigner pd) : base()
+ {
+ FPageDesigner = pd;
+ InitializeComponent();
+ }
+
+
+ CrossViewObject crossView;
+ // change the fill color of the first matrix cell
+ crossView.Data.Cells[0].TemplateCell.Fill = new SolidFill(Color.Red);
+
+
+ DialogPage form = new DialogPage();
+ // set the width and height in pixels
+ form.Width = 200;
+ form.Height = 200;
+ form.Name = "Form1";
+ // create a button
+ ButtonControl button = new ButtonControl();
+ button.Location = new Point(20, 20);
+ button.Size = new Size(75, 25);
+ button.Text = "The button";
+ // add the button to the form
+ form.Controls.Add(button);
+
+
+ protected override void AttachEvents()
+ {
+ base.AttachEvents();
+ CheckBox.CheckedChanged += new EventHandler(CheckBox_CheckedChanged);
+ }
+
+ private void CheckBox_CheckedChanged(object sender, EventArgs e)
+ {
+ if (CheckedChanged != null)
+ CheckedChanged(this, e);
+ InvokeEvent(CheckedChangedEvent, e);
+ }
+
+
+ protected override void DetachEvents()
+ {
+ base.DetachEvents();
+ CheckBox.CheckedChanged -= new EventHandler(CheckBox_CheckedChanged);
+ }
+
+
+ protected override void FillData(DataSourceBase dataSource, Column column)
+ {
+ Items.Clear();
+ dataSource.First();
+ while (dataSource.HasMoreRows)
+ {
+ Items.Add(dataSource[column].ToString());
+ dataSource.Next();
+ }
+ }
+
+
+ // create an instance of MatrixObject
+ MatrixObject matrix = new MatrixObject();
+ matrix.Name = "Matrix1";
+ // add it to the report title band of the first report page
+ matrix.Parent = (report.Pages[0] as ReportPage).ReportTitle;
+
+ // create two column descriptors
+ MatrixHeaderDescriptor column = new MatrixHeaderDescriptor("[MatrixDemo.Year]");
+ matrix.Data.Columns.Add(column);
+ column = new MatrixHeaderDescriptor("[MatrixDemo.Month]");
+ matrix.Data.Columns.Add(column);
+
+ // create one row descriptor
+ MatrixHeaderDescriptor row = new MatrixHeaderDescriptor("[MatrixDemo.Name]");
+ matrix.Data.Rows.Add(row);
+
+ // create one data cell
+ MatrixCellDescriptor cell = new MatrixCellDescriptor("[MatrixDemo.Revenue]", MatrixAggregateFunction.Sum);
+ matrix.Data.Cells.Add(cell);
+
+ // connect matrix to a datasource
+ matrix.DataSource = Report.GetDataSource("MatrixDemo");
+
+ // create the matrix template
+ matrix.BuildTemplate();
+
+ // change the style
+ matrix.Style = "Green";
+
+ // change the column and row total's text to "Grand Total"
+ matrix.Data.Columns[0].TemplateTotalCell.Text = "Grand Total";
+ matrix.Data.Rows[0].TemplateTotalCell.Text = "Grand Total";
+
+
+ // suppose we have a matrix with one column, row and data cell.
+ // provide 3 one-dimensional arrays with one element in each to the AddValue method
+ Matrix1.Data.AddValue(
+ new object[] { 1996 },
+ new object[] { "Andrew Fuller" },
+ new object[] { 123.45f });
+ Matrix1.Data.AddValue(
+ new object[] { 1997 },
+ new object[] { "Andrew Fuller" },
+ new object[] { 21.35f });
+ Matrix1.Data.AddValue(
+ new object[] { 1997 },
+ new object[] { "Nancy Davolio" },
+ new object[] { 421.5f });
+
+ // this code will produce the following matrix:
+ // | 1996 | 1997 |
+ // --------------+--------+--------+
+ // Andrew Fuller | 123.45| 21.35|
+ // --------------+--------+--------+
+ // Nancy Davolio | | 421.50|
+ // --------------+--------+--------+
+
+
+ MatrixObject matrix;
+ matrix.Data.AddValue(
+ new object[] { 1996 },
+ new object[] { "Andrew Fuller" },
+ new object[] { 123.45f });
+
+ // this will produce the following result:
+ // | 1996 |
+ // --------------+----------+
+ // Andrew Fuller | 123.45|
+ // --------------+----------+
+
+
+ MatrixObject matrix;
+ // change the fill color of the first matrix cell
+ matrix.Data.Cells[0].TemplateCell.Fill = new SolidFill(Color.Red);
+
+
+ MatrixObject matrix;
+ matrix.Data.Rows[0].TemplateTotalCell.Text = "Grand Total";
+
+
+ MatrixObject matrix;
+ matrix.Data.Rows[0].TemplateTotalCell.Text = "Grand Total";
+ matrix.Data.Rows[0].TemplateTotalCell.Fill = new SolidFill(Color.Green);
+
+
+ report.Load("...");
+ MSChartObject reportChart = report.FindObject("MSChart1") as MSChartObject;
+ reportChart.AssignChart(applicationChart);
+ report.Show();
+
+
+ // print table header (the first row)
+ Table1.PrintRow(0);
+ Table1.PrintColumns();
+ // print table body (the second row)
+ for (int i = 0; i < 10; i++)
+ {
+ Table1.PrintRow(1);
+ Table1.PrintColumns();
+ }
+ // print table footer (the third row)
+ Table1.PrintRow(2);
+ Table1.PrintColumns();
+
+
+
+ // print table header (the first column)
+ Table1.PrintColumn(0);
+ Table1.PrintRows();
+ // print table body (the second column)
+ for (int i = 0; i < 10; i++)
+ {
+ Table1.PrintColumn(1);
+ Table1.PrintRows();
+ }
+ // print table footer (the third column)
+ Table1.PrintColumn(2);
+ Table1.PrintRows();
+
+
+
+ // print the first row with all its columns
+ Table1.PrintRow(0);
+ // print header column
+ Table1.PrintColumn(0);
+ // print 10 data columns
+ for (int i = 0; i < 10; i++)
+ {
+ Table1.PrintColumn(1);
+ }
+ // print footer column
+ Table1.PrintColumn(2);
+
+ // print table body (the second row)
+ for (int i = 0; i < 10; i++)
+ {
+ // print data row with all its columns
+ Table1.PrintRow(1);
+ Table1.PrintColumn(0);
+ for (int j = 0; j < 10; j++)
+ {
+ Table1.PrintColumn(1);
+ }
+ Table1.PrintColumn(2);
+ }
+
+ // print table footer (the third row)
+ Table1.PrintRow(2);
+ // again print all columns in the table footer
+ Table1.PrintColumn(0);
+ for (int i = 0; i < 10; i++)
+ {
+ Table1.PrintColumn(1);
+ }
+ Table1.PrintColumn(2);
+
+
+ TableCell cell1;
+ PictureObject picture1 = new PictureObject();
+ picture1.Bounds = new RectangleF(0, 0, 32, 32);
+ picture1.Name = "Picture1";
+ cell1.Objects.Add(picture1);
+
+
+ // right-align the table
+ Table1.ResultTable.Left = Engine.PageWidth - Table1.ResultTable.CalcWidth() - 1;
+
+
+ public void Draw(FRPaintEventArgs e)
+ {
+ Brush brush = e.Cache.GetBrush(BackColor);
+ Pen pen = e.Cache.GetPen(BorderColor, 1, BorderStyle);
+ e.Graphics.FillRectangle(brush, Bounds);
+ e.Graphics.DrawRectangle(pen, Bounds);
+ }
+
+