获取格式化PowerPoint 2010幻灯片备注

时间:2012-10-10 18:08:23

标签: office-automation powerpoint-2010

使用以下C#代码,我可以获得原始文本。然而,我需要的是一种获得与文本一起的格式化(粗体,斜体等)的方法。

string noteText;

for ( var i = 1; i <= mySlide.NotesPage.Shapes.Count; i++ )
{
   var noteShape = mySlide.NotesPage.Shapes[i];

   if ( noteShape.Type == OfficeCore.MsoShapeType.msoPlaceholder )
   {
      if ( noteShape.PlaceholderFormat.Type == PowerPoint.PpPlaceholderType.ppPlaceholderBody )
      {
         if ( noteShape.HasTextFrame == OfficeCore.MsoTriState.msoTrue )
         {
            if ( noteShape.TextFrame2.HasText == OfficeCore.MsoTriState.msoTrue )
            {
               noteText = noteShape.TextFrame.TextRange.Text;
               break;
            }
         }
      }
   }
}

有人可以帮忙吗?

0 个答案:

没有答案