'Chemin à modifier pour affiche le GIF
img.src = "C:\TEMP\porte de sortie.gif"
Private Sub UserForm_Activate()
Caption = Space(28) & Application.Proper(Format(Now, "dddd dd mmmm yyyy")) & " - il est : " & Format(Now, "hh:mm")
CommandButton2.SetFocus
With WebBrowser1
.Width = Frame1.Width + 15
.Height = Frame1.Height + 15
.Navigate "about:blank"
Do While .ReadyState < 4: DoEvents: Loop
With .Document
.Body.Style.margin = 0
Set img = .Body.appendchild(.createelement("img"))
With img
'********************************************
'Chemin à modifier pour affiche le GIF
.src = ThisWorkbook.Path & "\porte de sortie.gif"
'********************************************
.Style.Height = "80%"
.Style.Width = "100%"
End With
End With
Debug.Print .Document.getelementsbytagname("HTML")(0).outerhtml
End With
End Sub
Private Sub UserForm_Activate()
Me.WebBrowser1.Navigate "D:\TEMP\porte de sortie.gif"
End Sub
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Me.WebBrowser1.Document.Body.Style.Border = "none"
End Sub
Private Sub WebBrowser1_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
Dim images As Object, img As Object
Me.WebBrowser1.Document.Body.Scroll = "no"
Me.WebBrowser1.Document.Body.TopMargin = "0"
Me.WebBrowser1.Document.Body.BottomMargin = "0"
Me.WebBrowser1.Document.Body.LeftMargin = "0"
Me.WebBrowser1.Document.Body.RightMargin = "0"
Set images = Me.WebBrowser1.Document.GetElementsByTagName("img")
Set img = images(0)
img.Style.Height = "100%"
img.Style.Width = "100%"
End Sub
Private Sub UserForm_Activate()
affiche_image "C:\Users\patricktoulon\Downloads\porte de sortie.gif"
End Sub
Private Sub affiche_image(fichierImG)
With WebBrowser2
.Navigate "about:blank"
Do While .ReadyState < 4: DoEvents: Loop
With .Document
.Body.Scroll = "no"
.Body.Style.margin = 0
Set img = .Body.appendchild(.createelement("img"))
With img
.src = fichierImG
.Style.Height = "100%"
.Style.Width = "100%"
End With
End With
End With
End Sub
Private Sub UserForm_Activate()
affiche_image2 "C:\Users\patricktoulon\Downloads\porte de sortie.gif"
End Sub
Private Sub affiche_image2(FichierImG)
Dim images As Object, img As Object
With WebBrowser1
.Navigate FichierImG
Do While .ReadyState < 4: DoEvents: Loop 'navigate complete
With .Document.Body
.Scroll = "no"
.TopMargin = "0"
.BottomMargin = "0"
.LeftMargin = "0"
.RightMargin = "0"
.Style.Border = "none"
Set img = .all(0)
img.Style.Height = "100%"
img.Style.Width = "100%"
End With
End With
End Sub