- HOME
- Post in | and so on/c#
- Post at | 2013. 1. 15. 10:51 | by 밀크빵.
- View comment
C# PPT 내용 읽기
PowerPoint.Application PowerPoint_App = new PowerPoint.Application();
PowerPoint.Presentations multi_presentations = PowerPoint_App.Presentations;
PowerPoint.Presentation presentation = multi_presentations.Open(@"C:\test - 복사본.pptx");
string presentation_text = "";
for (int i = 0; i < presentation.Slides.Count; i++)
{
foreach (var item in presentation.Slides[i + 1].Shapes)
{
var shape = (PowerPoint.Shape)item;
if (shape.HasTextFrame == MsoTriState.msoTrue)
{
if (shape.TextFrame.HasText == MsoTriState.msoTrue)
{
var textRange = shape.TextFrame.TextRange;
var text = textRange.Text;
presentation_text += text + " ";
textBox1.Text = presentation_text;
}
}
}
}
PowerPoint_App.Quit();
Console.WriteLine(presentation_text);
ppt 는 문제가 많다
'and so on > c#' 카테고리의 다른 글
[C#] 파일 쓰기 (0) | 2013.01.18 |
---|---|
.NetFramework 설치 확인 하기 (0) | 2013.01.17 |
c# 오피스 참조한 프로젝트 배포 시 필요한 dll (0) | 2013.01.07 |
c#dll c++에서 사용 (2) | 2013.01.02 |
C++ DLL 함수 char*를 C#에서 읽어 오기 (0) | 2012.09.26 |