Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

lucasrocha

OCX do PowerPoint

Recommended Posts

Alguem conhece alguma OCX que permita visualizar um PPT no VB. Já concegui criando uma intacia do Powerpoint e referenciando em um componente Picture.Mas gostaria de uasr algo mais especifico.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Sub Monta_PowerPoint()On Error GoTo TrataDim lngRet As LongDim ArquivoPPT As String 'start Powerpoint and reparent it to the picturebox Set pptApp = New PowerPoint.Application hwndPpt = FindWindow("Pp10FrameClass", vbNullString) lngRet = SetParent(hwndPpt, Me.pic.hWnd) ArquivoPPT = "\\cmspbdes02\teste powerpoint\PPT2\ApresTest4.ppt" 'open the presentation and set slideshow settings so it doesn't appear fullscreen With pptApp.Presentations.Open(ArquivoPPT, ReadOnly:=True, untitled:=msoFalse, withwindow:=msoFalse) DoEvents Set presDif = pptApp.Presentations.Item(1) .SlideShowSettings.ShowType = ppShowTypeSpeaker With .SlideShowSettings.Run 'the measurements need to be converted from twips to points - not pixels! 'the 1.3 is an approximation, just to demonstrate that the rest of the code works .Width = Me.pic.Width / Screen.TwipsPerPixelX / 1.3 .Height = Me.pic.Height / Screen.TwipsPerPixelY / 1.3 .Top = 0 .Left = 0 End With DoEvents End With ''reparent the slideshow window to the picturebox hwndShow = FindWindow("screenClass", vbNullString) DoEvents lngRet = SetParent(hwndShow, Me.pic.hWnd)Exit SubTrata: MsgBox "Ocorreu um erro: " & Error & " - Número: " & Err Fecha_Apresentacao Exit Sub ResumeEnd Sub

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.