Results 1 to 2 of 2
  1. #1
    krausr79 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    16

    Centering an animated gif on a form - Where does the HTML go?

    I'm trying to display an animated gif in Access on a form. I did this by creating a webbrowser control and using VBA to change it's controlsource:



    Me.WebBrowser1.ControlSource = "=" & Chr(34) & "C:\DisplayGifs" & temp & Chr(34) 'set the browser to the gif

    Now I want it horizontally centered. So far I've tried creating HTML in a text file and saving it as .html:

    <html><head></head><body><center><img src="C:\DisplayGifs\GifName.gif"></center></body></html>

    This does what I want when I open it in a browser, but I don't know how to feed the HTML into the webbrowser control. I'm going to vary the gif programmatically, so I don't want to point the control at an HTML document somewhere.

  2. #2
    krausr79 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    16
    It's not my first choice, but I'm using an external html file that I overwrite before changing.

    Sub OverwriteHTML(UseThis As String, WriteThis As String)
    Open UseThis For Output As #1
    Print #1, WriteThis
    Close #1
    End Sub

    Call OverwriteHTML("C:\DisplayGifs\Page.html", "<html><head></head><body><center><img src=" & Chr(34) & "C:\DisplayGifs" & temp & Chr(34) & "></center></body></html>")
    Me.WebBrowser1.ControlSource = "=" & Chr(34) & "C:\DisplayGifs\Page.html" & Chr(34) 'set the browser to the local page with gif

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Centering an BMP in a report
    By kroll73 in forum Reports
    Replies: 2
    Last Post: 04-16-2014, 10:50 PM
  2. Centering a Form within the Monitor screen
    By ashim in forum Programming
    Replies: 2
    Last Post: 04-13-2014, 02:20 PM
  3. Animated Start up Screen
    By bronson_mech in forum Forms
    Replies: 3
    Last Post: 12-09-2013, 03:16 PM
  4. Animated Gif on form
    By redbull in forum Forms
    Replies: 3
    Last Post: 02-19-2013, 11:22 PM
  5. making button image animated
    By chickenguru in forum Forms
    Replies: 0
    Last Post: 05-23-2012, 10:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums