Powerpoint 如何使用c从.pptx或.ppt文件中提取列表或项目符号详细信息#

Powerpoint 如何使用c从.pptx或.ppt文件中提取列表或项目符号详细信息#,powerpoint,Powerpoint,我正在使用Microsoft office Interope assembly使用c#从.pptx和.ppt文件中提取功能。我能够提取有关形状、动画的详细信息,但无法提取关于ppt或pptx包含哪些类型的项目符号,或哪些幻灯片包含项目符号等的详细信息 请帮我找到这个。 提前感谢。在VBA中,您可以这样做来检查幻灯片1上的项目符号 Dim oSh As Shape Dim x As Long ' Integer in C#? For Each oSh In ActivePresentation.S

我正在使用Microsoft office Interope assembly使用c#从.pptx和.ppt文件中提取功能。我能够提取有关形状、动画的详细信息,但无法提取关于ppt或pptx包含哪些类型的项目符号,或哪些幻灯片包含项目符号等的详细信息

请帮我找到这个。
提前感谢。

在VBA中,您可以这样做来检查幻灯片1上的项目符号

Dim oSh As Shape
Dim x As Long ' Integer in C#?
For Each oSh In ActivePresentation.Slides(1).Shapes
    With oSh
        If .HasTextFrame Then
            If .TextFrame.HasText Then
                With .TextFrame2.TextRange
                    For x = 1 To .Paragraphs.Count
                        Debug.Print .Paragraphs(x).ParagraphFormat.Bullet.[Various properties]

                    Next
                End With
            End If
        End If
    End With
Next

查看PPT VBA编辑器中的代码。当您在上面的项目符号后键入点时,intellisense将显示可用的属性。

有几种方法。在下面的代码中,您可以看到可以在程序中访问的文本属性:

ppTextBox.TextFrame2.TextRange.ParagraphFormat.Bullet.Type =
    Office.MsoBulletType.msoBulletNumbered;
ppTextBox.TextFrame2.TextRange.ParagraphFormat.Bullet.Style =
    Office.MsoNumberedBulletStyle.msoBulletAlphaLCParenBoth;

ppTextBox.TextFrame2.TextRange.ParagraphFormat.Bullet.StartValue = 4;
ppTextBox.TextFrame2.TextRange.ParagraphFormat.Bullet.UseTextColor =
    Office.MsoTriState.msoTrue;
ppTextBox.TextFrame2.TextRange.ParagraphFormat.Bullet.UseTextFont =
    Office.MsoTriState.msoTrue;
其中ppTextBox是一个形状对象,请注意TextFrame2而不是TextFrame的用法。您可以根据枚举的list Office.MsoBulletType查询ParagraphFormat.Bullt.Type,以查看应用了哪个


有关更多详细信息,请使用C#查看powerpoint中有关文本处理的更多详细信息。

谢谢您的回复。现在我将尝试在C#中实现此功能。