Example 1 Continuous scrolling
Add below code to form
Option Compare Database
Private Sub Command9_Click()
Dim mbody As String
' add the text of amrquee and creat a html webpage
mbody = "<p style=""font-size:18px;""><marquee behavior=""scroll"" direction=""left"">www.excelvbamacros.com</marquee>"
Open CurrentProject.Path & "\marquee_sample1.htm" For Output As #1
Print #1, mbody
Close #1
' add the webpage to webbrowser
Me.WebBrowser1.Navigate CurrentProject.Path & "\marquee_sample1.htm"
End Sub
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
On Error Resume Next
Me.WebBrowser1.Document.body.scroll = "no"
End Sub
Example 2 Bouncing Marquee
Add below code to form
Option Compare Database
Private Sub Command9_Click()
Dim mbody As String
' add the text of amrquee and creat a html webpage
mbody = "<p style=""font-size:18px;""><marquee behavior=""alternate"" direction=""left"">www.excelvbamacros.com</marquee>"
Open CurrentProject.Path & "\marquee_sample2.htm" For Output As #1
Print #1, mbody
Close #1
' add the webpage to webbrowser
Me.WebBrowser1.Navigate CurrentProject.Path & "\marquee_sample2.htm"
End Sub
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
On Error Resume Next
Me.WebBrowser1.Document.body.scroll = "no"
End Sub