Last active
November 26, 2021 16:20
Revisions
-
aspose-com-kb revised this gist
Nov 26, 2021 . No changes.There are no files selected for viewing
-
aspose-com-kb revised this gist
Nov 25, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -29,6 +29,6 @@ public static void main(String[] args) throws Exception { //main function for Ad comment.getFirstParagraph().getRuns().add(new Run(DocumentForComment, "Comment text.")); // Save the Document with comments DocumentForComment.save("OutputDocumentWithComments.docx"); } } -
aspose-com-kb revised this gist
Nov 25, 2021 . 1 changed file with 16 additions and 16 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,24 +11,24 @@ public class HowToAddCommentsInWordUsingJava { public static void main(String[] args) throws Exception { //main function for AddImageInWord class // Initialize a license to avoid trial version watermark in the output Word file after adding image License license = new License(); license.setLicense("Aspose.Words.lic"); // Load the Word document where comments are to be added Document DocumentForComment = new Document("input.docx"); DocumentBuilder builder = new DocumentBuilder(DocumentForComment); // Move the cursor to the beginning of the document for adding comments builder.moveToDocumentStart(); // Insert comment to first paragraph of document by providing Author, Initial, time and comment text Comment comment = new Comment(DocumentForComment, "Aspose.Words", "AW", new Date()); builder.getCurrentParagraph().appendChild(comment); comment.getParagraphs().add(new Paragraph(DocumentForComment)); comment.getFirstParagraph().getRuns().add(new Run(DocumentForComment, "Comment text.")); // Save the Document with comments DocumentForComment.save("output.docx"); } } -
aspose-com-kb revised this gist
Nov 25, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,7 +9,7 @@ public class HowToAddCommentsInWordUsingJava { public static void main(String[] args) throws Exception { //main function for AddImageInWord class // Initialize a license to avoid trial version watermark in the output Word file after adding image License license = new License(); -
aspose-com-kb revised this gist
Nov 25, 2021 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,9 +11,9 @@ public class HowToAddCommentsInWordUsingJava { public static void main(String[] args) throws Exception { //main function for AddImageInWord class // Initialize a license to avoid trial version watermark in the output Word file after adding image License license = new License(); license.setLicense("Aspose.Words.lic"); // Load the Word document where comments are to be added Document DocumentForComment = new Document("input.docx"); -
aspose-com-kb created this gist
Nov 25, 2021 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ import com.aspose.words.License; import com.aspose.words.Document; import com.aspose.words.DocumentBuilder; import com.aspose.words.Comment; import com.aspose.words.Paragraph; import com.aspose.words.Run; import java.util.Date; public class HowToAddCommentsInWordUsingJava { public static void main(String[] args) throws Exception { //main function for AddImageInWord class // Initialize a license to avoid trial version watermark in the output Word file after adding image License license = new License(); license.setLicense("Aspose.Words.lic"); // Load the Word document where comments are to be added Document DocumentForComment = new Document("input.docx"); DocumentBuilder builder = new DocumentBuilder(DocumentForComment); // Move the cursor to the beginning of the document for adding comments builder.moveToDocumentStart(); // Insert comment to first paragraph of document by providing Author, Initial, time and comment text Comment comment = new Comment(DocumentForComment, "Aspose.Words", "AW", new Date()); builder.getCurrentParagraph().appendChild(comment); comment.getParagraphs().add(new Paragraph(DocumentForComment)); comment.getFirstParagraph().getRuns().add(new Run(DocumentForComment, "Comment text.")); // Save the Document with comments DocumentForComment.save("output.docx"); } }