DocumentBase.ConvertNumbersToText(Object) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将指定文档中的列表编号和 LISTNUM 字段更改为文本。
public void ConvertNumbersToText (ref object numberType);
参数
- numberType
- Object
要转换的编号的类型。 可以是以下任何 WdNumberType 值:wdNumberParagraph、wdNumberListNum 或 wdNumberAllNumbers。
示例
下面的代码示例使用 ConvertNumbersToText 方法将文档中的所有列表号和 LISTNUM 字段转换为文本。 若要使用此示例,请在 ThisDocument 文档级项目的类中运行它。
private void DocumentConvertNumbersToText()
{
object numberType = Word.WdNumberType.wdNumberAllNumbers;
this.ConvertNumbersToText(ref numberType);
}
Private Sub DocumentConvertNumbersToText()
Me.ConvertNumbersToText(Word.WdNumberType.wdNumberAllNumbers)
End Sub
注解
有两种类型的数字:预设数字( wdNumberParagraph ),可以通过在 "项目符号和编号" 对话框中选择模板来添加到段落; 还可以使用 LISTNUM 域( wdNumberListNum ),这使您可以为每个段落添加多个数字。
ConvertNumbersToText如果要在其他应用程序中使用文档,而该应用程序不能识别列表格式或 LISTNUM 字段,则此方法很有用。
将列表数字转换为文本后,不能再在列表中对其进行操作。
可选参数
有关可选参数的信息,请参阅Office 解决方案中的可选参数。