Jumat, 28 Mei 2021

Re: [MSAccessProfessionals] Display HTML content from Table in Webbrowser Control

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

Re: [MSAccessProfessionals] Display HTML content from Table in Webbrowser Control

 Ozair,
There is a little Quote Post bubble on the left of the format bar above where you type. The first task before typing anything into a reply is to click the bubble which places the previous posts into the reply. Then type your response at the top of the message.

Regards,
Duane

On Fri, May 28, 2021 at 05:09 AM, ozairkhalidozair wrote:

Graham,

Thanks.
I am sorry I have no idea how to include or skip the whole thread
I simply wrote my answer and pressed the little green "Reply to Group" button located at the left bottom.
I am writing it from their website groups.in/g/MSAccessProfessionals/

Please educate me

OK - about the solution.

I tried many combinations that I could have think of.

But had to switch to another thread from another group - that worked in my case.
https://www.access-programmers.co.uk/forums/threads/display-html-code-in-web-browser.289555/

Best,
Ozair

 

_._,_._,_

Groups.io Links:

You receive all messages sent to this group.

View/Reply Online (#116005) | Reply To Group | Reply To Sender | Mute This Topic | New Topic
Your Subscription | Contact Group Owner | Unsubscribe [sugeng.panjalu.access@blogger.com]

_._,_._,_

Re: [MSAccessProfessionals] Display HTML content from Table in Webbrowser Control

Graham,

Thanks.
I am sorry I have no idea how to include or skip the whole thread
I simply wrote my answer and pressed the little green "Reply to Group" button located at the left bottom.
I am writing it from their website groups.in/g/MSAccessProfessionals/

Please educate me

OK - about the solution.

I tried many combinations that I could have think of.

But had to switch to another thread from another group - that worked in my case.
https://www.access-programmers.co.uk/forums/threads/display-html-code-in-web-browser.289555/

Best,
Ozair

 

_._,_._,_

Groups.io Links:

You receive all messages sent to this group.

View/Reply Online (#116004) | Reply To Group | Reply To Sender | Mute This Topic | New Topic
Your Subscription | Contact Group Owner | Unsubscribe [sugeng.panjalu.access@blogger.com]

_._,_._,_

Kamis, 27 Mei 2021

Re: [MSAccessProfessionals] Display HTML content from Table in Webbrowser Control

Hi Ozair

Please quote all the previous conversation when you post an answer, so we can see the whole thread.

When the code stops at the error, and ".Open" is highlighted, what happens if you type in the Immediate window:

?Me.
WebBrowser0.Object

It should return with:
Microsoft Web Browser Control

If not, perhaps it is not a web browser control you have on your form.

(By the way, the code, copied and pasted from your question, works perfectly for me.)

Best wishes,
Graham Mandeno [Access MVP 1996-2017]

From: MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io> On Behalf Of ozairkhalidozair
Sent: Friday, 28 May 2021 16:42
To: MSAccessProfessionals@groups.io
Subject: Re: [MSAccessProfessionals] Display HTML content from Table in Webbrowser Control

 

Bill,

Thanks for your input.

Yes IntelliSense finds the webbrowser control name correctly. (As to confirm, I renamed it to "MyWebBrowserControl").
The error appears on first row AFTER "With" clause i.e. [.Open].

Any ideas?
Best,
Ozair

Re: [MSAccessProfessionals] Display HTML content from Table in Webbrowser Control

Bill,

Thanks for your input.

Yes IntelliSense finds the webbrowser control name correctly. (As to confirm, I renamed it to "MyWebBrowserControl").
The error appears on first row AFTER "With" clause i.e. [.Open].

Any ideas?
Best,
Ozair
_._,_._,_

Groups.io Links:

You receive all messages sent to this group.

View/Reply Online (#116002) | Reply To Group | Reply To Sender | Mute This Topic | New Topic
Your Subscription | Contact Group Owner | Unsubscribe [sugeng.panjalu.access@blogger.com]

_._,_._,_

Re: [MSAccessProfessionals] Display HTML content from Table in Webbrowser Control

see this demo.
open the form.
view the code behind the form.

Virus-free. www.avast.com

On Fri, May 28, 2021 at 3:16 AM Bill Mosca <wrmosca@comcast.net> wrote:

Ozair

 

Interesting idea. Often, copy and paste fails because of differently named controls. I noticed is the name of your web browser control is "WebBrowser0". Is that correct? Is the IntelliSense find it when you type "Me."?

 

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



--
Arnelito G. Puzon


_._,_._,_

Groups.io Links:

You receive all messages sent to this group.

View/Reply Online (#116007) | Reply To Group | Reply To Sender | Mute This Topic | New Topic
Your Subscription | Contact Group Owner | Unsubscribe [sugeng.panjalu.access@blogger.com]

_._,_._,_

Re: [MSAccessProfessionals] Display HTML content from Table in Webbrowser Control

Ozair

 

Interesting idea. Often, copy and paste fails because of differently named controls. I noticed is the name of your web browser control is "WebBrowser0". Is that correct? Is the IntelliSense find it when you type "Me."?

 

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