Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ static void Main(string[] args)
{
//Gets the bookmark instance by using FindByName method of BookmarkCollection with bookmark name.
Bookmark bookmark = document.Bookmarks.FindByName("Northwind");
//Accesses the bookmark starts owner paragraph by using bookmark and changes its back color.
//Accesses the bookmark start's owner paragraph by using the bookmark and changes its back color.
bookmark.BookmarkStart.OwnerParagraph.ParagraphFormat.BackColor = Color.AliceBlue;
//Creates file stream.
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.docx"), FileMode.Create, FileAccess.ReadWrite))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ static void Main(string[] args)
picture.LoadImage(imageStream);
picture.WidthScale = 50;
picture.HeightScale = 50;
//Disposes the image stream
imageStream.Dispose();
//Creates file stream.
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.docx"), FileMode.Create, FileAccess.ReadWrite))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ static void Main(string[] args)
bookmarkNavigator = new BookmarksNavigator(document);
//Moves the virtual cursor to the location before the end of the bookmark "NorthwindDB".
bookmarkNavigator.MoveToBookmark("NorthwindDB");
//Replaces the bookmark content with word body part.
//Replaces the bookmark content with WordDocumentPart.
bookmarkNavigator.ReplaceContent(wordDocumentPart);
//Close the WordDocumentPart instance.
wordDocumentPart.Close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static void Main(string[] args)
chart.ChartData.SetValue(10, 2, 29.171);
chart.ChartData.SetValue(11, 1, "Elizabeth Lincoln");
chart.ChartData.SetValue(11, 2, 25.696);
//Creates a new chart series with the name Sales.
//Creates a new chart series with the name "Sales".
IOfficeChartSerie pieSeries = chart.Series.Add("Sales");
pieSeries.Values = chart.ChartData[2, 2, 11, 2];
//Sets data label.
Expand Down
6 changes: 3 additions & 3 deletions Charts/Format-Axis/.NET/Format-Axis/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ static void Main(string[] args)
chart.PrimaryCategoryAxis.Font.Bold = true;
chart.PrimaryCategoryAxis.Font.Size = 8;

//Customize the vertical category axis font.
//Customize the vertical value axis font.
chart.PrimaryValueAxis.Font.Color = OfficeKnownColors.Red;
chart.PrimaryValueAxis.Font.FontName = "Calibri";
chart.PrimaryValueAxis.Font.Bold = true;
Expand All @@ -69,10 +69,10 @@ static void Main(string[] args)
//Number format for axis.
chart.PrimaryValueAxis.NumberFormat = "0.0";

//Hiding major gridlines.
//Showing major gridlines.
chart.PrimaryValueAxis.HasMajorGridLines = true;

//Showing minor gridlines.
//Hiding minor gridlines.
chart.PrimaryValueAxis.HasMinorGridLines = false;

using (FileStream outputStream = new FileStream(Path.GetFullPath(@"Output/Output.docx"), FileMode.Create, FileAccess.ReadWrite, FileShare.ReadWrite))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static void Main(string[] args)
chart.ChartData.SetValue(2, 2, 141.396);
chart.ChartData.SetValue(3, 1, "Stanley Hudson");
chart.ChartData.SetValue(3, 2, 80.368);
//Creates a new chart series with the name Sales.
//Creates a new chart series with the name "Sales".
IOfficeChartSerie pieSeries = chart.Series.Add("Sales");
pieSeries.Values = chart.ChartData[2, 2, 3, 2];
//Sets category labels.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ static void Main(string[] args)
//Opens the template document.
using (WordDocument document = new WordDocument(fileStream, FormatType.Docx))
{
//Get the Ancestor comment.
//Get the ancestor comment.
WComment ancestorComment = document.Comments[1].Ancestor;
//Creates file stream.
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.docx"), FileMode.Create, FileAccess.ReadWrite))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ static void Main(string[] args)
WComment comment = paragraph.AppendComment("comment test");
//Specifies the author of the comment.
comment.Format.User = "Peter";
//Specifies the initial of the author.
//Specifies the initials of the author.
comment.Format.UserInitials = "St";
//Set the date and time for comment.
//Sets the date and time for the comment.
comment.Format.DateTime = DateTime.Now;
//Creates file stream.
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.docx"), FileMode.Create, FileAccess.ReadWrite))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
//Open the existing Word document.
using (WordDocument document = new WordDocument(fileStream, FormatType.Docx))
{
//Find all occurrence of a particular text ending with comma in the document using regex.
//Find all occurrences of a particular text ending with a comma in the document using regex.
TextSelection[] textSelection = document.FindAll(new Regex("\\w+,"));
if (textSelection != null)
{
//Iterates through each occurrence and comment it.
//Iterates through each occurrence and adds a comment to it.
for (int i = 0; i < textSelection.Count(); i++)
{
//Get the found text as a single text range.
Expand All @@ -20,17 +20,17 @@
WParagraph paragraph = textRange.OwnerParagraph;
//Get the index of the found text.
int textIndex = paragraph.ChildEntities.IndexOf(textRange);
//Add comment to a paragraph.
//Add a comment to a paragraph.
WComment comment = paragraph.AppendComment("comment test_" + i);
//Specify the author of the comment.
comment.Format.User = "Peter";
//Specify the initial of the author.
//Specify the initials of the author.
comment.Format.UserInitials = "St";
//Set the date and time for the comment.
comment.Format.DateTime = DateTime.Now;
//Insert the comment next to the textrange.
//Insert the comment next to the text range.
paragraph.ChildEntities.Insert(textIndex + 1, comment);
//Add the paragraph items to the commented items.
//Add the paragraph item to the commented items.
comment.AddCommentedItem(textRange);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ static void Main(string[] args)
//Opens the template document.
using (WordDocument document = new WordDocument(fileStream, FormatType.Docx))
{
//Removes second comments from a document.
//Removes the second comment from the document.
document.Comments.RemoveAt(1);
//Creates file stream.
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.docx"), FileMode.Create, FileAccess.ReadWrite))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ static void Main(string[] args)
//Iterate the comments in the Word document.
foreach (WComment comment in document.Comments)
{
//Get the commented word or part of a particular comment.
//Get the commented text or items of a particular comment.
if (comment.TextBody.LastParagraph.Text == "This is the second comment.")
{
ParagraphItemCollection paragraphItem = comment.CommentedItems;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ static void Main(string[] args)
WParagraph paragraph = document.LastParagraph;
//Adds text to the paragraph.
paragraph.AppendText("A new text is added to the paragraph. ");
//Appends picture content control to the paragraph.
//Appends checkbox content control to the paragraph.
InlineContentControl checkBox = paragraph.AppendInlineContentControl(ContentControlType.CheckBox) as InlineContentControl;
checkBox.ContentControlProperties.IsChecked = true;
//Creates file stream.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ static void Main(string[] args)
//Appends a new inline content control to enter the value.
InlineContentControl txtField = cellPara.AppendInlineContentControl(ContentControlType.Text) as InlineContentControl;
txtField.ContentControlProperties.Title = "Text";
//Sets formatting options for text present insider a content control.
//Sets formatting options for text present inside a content control.
txtField.BreakCharacterFormat.TextColor = Syncfusion.Drawing.Color.MidnightBlue;
txtField.BreakCharacterFormat.FontName = "Arial";
txtField.BreakCharacterFormat.FontSize = 11f;
Expand All @@ -105,7 +105,7 @@ static void Main(string[] args)
txtField.ContentControlProperties.Title = "Date";
//Sets the date display format
txtField.ContentControlProperties.DateDisplayFormat = "M/d/yyyy";
//Sets formatting options for text present insider a content control.
//Sets formatting options for text present inside a content control.
txtField.BreakCharacterFormat.TextColor = Syncfusion.Drawing.Color.MidnightBlue;
txtField.BreakCharacterFormat.FontName = "Arial";
txtField.BreakCharacterFormat.FontSize = 11f;
Expand All @@ -118,7 +118,7 @@ static void Main(string[] args)
txtField.ContentControlProperties.Title = "Text";
//Sets multiline property to true to get the multiple line input of Address.
txtField.ContentControlProperties.Multiline = true;
//Sets formatting options for text present insider a content control.
//Sets formatting options for text present inside a content control.
txtField.BreakCharacterFormat.TextColor = Syncfusion.Drawing.Color.MidnightBlue;
txtField.BreakCharacterFormat.FontName = "Arial";
txtField.BreakCharacterFormat.FontSize = 11f;
Expand All @@ -129,7 +129,7 @@ static void Main(string[] args)
//Appends a new inline content control to enter the value.
txtField = cellPara.AppendInlineContentControl(ContentControlType.Text) as InlineContentControl;
txtField.ContentControlProperties.Title = "Text";
//Sets formatting options for text present insider a content control.
//Sets formatting options for text present inside a content control.
txtField.BreakCharacterFormat.TextColor = Syncfusion.Drawing.Color.MidnightBlue;
txtField.BreakCharacterFormat.FontName = "Arial";
txtField.BreakCharacterFormat.FontSize = 11f;
Expand All @@ -140,7 +140,7 @@ static void Main(string[] args)
//Appends a new inline content control to enter the value.
txtField = cellPara.AppendInlineContentControl(ContentControlType.Text) as InlineContentControl;
txtField.ContentControlProperties.Title = "Text";
//Sets formatting options for text present insider a content control.
//Sets formatting options for text present inside a content control.
txtField.BreakCharacterFormat.TextColor = Syncfusion.Drawing.Color.MidnightBlue;
txtField.BreakCharacterFormat.FontName = "Arial";
txtField.BreakCharacterFormat.FontSize = 11f;
Expand Down Expand Up @@ -199,7 +199,7 @@ static void Main(string[] args)
item.Value = "3";
dropdown.ContentControlProperties.ContentControlListItems.Add(item);
dropdown.ContentControlProperties.Title = "Drop-Down";
//Sets formatting options for text present insider a content control.
//Sets formatting options for text present inside a content control.
dropdown.BreakCharacterFormat.TextColor = Syncfusion.Drawing.Color.MidnightBlue;
dropdown.BreakCharacterFormat.FontName = "Arial";
dropdown.BreakCharacterFormat.FontSize = 11f;
Expand All @@ -209,7 +209,7 @@ static void Main(string[] args)
txt.CharacterFormat.FontSize = 11f;
//Appends a new inline content control to enter the value.
txtField = cellPara.AppendInlineContentControl(ContentControlType.Text) as InlineContentControl;
//Sets formatting options for text present insider a content control.
//Sets formatting options for text present inside a content control.
txtField.BreakCharacterFormat.TextColor = Syncfusion.Drawing.Color.MidnightBlue;
txtField.BreakCharacterFormat.FontName = "Arial";
txtField.BreakCharacterFormat.FontSize = 11f;
Expand Down Expand Up @@ -242,7 +242,7 @@ static void Main(string[] args)
item.DisplayText = "Excellent";
item.Value = "3";
dropdown.ContentControlProperties.ContentControlListItems.Add(item);
//Sets formatting options for text present insider a content control.
//Sets formatting options for text present inside a content control.
dropdown.BreakCharacterFormat.TextColor = Syncfusion.Drawing.Color.MidnightBlue;
dropdown.BreakCharacterFormat.FontName = "Arial";
dropdown.BreakCharacterFormat.FontSize = 11f;
Expand Down Expand Up @@ -272,7 +272,7 @@ static void Main(string[] args)
item.Value = "3";
dropdown.ContentControlProperties.ContentControlListItems.Add(item);
dropdown.ContentControlProperties.Title = "Drop-Down";
//Sets formatting options for text present insider a content control
//Sets formatting options for text present inside a content control
dropdown.BreakCharacterFormat.TextColor = Syncfusion.Drawing.Color.MidnightBlue;
dropdown.BreakCharacterFormat.FontName = "Arial";
dropdown.BreakCharacterFormat.FontSize = 11f;
Expand Down
2 changes: 1 addition & 1 deletion Fields/Cross-reference/.NET/Cross-reference/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ static void Main(string[] args)
//Gets the collection of bookmark start in the word document.
List<Entity> items = document.GetCrossReferenceItems(ReferenceType.Bookmark);
paragraph.AppendText("Bookmark Cross Reference starts here ");
//Appends the cross reference for bookmark Title with ContentText as reference kind.
//Appends the cross reference for bookmark "Title" with ContentText as reference kind.
paragraph.AppendCrossReference(ReferenceType.Bookmark, ReferenceKind.ContentText, items[0], true, false, false, string.Empty);
//Updates the document Fields.
document.UpdateDocumentFields();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ static void Main(string[] args)
//Accesses sequence field in the document.
WTable table = document.LastSection.Body.ChildEntities[1] as WTable;
WSeqField field = ((table[2, 1].ChildEntities[0] as WParagraph).ChildEntities[0] as WSeqField);
//Enables a flag to to hide the sequence field result .
//Enables a flag to hide the sequence field result.
field.HideResult = true;
//Accesses sequence field in the document.
field = ((table[4, 1].ChildEntities[0] as WParagraph).ChildEntities[0] as WSeqField);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Program
{
static void Main(string[] args)
{
//Open the file as Stream.
//Open the file as a Stream.
using (FileStream fileStreamPath = new FileStream(Path.GetFullPath(@"Data/Input.docx"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
{
//Load the Input document.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


string[] filePaths = {"Data/Heading1Items.docx","Data/Heading2Items.docx"};
//Open the file as Stream.
//Open the file as a Stream.
using (FileStream documentStream = new FileStream("Data/Input.docx", FileMode.Open, FileAccess.Read))
{
//Open an existing Word document.
Expand All @@ -18,7 +18,7 @@
TextSelection selection = document.Find(findText, false, false);
//Get the owner paragraph.
WParagraph ownerPara = selection.GetAsOneRange().OwnerParagraph;
//Open the file as Stream.
//Open the file as a Stream.
using (FileStream subDocumentStream = new FileStream(filePaths[documentIndex-1], FileMode.Open, FileAccess.Read))
{
//Open an sub Word document.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ static void Main(string[] args)
//Opens an existing Word document.
using (WordDocument document = new WordDocument(fileStreamPath, FormatType.Automatic))
{
//Find all footnote and endnote by EntityType in Word document.
//Find all footnotes by EntityType in Word document.
List<Entity> footNotes = document.FindAllItemsByProperty(EntityType.Footnote, null, null);
//Remove the footnotes and endnotes.
//Remove the footnotes.
for (int i = 0; i < footNotes.Count; i++)
{
WFootnote footnote = footNotes[i] as WFootnote;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ static void Main(string[] args)
//Appends the endnotes.
WFootnote endnote = (WFootnote)paragraph.AppendFootnote(Syncfusion.DocIO.FootnoteType.Endnote);
WTextBody separator = document.Endnotes.Separator;
//Replaces the default endnote separated by text.
//Replaces the default endnote separator with text.
separator.Paragraphs[0].Text = "Endnote separator";
//Sets the endnote character format.
endnote.MarkerCharacterFormat.SubSuperScript = SubSuperScript.SuperScript;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ static void Main(string[] args)
//Appends the footnotes.
WFootnote footnote = (WFootnote)paragraph.AppendFootnote(Syncfusion.DocIO.FootnoteType.Footnote);
WTextBody separator = document.Footnotes.Separator;
//Replaces the default footnote separated by text.
//Replaces the default footnote separator with text.
separator.Paragraphs[0].Text = "Footnote separator";
//Sets the footnote character format.
footnote.MarkerCharacterFormat.SubSuperScript = SubSuperScript.SuperScript;
Expand Down
Loading