Re: [2008] Display powerpoint slides on form and run slides from form
The path can be anywhere as its a user choice. Dont rely upon defaults or you wil run into problems down the road. Never hard code in afile path.
Re: [2008] Display powerpoint slides on form and run slides from form
Re: [2008] Display powerpoint slides on form and run slides from form
Nobody know?
If we are use Mads solution..
Is a way to autosize the powerpoint slide so that it fits within Panel1 ? Or size PPTVIEW window from command line?
Re: [2008] Display powerpoint slides on form and run slides from form
ok, i do it myself :)
user must have PowerPoint in his computer. I do it in C#, not all commend is necessary ofkors and PrimaryInteropAssembly for Office must be installed. Remember to add Microsoft.Office.Interop.PowerPoint and Microsoft.Office.Core assembly to references.
Code:
public function ShowAtPanel(Panel panel)
{
string componentResourcePath = "C:\tmp\slide.ppt";
ApplicationClass PPApplication = new ApplicationClass();
//hide pp from taskbar
PPApplication.ShowWindowsInTaskbar = MsoTriState.msoFalse;
Presentation presentation =
PPApplication.Presentations.Open( componentResourcePath, MsoTriState.msoCTrue, MsoTriState.msoTrue, MsoTriState.msoFalse );
//presentation.SlideShowSettings.LoopUntilStopped = MsoTriState.msoCTrue;
SlideShowWindow slideShow = presentation.SlideShowSettings.Run();
//WinApi.SetParent it's my static function imported from winapi functions
//i don't know why when i must calibrate size
// 1 * panel.Height/Width don't look good :/
slideShow.Height = (int)( 0.85 * panel.Height );
slideShow.Width = (int)( 0.75 * panel.Width );
WinApi.SetParent( new IntPtr( m_slideShow.HWND ), panel.Handle );
//if slide show isn't "active" windows, it will be automatic paused..
slideShow.Active();
}
sorry for my english.