使用以下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;
}
}
}
}
}
有人可以帮忙吗?