After messing with this I think I have the solution. I forced a "set" on the object like this:
Private Sub Form_Load()
Dim objBrowser As Object
Set objBrowser = Me.WebBrowser3.Object
With objBrowser.Document
.Open
.Write "<HTML> <H1> hello world! </H1> </HTML>"
.Close
End With
Set objBrowser = Nothing
End Sub
Regards,
Bill Mosca
From: MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io> On Behalf Of ozairkhalidozair
Sent: Thursday, May 27, 2021 5:42 AM
To: MSAccessProfessionals@groups.io
Subject: [MSAccessProfessionals] Display HTML content from Table in Webbrowser Control
[Edited Message Follows]
Hi all,
I found an interesting article and liked the idea very much.
https://www.devhut.net/2019/10/18/everything-you-never-wanted-to-know-about-the-access-webbrowser-control/
From this tutorial, I am actually interested in Dynamic Content on the Fly.
Unfortunately its not working in my file.
All I see is "Object variable or With block variable not set"
Can someone please help?
Copied Code
Private Sub Form_Current()
With Me.WebBrowser0.Object.Document
.Open
.Write "<HTML> <H1> hello world! </H1> </HTML>"
.Close
End With
End Sub
System Detail
Office 2016 64 Bit
Windows 10 64 Bit
EDIT : Not sure if it was needed but I already added Reference for "Microsoft HTML Object Library" anyway.
Best,
Ozair