Last active
September 15, 2022 06:43
-
-
Save shao-wang-me/b1294d434221e456ec81c40cf0cd8130 to your computer and use it in GitHub Desktop.
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 characters
builder.OpenFile("https://github.com/shao-wang-me/delete-me-later/raw/main/tracked_changes.docx"); | |
var oDocument = Api.GetDocument(); | |
oDocument.AcceptAllRevisionChanges(); | |
oDocument.SetTrackRevisions(false); | |
builder.SaveFile("docx", "AcceptAllRevisionChanges.docx"); | |
builder.CloseFile(); |
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 characters
builder.CreateFile("docx"); | |
var oDocument = Api.GetDocument(); | |
var oParagraph, oRun; | |
oParagraph = oDocument.GetElement(0); | |
oParagraph = Api.CreateParagraph(); | |
oParagraph.AddText("Dear John Smith."); | |
oDocument.Push(oParagraph); | |
oParagraph = Api.CreateParagraph(); | |
oParagraph.AddText("ONLYOFFICE is glad to announce that starting today, you are appointed Commercial director to the company of your dream."); | |
oDocument.Push(oParagraph); | |
oParagraph = Api.CreateParagraph(); | |
oRun = Api.CreateRun(); | |
oRun.SetBold(true); | |
oRun.AddText("Please note: "); | |
oParagraph.AddElement(oRun); | |
oRun = Api.CreateRun(); | |
oRun.AddText("this text is used to demonstrate the possibilities of "); | |
oParagraph.AddElement(oRun); | |
oRun = Api.CreateRun(); | |
oRun.SetBold(true); | |
oRun.AddText("ONLYOFFICE Document Builder"); | |
oParagraph.AddElement(oRun); | |
oRun = Api.CreateRun(); | |
oRun.AddText(" and cannot be used as real appointment to the position in any real company."); | |
oParagraph.AddElement(oRun); | |
oDocument.Push(oParagraph); | |
oParagraph = Api.CreateParagraph(); | |
oParagraph.AddText("Best regards,"); | |
oParagraph.AddLineBreak(); | |
oParagraph.AddText("ONLYOFFICE Document Builder Team"); | |
oDocument.Push(oParagraph); | |
builder.SaveFile("docx", "SampleText.docx"); | |
builder.CloseFile(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment