Skip to content

Commit 9f75e75

Browse files
authored
Merge pull request #577 from DharanyaSakthivel-SF4210/main
ES-1044308-Address the feedback in Word library pages samples
2 parents 5544548 + 4efef3d commit 9f75e75

123 files changed

Lines changed: 193 additions & 189 deletions

File tree

  • Bookmarks
    • Get-an-instance-of-bookmark/.NET/Get-an-instance-of-bookmark
    • Insert-paragraph-item-into-bookmark/.NET/Insert-paragraph-item-into-bookmark
    • Replace-content-with-document-part/.NET/Replace-content-with-document-part
  • Charts
    • Create-chart-from-scratch/.NET/Create-chart-from-scratch
    • Format-Axis/.NET/Format-Axis
    • Remove-chart-title/.NET/Remove-chart-title
  • Comments
    • Access-parent-comment/.NET/Access-parent-comment
    • Add-comment-to-Word-document/.NET/Add-comment-to-Word-document
    • Find-text-using-regex-and-add-comments/.NET/Find-text-using-regex-and-add-comments
    • Remove-particular-comment-from-Word/.NET/Remove-particular-comment-from-Word
    • Retrieve-commented-word/.NET/Retrieve-commented-word
  • Content-Controls
    • Check-box-content-control/.NET/Check-box-content-control
    • Create-form-in-Word-document/.NET/Create-form-in-Word-document
  • Fields
    • Cross-reference/.NET/Cross-reference
    • Hide-SEQ-field-result/.NET/Hide-SEQ-field-result
  • Find-and-Replace
    • Find-and-replace-text-within-table/.NET/Find-and-replace-text-within-table
    • Find-and-replace-with-multiple-list-paragraphs/.NET/Find-and-replace-with-multiple-list-paragraphs
  • Find-item-in-word-document/Find-all-items-by-property/.NET/Find-all-items-by-property
  • Footnotes-and-Endnotes
    • Change-default-endnote-separator/.NET/Change-default-endnote-separator
    • Change-default-footnote-separator/.NET/Change-default-footnote-separator
  • Macros
    • Open-and-save-macro-enabled-document/.NET/Open-and-save-macro-enabled-document
    • Remove-macros-in-document/.NET/Remove-macros-in-document
  • Mail-Merge
    • Event-for-image-mail-merge-field/.NET/Event-for-image-mail-merge-field
    • Event-to-bind-data-for-unmerged-fields/.NET/Event-to-bind-data-for-unmerged-fields
    • Event-to-bind-data-for-unmerged-group/.NET/Event-to-bind-data-for-unmerged-group
    • Exception-field-not-in-data source/.NET/Exception-field-not-in-data source
    • Keep-unmerged-merge-fields/.NET/Keep-unmerged-merge-fields
    • Mail-merge-with-dynamic-objects/.NET/Mail-merge-with-dynamic-objects
    • Mail-merge-with-implicit-relational-data/.NET/Mail-merge-with-implicit-relational-data
    • Multiple-documents-as-data-sources/.NET/Multiple-documents-as-data-sources
    • Remove-empty-merge-field-groups/.NET/Remove-empty-merge-field-groups
    • Replace-Merge-field-with-table/.NET/Replace-Merge-field-with-table
    • Replace-merge-field-with-chart/.NET/Replace-merge-field-with-chart
    • Restart-list-numbering-in-mail-merge/.NET/Restart-list-numbering-in-mail-merge
    • Retrieve-merge-field-names/.NET/Retrieve-merge-field-names
    • Start-at-new-page/.NET/Start-at-new-page
  • Mathematical-Equation
  • Paragraphs
    • Add-image-caption/.NET/Add-image-caption
    • Find-an-image-by-title/.NET/Find-an-image-by-title
    • Format-and-rotate-image/.NET/Format-and-rotate-image
    • Increase-or-decrease-list-indent/.NET/Increase-or-decrease-list-indent
    • List-with-prefix-from-previous-level/.NET/List-with-prefix-from-previous-level
    • Multilevel-bulleted-list/.NET/Multilevel-bulleted-list
    • Simple-bulleted-list/.NET/Simple-bulleted-list
    • User-defined-bulleted-list/.NET/User-defined-bulleted-list
  • Read-and-Save-document
    • Multithreading-using-parallel-process/.NET/Multithreading-using-parallel-process
    • Multithreading-using-tasks/.NET/Multithreading-using-tasks
    • Open-and-save-Word-document
      • AWS
        • AWS_Elastic_Beanstalk/Open-and-Save-Word-Document/Views/Home
        • Console_Application/Open-and-Save-Word-Document
      • Azure-Blob-Storage
      • Azure
        • Azure_App_Service/Open_and_save_Word_document/Controllers
        • Azure_Functions
      • Xamarin/Open-and-save-Word-document/Open-and-save-Word-document
  • Sections/Remove-headers-in-Word-document/.NET/Remove-headers-in-Word-document
  • Shapes/Collection-of-shapes-into-group-shape/.NET/Collection-of-shapes-into-group-shape
  • Tables
    • Apply-vertical-merge-to-cells/.NET/Apply-vertical-merge-to-cells
    • Create-nested-table/.NET/Create-nested-table
    • Iterating-through-table-elements/.NET/Iterating-through-table-elements
    • Resize-table/.NET/Resize-table
    • Set-table-cell-width/.NET/Set-table-cell-width
  • Track-Changes
    • Accept-all-changes-made-by-author/.NET/Accept-all-changes-made-by-author
    • Accept-or-reject-specific-type/.NET/Accept-or-reject-specific-type
    • Enable-track-changes-of-Word/.NET/Enable-track-changes-of-Word
    • Reject-all-changes-made-by-author/.NET/Reject-all-changes-made-by-author
  • Word-document
    • Access-styles-in-document/.NET/Access-styles-in-document
    • Add-custom-document-properties/.NET/Add-custom-document-properties
    • Apply-built-in-style/.NET/Apply-built-in-style
    • Apply-gradient-background-to-document/.NET/Apply-gradient-background-to-document
    • Apply-picture-background-to-document/.NET/Apply-picture-background-to-document
    • Clone-whole-Word-document/.NET/Clone-whole-Word-document
    • Create-new-paragraph-style/.NET/Create-new-paragraph-style
    • Find-and-replace-text-with-Excel-content/.NET/Find-and-replace-text-with-Excel-content
    • Iterate-document-elements/.NET/Iterate-document-elements
    • Merge-documents-in-new-page/.NET/Merge-documents-in-new-page
    • Merge-documents-in-same-page/.NET/Merge-documents-in-same-page
    • Modify-built-in-document-properties/.NET/Modify-built-in-document-properties
    • Modify-content-type-properties/.NET/Modify-content-type-properties
    • Modify-custom-document-properties/.NET/Modify-custom-document-properties
    • Print-Word-document/.NET-Framework/Print-Word-document
    • Remove-empty-pages-from-Word-document/.NET/Remove-empty-pages-from-Word-document
    • Remove-paragraph-with-style/.NET/Remove-paragraph-with-style
    • Remove-particular-style-from-document/.NET/Remove-particular-style-from-document
    • Silent-Printing-Word-Document/WinForms/Silent-Printing-Word-Document
    • Split-by-bookmark/.NET/Split-by-bookmark
    • Split-by-heading/.NET/Split-by-heading
    • Split-by-placeholder-text/.NET/Split-by-placeholder-text
    • Split-by-section/.NET/Split-by-section
    • Update-alternate-chunks/.NET/Update-alternate-chunks
    • Update-pages-count/.NET/Update-pages-count
    • Update-words-count/.NET/Update-words-count

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Bookmarks/Get-an-instance-of-bookmark/.NET/Get-an-instance-of-bookmark/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ static void Main(string[] args)
1616
{
1717
//Gets the bookmark instance by using FindByName method of BookmarkCollection with bookmark name.
1818
Bookmark bookmark = document.Bookmarks.FindByName("Northwind");
19-
//Accesses the bookmark starts owner paragraph by using bookmark and changes its back color.
19+
//Accesses the bookmark start's owner paragraph by using the bookmark and changes its back color.
2020
bookmark.BookmarkStart.OwnerParagraph.ParagraphFormat.BackColor = Color.AliceBlue;
2121
//Creates file stream.
2222
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.docx"), FileMode.Create, FileAccess.ReadWrite))

Bookmarks/Insert-paragraph-item-into-bookmark/.NET/Insert-paragraph-item-into-bookmark/Program.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ static void Main(string[] args)
2424
picture.LoadImage(imageStream);
2525
picture.WidthScale = 50;
2626
picture.HeightScale = 50;
27+
//Disposes the image stream
28+
imageStream.Dispose();
2729
//Creates file stream.
2830
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.docx"), FileMode.Create, FileAccess.ReadWrite))
2931
{

Bookmarks/Replace-content-with-document-part/.NET/Replace-content-with-document-part/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ static void Main(string[] args)
2828
bookmarkNavigator = new BookmarksNavigator(document);
2929
//Moves the virtual cursor to the location before the end of the bookmark "NorthwindDB".
3030
bookmarkNavigator.MoveToBookmark("NorthwindDB");
31-
//Replaces the bookmark content with word body part.
31+
//Replaces the bookmark content with WordDocumentPart.
3232
bookmarkNavigator.ReplaceContent(wordDocumentPart);
3333
//Close the WordDocumentPart instance.
3434
wordDocumentPart.Close();

Charts/Create-chart-from-scratch/.NET/Create-chart-from-scratch/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ static void Main(string[] args)
4848
chart.ChartData.SetValue(10, 2, 29.171);
4949
chart.ChartData.SetValue(11, 1, "Elizabeth Lincoln");
5050
chart.ChartData.SetValue(11, 2, 25.696);
51-
//Creates a new chart series with the name Sales.
51+
//Creates a new chart series with the name "Sales".
5252
IOfficeChartSerie pieSeries = chart.Series.Add("Sales");
5353
pieSeries.Values = chart.ChartData[2, 2, 11, 2];
5454
//Sets data label.

Charts/Format-Axis/.NET/Format-Axis/Program.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ static void Main(string[] args)
4242
chart.PrimaryCategoryAxis.Font.Bold = true;
4343
chart.PrimaryCategoryAxis.Font.Size = 8;
4444

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

72-
//Hiding major gridlines.
72+
//Showing major gridlines.
7373
chart.PrimaryValueAxis.HasMajorGridLines = true;
7474

75-
//Showing minor gridlines.
75+
//Hiding minor gridlines.
7676
chart.PrimaryValueAxis.HasMinorGridLines = false;
7777

7878
using (FileStream outputStream = new FileStream(Path.GetFullPath(@"Output/Output.docx"), FileMode.Create, FileAccess.ReadWrite, FileShare.ReadWrite))

Charts/Remove-chart-title/.NET/Remove-chart-title/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ static void Main(string[] args)
3232
chart.ChartData.SetValue(2, 2, 141.396);
3333
chart.ChartData.SetValue(3, 1, "Stanley Hudson");
3434
chart.ChartData.SetValue(3, 2, 80.368);
35-
//Creates a new chart series with the name Sales.
35+
//Creates a new chart series with the name "Sales".
3636
IOfficeChartSerie pieSeries = chart.Series.Add("Sales");
3737
pieSeries.Values = chart.ChartData[2, 2, 3, 2];
3838
//Sets category labels.

Comments/Access-parent-comment/.NET/Access-parent-comment/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ static void Main(string[] args)
1313
//Opens the template document.
1414
using (WordDocument document = new WordDocument(fileStream, FormatType.Docx))
1515
{
16-
//Get the Ancestor comment.
16+
//Get the ancestor comment.
1717
WComment ancestorComment = document.Comments[1].Ancestor;
1818
//Creates file stream.
1919
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.docx"), FileMode.Create, FileAccess.ReadWrite))

Comments/Add-comment-to-Word-document/.NET/Add-comment-to-Word-document/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ static void Main(string[] args)
2121
WComment comment = paragraph.AppendComment("comment test");
2222
//Specifies the author of the comment.
2323
comment.Format.User = "Peter";
24-
//Specifies the initial of the author.
24+
//Specifies the initials of the author.
2525
comment.Format.UserInitials = "St";
26-
//Set the date and time for comment.
26+
//Sets the date and time for the comment.
2727
comment.Format.DateTime = DateTime.Now;
2828
//Creates file stream.
2929
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.docx"), FileMode.Create, FileAccess.ReadWrite))

Comments/Find-text-using-regex-and-add-comments/.NET/Find-text-using-regex-and-add-comments/Program.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
//Open the existing Word document.
88
using (WordDocument document = new WordDocument(fileStream, FormatType.Docx))
99
{
10-
//Find all occurrence of a particular text ending with comma in the document using regex.
10+
//Find all occurrences of a particular text ending with a comma in the document using regex.
1111
TextSelection[] textSelection = document.FindAll(new Regex("\\w+,"));
1212
if (textSelection != null)
1313
{
14-
//Iterates through each occurrence and comment it.
14+
//Iterates through each occurrence and adds a comment to it.
1515
for (int i = 0; i < textSelection.Count(); i++)
1616
{
1717
//Get the found text as a single text range.
@@ -20,17 +20,17 @@
2020
WParagraph paragraph = textRange.OwnerParagraph;
2121
//Get the index of the found text.
2222
int textIndex = paragraph.ChildEntities.IndexOf(textRange);
23-
//Add comment to a paragraph.
23+
//Add a comment to a paragraph.
2424
WComment comment = paragraph.AppendComment("comment test_" + i);
2525
//Specify the author of the comment.
2626
comment.Format.User = "Peter";
27-
//Specify the initial of the author.
27+
//Specify the initials of the author.
2828
comment.Format.UserInitials = "St";
2929
//Set the date and time for the comment.
3030
comment.Format.DateTime = DateTime.Now;
31-
//Insert the comment next to the textrange.
31+
//Insert the comment next to the text range.
3232
paragraph.ChildEntities.Insert(textIndex + 1, comment);
33-
//Add the paragraph items to the commented items.
33+
//Add the paragraph item to the commented items.
3434
comment.AddCommentedItem(textRange);
3535
}
3636
}

Comments/Remove-particular-comment-from-Word/.NET/Remove-particular-comment-from-Word/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ static void Main(string[] args)
1313
//Opens the template document.
1414
using (WordDocument document = new WordDocument(fileStream, FormatType.Docx))
1515
{
16-
//Removes second comments from a document.
16+
//Removes the second comment from the document.
1717
document.Comments.RemoveAt(1);
1818
//Creates file stream.
1919
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.docx"), FileMode.Create, FileAccess.ReadWrite))

0 commit comments

Comments
 (0)