Afficher un message
Vieux 17/01/2008, 05h33   #4 (permalink)
MichelXld
XLDnaute Barbatruc
 
Date d'inscription: février 2005
Messages: 3 643
Par défaut Re : Visualisation d'un doc PDF dans le webbrowser de mon userform

bonjour


Tu peux utiliser ce type de procédure pour forcer l'affichage dans le webborwser. ça fonctionne pour les pages html mais je n'ai pas testé pour d'autres types de fichiers:

Code:
Dim WithEvents cible As SHDocVw.WebBrowser_V1

Private Sub cible_NewWindow(ByVal URL As String, _
    ByVal Flags As Long, ByVal TargetFrameName As String, _
    PostData As Variant, ByVal Headers As String, Processed As Boolean)
    Processed = True
    WebBrowser1.Navigate URL
End Sub

Private Sub UserForm_Initialize()
    'source : KBAlertz.com: (185538) - When hosting the Internet Explorer 4.x or later WebBrowser control in a Visual Basic application, you may want to have the navigation always occur in your application and not other Internet Explorer windows. If you handle the
    Set cible = WebBrowser1
    WebBrowser1.Navigate2 ThisWorkbook.Path & "\MonDoc.pdf"
End Sub

Bonne journée
MichelXld
MichelXld est déconnecté   Réponse avec citation