Model/WordParagraph.cs

(完整代码) 852B

using NetOffice.WordApi;
using NetOffice.WordApi.Enums;
using System;

public class WordParagraph : WordContent
{
	public string content
	{
		get;
		set;
	}

	public int align
	{
		get;
		set;
	}

	public int gettype()
	{
		return 0;
	}

	public void saveindocument(Application wordApplication, Document newDocument)
	{
		Paragraph paragraph = newDocument.Paragraphs.Add();
		wordApplication.Selection.TypeText(this.content);
		wordApplication.Selection.Font.Color = WdColor.wdColorBlack;
		wordApplication.Selection.Font.Bold = 0;
		wordApplication.Selection.Font.Size = 14f;
		if (this.align == 0)
		{
			paragraph.Alignment = WdParagraphAlignment.wdAlignParagraphCenter;
		}
		else
		{
			paragraph.Alignment = WdParagraphAlignment.wdAlignParagraphLeft;
		}
		wordApplication.Selection.TypeParagraph();
	}
}

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。