Also posted to microsoft.public.inetsdk.programming.webbrowser_ctl.
1. I'm wondering if any of my fellow Access developers have had any luck
getting the WebBrowser control to properly resize.
I'm finding that if I add the control to a form and set it's size, once I've
opened the browser it's size if forever-after locked at the first opened
size.
I'm trying to use:
Private Sub Form_Resize()
Me!WebBrowser1.Move 0, 600, Me.Width, Me.Section(0).Height - 600
End Sub
600 is the height of the navigation control set.
2. I thought I had a working solution for saving the current document to
file without prompting the user using this approach:
http://support.microsoft.com/default.aspx?scid=KB;en-us;q244757, but it
doesn't give me the same page as doing a Save As.
Has anyone been able to get at the current page HTML using the
WebBrowser.Document property, or by some other means?
Patrick
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Patrick Jackman
Vancouver, BC
604-874-5774
Alex Dybenko - 03 Aug 2007 09:26 GMT
Hi,
have you tried to use left, top, width. height properties?
Is your control inserted directly on a form or tab control?

Signature
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com
> Also posted to microsoft.public.inetsdk.programming.webbrowser_ctl.
>
[quoted text clipped - 25 lines]
> Vancouver, BC
> 604-874-5774
David W. Fenton - 06 Aug 2007 23:00 GMT
> Also posted to
> microsoft.public.inetsdk.programming.webbrowser_ctl.
[quoted text clipped - 5 lines]
> once I've opened the browser it's size if forever-after locked at
> the first opened size.
What yuo do is insert the web browser control. Size it. Save the
form. Close it, open it again, resize it and then cut and paste it
back in.
Yes, it's really weird!

Signature
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Sascha Trowitzsch - 23 Aug 2007 17:13 GMT
Hi,
> Also posted to microsoft.public.inetsdk.programming.webbrowser_ctl.
>
[quoted text clipped - 18 lines]
> Has anyone been able to get at the current page HTML using the
> WebBrowser.Document property, or by some other means?
1. AKAIK there's no known solution for the resize problem with the webbrowser
control in access forms.
Workaround: As this problem is strictly related to access forms but does not
occur for other containers do the following:
First place a "Microsoft Forms 2.0 Frame" ActiveX control on the form which will
serve as a container for the webcontrol. Doubleclick it to change in edit mode.
Then in the uppopping toolbox rightclick under the controls collection an click
"More controls...". Choose MS Webbrowser from list and check it - click OK . A
new icon for the webbrowser control will now appear in toolbox. Click it and
draw a rectangle in die frame control.
Now you can resize the web control either in forms design mode or using VBA
code. (To reference the control, e.g.:
Me.Frame1.Object.Controls("Webbrowser1").Height ...unit is pixels)
2. You can save a HTMLDocument if you have a definition for the IPersistFile
interface in any library of your projects references:
Private Sub SaveHTMLDoc(sFilename as String)
Dim IPF As IPersistFile
Set IPF = Me!Webbrowser1.Object.Document
IPF.Save sFilename, False
Set IPF = Nothing
End Sub
A libray with an IPersistfile definition is the accwiz.dll in office folder. Put
it in your references and change above code replacing IPersistFile with
IWizPersistfile.
Ciao, Sascha
Patrick Jackman - 19 Oct 2007 17:06 GMT
Wow. Thanks very very much for this information Sascha. I had given up on
finding a solution to the problem.
I'll give this a try in the next few days and let you know how it goes.
Sincerely,
Patrick Jackman
Hi,
"Patrick Jackman" <pjackman@wimse.com> schrieb im Newsbeitrag
news:ese88$T1HHA.4672@TK2MSFTNGP05.phx.gbl...
> Also posted to microsoft.public.inetsdk.programming.webbrowser_ctl.
>
[quoted text clipped - 19 lines]
> Has anyone been able to get at the current page HTML using the
> WebBrowser.Document property, or by some other means?
1. AKAIK there's no known solution for the resize problem with the
webbrowser
control in access forms.
Workaround: As this problem is strictly related to access forms but does not
occur for other containers do the following:
First place a "Microsoft Forms 2.0 Frame" ActiveX control on the form which
will
serve as a container for the webcontrol. Doubleclick it to change in edit
mode.
Then in the uppopping toolbox rightclick under the controls collection an
click
"More controls...". Choose MS Webbrowser from list and check it - click OK .
A
new icon for the webbrowser control will now appear in toolbox. Click it and
draw a rectangle in die frame control.
Now you can resize the web control either in forms design mode or using VBA
code. (To reference the control, e.g.:
Me.Frame1.Object.Controls("Webbrowser1").Height ...unit is pixels)
2. You can save a HTMLDocument if you have a definition for the IPersistFile
interface in any library of your projects references:
Private Sub SaveHTMLDoc(sFilename as String)
Dim IPF As IPersistFile
Set IPF = Me!Webbrowser1.Object.Document
IPF.Save sFilename, False
Set IPF = Nothing
End Sub
A libray with an IPersistfile definition is the accwiz.dll in office folder.
Put
it in your references and change above code replacing IPersistFile with
IWizPersistfile.
Ciao, Sascha
David Windler - 25 Oct 2007 22:51 GMT
Your work-around works really well. Thanks.
I am trying to print the contents of the webcontrol using ExecWb but I just get a syntax error. I'm not sure how to properly connect to the webcontrol to use ExecWb (it easily works for a webcontrol not inside a Frame).
Me.Frame1.Object.Controls("webbrowser1").ExecWb(6,2)
EggHeadCafe - .NET Developer Portal of Choice
http://www.eggheadcafe.com