westcoastlasas.blogg.se

Change subscript and superscript in word
Change subscript and superscript in word










change subscript and superscript in word
  1. Change subscript and superscript in word full#
  2. Change subscript and superscript in word code#

WordNS.Document doc = _application.ActiveDocument Var fontSize = new FontSizeComplexScript() Īnd here's a Interop solution: using WordNS = Public static Run AddRun(bool isSubscript, string text) P.AppendChild(AddRun(false, "Some text b ")) Paragraph p = body.AppendChild(new Paragraph()) MainDocumentPart mainPart = doc.AddMainDocumentPart() īody body = (new Body()) Using (var doc = WordprocessingDocument.Create("C:\\Subscript.docx", WordprocessingDocumentType.Document)) One way to achieve this is OpenXML SDK.Once you've downloaded and installed the SDK you can use the following code: using System docx to examine it's XML content you will notice that the text containing the subscript/superscript is placed in a separate run element. String docName = saveFileDialog1.FileName Ĭreate a Word document and add text with subscipt/superscript and unzip the. If (DialogResult.OK = saveFileDialog1.ShowDialog()) SaveFileDialog1.Title = "Save the Word Document"

change subscript and superscript in word

SaveFileDialog1.Filter = "Word document|*.doc" SaveFileDialog saveFileDialog1 = new SaveFileDialog() Sample code: private void btnReport_Click(object sender, EventArgs e) Is there a way for me to accomplish the Goal and insert something like “eff“ in subscript inside a paragraph in a freshly created Word Document?

Change subscript and superscript in word full#

I’m also aware that there are subscript letters and numbers in Unicode that I could use, but, unfortunately, Unicode does not have full alphabet in subscript format, so that is not an option either. I found a way to subscript the whole paragraph with line, = 1 īut found no way to implement it on separate characters. The final document would contain around 100 of lines like above, with different characters that are subscripted. What I need to accomplish, is creating a paragraph, which has subscript characters inside.(in paragraph above letters "eff" should be subscripted): This part has no problems.Ĭurrent text in created word file will be the following:

Change subscript and superscript in word code#

There is a small form with a button that does described actions (see the code below). doc file, add paragraphs to it and saves it. I’m working on a program in C# that uses Microsoft Word 14.0 Object Library to create a.












Change subscript and superscript in word