解决方案 »
- streamwriter如何写覆盖
- 十万块,做个宠物乐园系统.帮忙看下值不
- 图片输出到Excel问题。
- c#实现网页内容转换为world
- net_lover(孟子E章)高人请进,分请笑纳~~~
- 第一次作删除文件遇到的问题。谢谢大家指点
- winform中gridControl绑定的某一列的数据怎么让他横向显示?
- winform仿造浏览器,有几个问题大家帮忙看看
- interface和abstract
- 急等!sql server2005 express 默认设置 远程连接出错是怎么回事啊?请有经验的指点下. 我用vx2005
- C#如何打印datatable中的内容?
- RichTextBox换行问题,解决了,那边要结贴了,在这儿发答案喽
第二:将PPT存成xml ,然后读取里面的标签。(PPT的没搞过 搞过Word,下面的路径 就是我搞Word的一总结 希望对你有用)
http://www.myaspx.com/Example/Word/OupPutWordByWordXmlTemp.htm
[email protected]
公司的东西 不能外发啊,也没有外发权限
我的office版本是2007 之前做的和2003感觉也没啥区别现在就想知道怎么能获取ppt母版中的内容 我能单个获取到1-2个框的内容,但是不知道母版的每一页是怎么获取的,不知道你能不能给贴点代码啊? 谢谢了!
//如下代码是查找PPT母版中带有▲符号的文本框,但我只能找到其中的几页 并不能找到所有
PowerPoint.Application PptApp = new PowerPoint.Application();
PowerPoint.Presentation Present = null;
PptApp.DisplayAlerts = PowerPoint.PpAlertLevel.ppAlertsNone;
object missing = Type.Missing;
FileInfo fileinfo = new FileInfo(FilePath);
DateTime savedaccesstime = fileinfo.LastAccessTime;
Present = PptApp.Presentations.Open(FilePath, MsoTriState.msoFalse, MsoTriState.msoFalse, MsoTriState.msoFalse);
if (Present.Slides.Count >= 1)
{
foreach (PowerPoint.Shape pptShape in Present.SlideMaster.Shapes)
{
if (MsoTriState.msoFalse == pptShape.HasTextFrame) continue;
if (MsoTriState.msoFalse == pptShape.TextFrame.HasText) continue;
str = pptShape.TextFrame.TextRange.Text;
if (str.Contains(@"▲"))
{
break;
}
}
}
其实只有母版的第一页是SlideMaster
下面的几页都是这个SlideMaster的CustomLayout foreach (PowerPoint.Shape pptShape in Present.SlideMaster.Shapes)
{
if (MsoTriState.msoFalse == pptShape.HasTextFrame) continue;
if (MsoTriState.msoFalse == pptShape.TextFrame.HasText) continue;
string str = pptShape.TextFrame.TextRange.Text;
if (str.Contains(@"▲"))
{
pptShape.TextFrame.TextRange.Text = "A";
break;
}
}
foreach (PowerPoint.CustomLayout layout in Present.SlideMaster.CustomLayouts)
{
foreach (PowerPoint.Shape pptShape in layout.Shapes)
{
if (MsoTriState.msoFalse == pptShape.HasTextFrame) continue;
if (MsoTriState.msoFalse == pptShape.TextFrame.HasText) continue;
string str = pptShape.TextFrame.TextRange.Text;
if (str.Contains(@"▲"))
{
pptShape.TextFrame.TextRange.Text = "A";
break;
}
}
}
Present.SlideMaster.CustomLayouts[0].Background.TextFrame.TextRange.Text
PPT发布出去啊 我先试试哈~
Present.SlideMaster.CustomLayouts[0].Background.TextFrame.TextRange.Text 这两个都替换了,得不到我需要的文本。
能不能给点思路啊,另外Present.SlideMaster.Background得到的是母版中一页的背景图吧?其他的如何获得呢?