منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب

نسخة كاملة : تشغيل بور بوينت فى فيجوال بيسك 2010
أنت حالياً تتصفح نسخة خفيفة من المنتدى . مشاهدة نسخة كاملة مع جميع الأشكال الجمالية .
اريد تشغيل عرض بور بوينت فى فيجوال بمجرد الضغط على الزرار فيجوال 2010
كود :
<DllImport("user32.dll", EntryPoint := "FindWindow", SetLastError := True)> _
Private Shared Function FindWindow(ZeroOnly As IntPtr, lpWindowName As String) As IntPtr
End Function
<DllImport("user32.dll", SetLastError := True)> _
Private Shared Function SetParent(hWndChild As IntPtr, hWndNewParent As IntPtr) As IntPtr
End Function
<DllImport("user32.dll", SetLastError := True, CharSet := CharSet.Auto)> _
Public Shared Function SetWindowText(hwnd As IntPtr, lpString As [String]) As Boolean
End Function
Private FileName As String = ""
Private application As PowerPoint.Application
Private presentation As PowerPoint.Presentation
Private flag As Boolean = False
Public Sub New()
    InitializeComponent()
End Sub
Public Sub open()
    sair()
    openFileDialog1.Filter = "Powerpoint file (*.ppt)|*.ppt|All files (*.*)|*.*"
    If openFileDialog1.ShowDialog() = DialogResult.OK Then
        FileName = openFileDialog1.FileName
        Dim screenClasshWnd As IntPtr = DirectCast(0, IntPtr)
        Dim x As IntPtr = DirectCast(0, IntPtr)
        flag = True
        application = New PowerPoint.Application()
        presentation = application.Presentations.Open2007(FileName, Microsoft.Office.Core.MsoTriState.msoTrue, Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoTrue)
        Dim sst1 As PowerPoint.SlideShowSettings = presentation.SlideShowSettings
        sst1.ShowType = DirectCast(1, PowerPoint.PpSlideShowType)
        Dim sw As PowerPoint.SlideShowWindow = sst1.Run()
        sw.Height = (panel1.Height) - 64
        sw.Width = (panel1.Width) - 130
        Dim formhWnd As IntPtr = FindWindow(x, "Form1")
        Dim pptptr As IntPtr = DirectCast(sw.HWND, IntPtr)
        screenClasshWnd = FindWindow(x, "screenClass")
        SetParent(pptptr, panel1.Handle)
        Me.Focus()
        Me.application.SlideShowEnd += New Microsoft.Office.Interop.PowerPoint.EApplication_SlideShowEndEventHandler(SlideShowEnds)
    End If
End Sub

والله أعلي وأعلم
RolleyesRolleyesRolleyes
قم بتحميل وتنصيب القارئ علي جهازك أولا
PowerPoint Viewer 2007

RolleyesRolleyesRolleyes
انا نزلت البرنامج ووضعت الزار لكن محصلش حاجة وطلع اكتر 13 خطا ممكن شرح اذا كان هناك ادوات اضعها او اغير اسماءها