目前有两个方案,都有所不足。
一、用自带的Server类组件,通过PPT直接打开,缺点是无法嵌入窗口中,只能全屏显示
二、用内嵌IE控件打开,效果不错,但受到不同IE版本、Windows版本和OFFICE版本的限制,有时不能直接打开,只能下载保存。请问各位有没有什么更好的办法在Delphi窗口中查看PPT文件?
一、用自带的Server类组件,通过PPT直接打开,缺点是无法嵌入窗口中,只能全屏显示
二、用内嵌IE控件打开,效果不错,但受到不同IE版本、Windows版本和OFFICE版本的限制,有时不能直接打开,只能下载保存。请问各位有没有什么更好的办法在Delphi窗口中查看PPT文件?
如果想追求完美,估计只有自己解析ppt文件了
一般都是Office版本、IE设置原因,可以把最新的Office查看器及IE的设置脚本打包在安装文件中,并在文档中说明
虽然没试过,但是打开的窗体有句柄么?用setparent调整下不行么?
Posted by spunkyvt in PowerPoint, Programming.
Tags: Automation, dsoFramer, PowerPoint, zero Flash
2 comments
After much searching and digging. I have finally found a solution. First you must download the dsoFramer active x control from microsoft. After that we can code.Place the Framer on the Form.Add a reference to the InteropServices. ie.using System.Runtime.InteropServices;Add this DllImport[DllImport("user32.dll", EntryPoint = "LockWindowUpdate", SetLastError = true,
ExactSpelling = true, CharSet = CharSet.Auto,
CallingConvention = CallingConvention.StdCall)]
private static extern long LockWindow(long Handle);Add a button to the Formand put this code in button clickFramer.FrameHookPolicy = DSOFramer.dsoFrameHookPolicy.dsoSetOnFirstOpen;LockWindow(Framer.Handle.ToInt32());
Framer.Open(@”c:\Presentation1.ppt”);Framer.Activate();
SendKeys.Send(“{F5}”);
Framer.BackColor = Color.Black;
LockWindow(IntPtr.Zero.ToInt32());You now have a functioning slideshow inside of your form.If you need control over the slideshow?????????Well add a reference to you favorite Powerpoint Dlladd using PowerPoint = Microsoft.Office.Interop.PowerPoint;Define a variablePowerPoint.Presentation pres;In the button click add thispres = (PowerPoint.Presentation)Framer.ActiveDocument;It’s crazy but you would have to pay 999 from EDraw Office Viewer Component for this same functionality.MEOUCH!!!!!!!