Page 2 of 2 FirstFirst 12
Results 41 to 44 of 44

Thread: [2008] Display powerpoint slides on form and run slides from form

  1. #41
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  2. #42
    New Member
    Join Date
    Sep 2008
    Posts
    1

    Re: [2008] Display powerpoint slides on form and run slides from form

    ..............
    Last edited by jdchitt; Oct 22nd, 2008 at 07:55 PM. Reason: .

  3. #43
    New Member
    Join Date
    Nov 2008
    Posts
    2

    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?

  4. #44
    New Member
    Join Date
    Nov 2008
    Posts
    2

    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.

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width