Open Office XML を使用して Word ファイルを出力しようとしていますが、スペーシングが正しくないようです。
Variable name:ATTEND
Description:Student's attendance status during the
Wordファイルをこれにしたい(:)の後にスペースを入れる:
Variable name: ATTEND
Description:Student's attendance status during the
私のコードは次のとおりで、スペーシングは消えます:
start of my function
// Add a new main document part.
MainDocumentPart mainPart = wordDocument.AddMainDocumentPart();
// Create the Document DOM.
mainPart.Document = new Document();
Body body = mainPart.Document.AppendChild(new Body());
ParagraphProperties paragraphProperties = new ParagraphProperties
(
new ParagraphStyleId() { Val = "No Spacing" },
new SpacingBetweenLines() { After = "0" }
);
Paragraph para = body.AppendChild(new Paragraph(paragraphProperties));
Run run = para.AppendChild(new Run());
RunProperties runProperties = run.AppendChild(new RunProperties(new Bold()));
run.AppendChild(new Text("Variable name: "));
run = para.AppendChild(new Run());
run.AppendChild(new Text(" ATTEND"));
para = body.AppendChild(new Paragraph());
run = para.AppendChild(new Run());
runProperties = run.AppendChild(new RunProperties(new Bold()));
run.AppendChild(new Text("Description: "));
run = para.AppendChild(new Run());
run.AppendChild(new Text(" Student's attendance status during the "));
// Save changes to the main document part.
wordDocument.MainDocumentPart.Document.Save();
}