CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2000
    Posts
    3

    Opening Powerpoit file through VB

    I would like to get the coding for opening a powerpoint file from visual basic program.

    S.Jacob


  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: Opening Powerpoit file through VB

    use the ShellExecute API and pass the name of the PPT file as argument:

    option Explicit
    private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (byval hwnd as Long, byval lpOperation as string, byval lpFile as string, byval lpParameters as string, byval lpDirectory as string, byval nShowCmd as Long) as Long
    private Const SW_SHOWNORMAL = 1

    private Sub Command2_Click()
    Call ShellExecute(me.hwnd, "open", "myfile.ppt", vbNullString, vbNullString, SW_SHOWNORMAL)
    End Sub



    ...this works, if PPT files are associated with powerpoint



  3. #3
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    Re: Opening Powerpoit file through VB

    The article here http://support.microsoft.com/support...NG=ENG&SA=MSDN demonstrates how to automate PP (2000) using VB.

    Chris Eastwood

    CodeGuru - the website for developers
    http://codeguru.developer.com/vb

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

Featured