Dim m As MSHTML.HTMLDocument, d As Object
Set m = New MSHTML.HTMLDocument
Set d = m.createDocumentFromUrl("http://www.quicken.com", vbNullString)
Do
DoEvents
Loop While d.readyState <> "complete"
Text1.Text = d.documentElement.outerHTML
However, when you dim m as an object (which is what you do in IIS) it is no
longer able to find the CreateDocumentFromUrl method. Can someone please
help??
Thanks, Jay Kappel
PS - The IIS version that does not work but should is...
Dim m, d
Set m = New MSHTML.HTMLDocument
Set d = m.createDocumentFromUrl("http://www.quicken.com", vbNullString)
Do
'DoEvents
Loop While d.readyState <> "complete"
Response.Write d.documentElement.outerHTML
Also, is there something special I need to do so that the MSHTML library is
available to ASP scripts? I figure there may be an IIS modification I need
to do.
But you can try this code in ASP I think this will help..
<%
Set objXML = server.CreateObject("Microsoft.XMLHTTP")
objXML.Open "Get", "http://www.quicken.com", False
objXML.send
strbody = objXML.responseText
Set objXML = nothing
Response.Write strbody
%>
"Jay Kappel" <ja...@paramountfarming.com> wrote in message
news:OTf1w5s...@TK2MSFTNGP11.phx.gbl...
Again any help Greatly Appreciated!
"F@yy@Z" <fayyaz...@mvwebmaker.com> wrote in message
news:elXLkDt...@TK2MSFTNGP09.phx.gbl...
According to this, it seems it is not possible:
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&c2coff=1&threadm=%23mgwkSWXBHA.1608%40tkmsftngp05&rnum=6&prev=/groups%3Fq%3DMSHTML.HTMLDocument%2520ASP%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26c2coff%3D1%26sa%3DN%26tab%3Dwg
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Here are the hosting companies:
http://www.3shost.com/commandmatrix.html
http://www.spaceforhosting.com/pages/reseller/windows/index.php
http://www.hostonnet.com/windows_reseller.php
etc..
Still searching...
"Bob Barrows [MVP]" <reb0...@NOyahoo.SPAMcom> wrote in message
news:e7w49ptL...@tk2msftngp13.phx.gbl...
Jay Kappel
"Bob Barrows [MVP]" <reb0...@NOyahoo.SPAMcom> wrote in message
news:uPXCsrtL...@tk2msftngp13.phx.gbl...
So if class is made up of the appname.object type then
CreateObject("mshtml.HTMLDocument") should do it according th VBs object
browser. The problem is that I get: Microsoft VBScript runtime error
'800a01ad' as a result. Here is what Microsoft has to say about it:
This error is usually generated because dynamic-link libraries (DLLs) on
which the COM object depends are one of the following:
a.. Missing from the system
b.. Not in the system path
c.. Not accessible by the system because of security settings
Well, It's not missing, it's in the system32 path, but I have no idea what
security settings to look at. Can anyone help??
Thanks, Jay Kappel
"Jay Kappel" <ja...@paramountfarming.com> wrote in message
news:OTf1w5s...@TK2MSFTNGP11.phx.gbl...
Where is the scripting running on? Client side or server side? If server
side, you can't do that since the DOM is a client-side thing, within the
browser. It doesn't exist on the server, and you can't access it from the
server to the client.
Have you though of the following methods?
1) Use XMLHttp object to get the content of the string and then parse it by
using the method at
http://msdn.microsoft.com/downloads/samples/internet/default.asp?url=/downlo
ads/samples/internet/browser/walkall/default.asp.
The above WALKALL sample demonstrates the use of MSHTML as a UI-less HTML
parser.
2) As
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&c2coff=1&threadm
=mKdBZma%24CHA.2252%40cpmsftngxa08.phx.gbl&rnum=30&prev=/groups%3Fq%3DMSHTML
.HTMLDocument%2Basp%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26c2coff%3D1
%26start%3D20%26sa%3DN mentioned, use a AxWebBrowser to act as the client
side. We'll have the AxWebBrowser.Navigate() to retrieve some URLs back. So
we can get DOM object in OnDocumentComplete method.
Hope that helps.
Best regards,
Yanhong Huang
Microsoft Community Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
I did some investigating and the consensus seems to be that to access
mshtml.dll from ASP (Classic), you need to create a COM wrapper. A recurring
theme in the google threads I reads seems to be the difficulty people
encountered with the asynchonous nature of retreiving remote content via
mshtml.dll. As such here's how I might approach it. Create a Windows
Scripting Component (WSC) that does the following:
1. Instantiate an MSHTML.HTMLDocument object
2. Instantiate an MSXML.ServerXMLHTTP object
3. Retreive the remote content using the ServerXMLHTTP object and pass it as
a stream using the responseStream property to the IPeristStreamInit
interface that the HTMLDocument implements.
4. "Walk" the DOM represented by the HTMLDocument and perform any
manipulation necessary
5. You can then stream the modified content directly to the ASP.Response
object since it also implements the IStream interface. Or you could simply
return a string, or save it to a file, etc...
Notes:
1. I realize the above is simply a bunch of hand waving. Time permitting, I
will try to followup with a proof of concept, unless of course you beat me
to it. :)
2. Windows Scripting Components feels like a good fit here. They are
honest-to-goodness COM objects that don't need to be registed, or more
precisely, can be registered dynamically.
3. By using the ServerXMLHTTP instead of HTMLDocument to retreive the remote
content, you bypass all the ugliness of instantiating wininet.dll. This is
nice since all you really wanted was the parsing ability of mshtml.dll.
Interested to see what you come up with.
-Chris Hohmann
I wanted to do a simular thing myself once, and didn't find any way of
achieving this either using serverside ASP.
I ended up shifting the whole thing clientside, where I let the whole
DOM manipulation being handled by clientside JavaScript, which was
fine what I wanted to do.
One other possible way I can think of to be able to do something
serverside, is by converting the HTML documents to XHTML, which will
make it possible to access them using the XML DOM objects.
Thanks You!!! Finally someone who understands what I am asking.
The approach you came up with sounds really great to me, and I will get
working on it today. The only problem is that I do not know how to create a
windows scripting component. I am sure google will have something to say
about that.
Also, If you are able to do a "proof of concept" I would be really
appreciative of that as well. Thanks so much..
Jay Kappel
"Chris Hohmann" <nos...@thankyou.com> wrote in message
news:e%23o22qNM...@TK2MSFTNGP11.phx.gbl...
Yeah, it's both a blessing and a curse that WSC doesn't get much attention.
A blessing because most hosting services are unawares that this technology
allows developers to dynamically register their own custom components, but a
curse because there are few examples that showcase the potential of WSC. One
shining exception are the WSC articles at the http://4guysfromrolla.com
site. Just do a search on "WSC". Also, here's a link to the documentation at
the MSDN Library:
http://msdn.microsoft.com/library/en-us/script56/html/lettitle.asp
If you control the box that IIS is running on and the component will not be
changing frequently there's no reason you could create the component is
VB/C++ if you're more comfortable in those environments. You would also see
a performance gain as componenets in those languages would be precompiled.
Also, if you have the .NET framework installed, it becomes a moot point as
you could reference mshtml directly from an ASP.NET app.
> Also, If you are able to do a "proof of concept" I would be really
> appreciative of that as well. Thanks so much..
It's been a tough weekend. Pulled an all-nighter last night and will need to
crash pretty soon. First work then "play". It's unlikely I would be able to
devote any time to this until the weekend.
-Chris Hohmann
> If you control the box that IIS is running on and the component will not
be
> changing frequently there's no reason you could create the component is
> VB/C++ if you're more comfortable in those environments. You would also
see
> a performance gain as componenets in those languages would be precompiled.
What a trainwreck! That should read, "...there's no reason you COULDN'T
create the component IN VB/C++ if you're more comfortable in those
environments. You would also see a performance gain as COMPONENTS in those
languages would be precompiled." I really need to get some sleep. :)
-Chris Hohmann
Ok, so how do I get access to the IPersistStreamInit interface that the HTML
Document inplements?
Thanks...
"Chris Hohmann" <nos...@thankyou.com> wrote in message
news:eOho8TTM...@TK2MSFTNGP09.phx.gbl...
You have to go through the QueryInterface method of the IDispatch interface
that HTMLDocument inherits from. Here are two (2) examples from the MSDN
site:
Reusing MSHTML : Loading HTML and Referenced Data:
http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/hosting/hosting.asp?frame=true#Loading_HTML_and_Ref
WebBrowser Control : Loading HTML content from a Stream
http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/webbrowser/tutorials/webocstream.asp
Do you still have any more concerns on this problem? If there is any we can
do for it, please feel free to post here. Thanks.
So, I have tired many ways to skin this darn cat.... None are working!
Any help is always appreciated!
Jay Kappel
"Yan-Hong Huang[MSFT]" <yhh...@online.microsoft.com> wrote in message
news:6vKIQZkM...@cpmsftngxa10.phx.gbl...
Have you tried implement those VB 6 code into one ActiveX control and then
use them in your asp code? That could be a workaround for you.
Thanks very much.
Also, I tried the approach using the microsoft html object library. With
this approach, it works awesome when I call the dll from a vb application,
but does not work at all when called from ASP. Any Ideas?
Thanks.
"Yan-Hong Huang[MSFT]" <yhh...@online.microsoft.com> wrote in message
news:7gp4QQxM...@cpmsftngxa10.phx.gbl...
I have an activex dll that does what I need it to do. I have created an
ASP page that uses that dll. On my windows XP Professional machine I have
registered the dll and used my local web server to browse the asp page. The
good news is that it works GREAT! The page completes in 3-4 seconds.
However when I transfer the dll and the ASP page to a Windows Web 2003
server it jumps up to a whopping 54 seconds!
I am wondering if this could have something to do with the enhanced
browsing security implemented by default on the Web Server 2003? It appears
that this enhanced setting is profile based, so setting it back to a normal
level for my admin account does not help the IUSR_MachineName account. Does
anyone know how I can change this setting for the IUSR account? And is
there a registry key or something that I can have my com object change and
then flip back when it's done. Will the com object have the appropriate
security rights to perform this action? And lastly am I barking up the
wrong tree?
Thanks, Jay Kappel
"Yan-Hong Huang[MSFT]" <yhh...@online.microsoft.com> wrote in message
news:7gp4QQxM...@cpmsftngxa10.phx.gbl...
This is quite strange due to the performance drop on Win2003 . If you feel
it is related to IE Enhanced Security Configuration, please uninstall it in
control panel->Add/Remove programs->Add/Remove Windows Components, then
test it again to see if it helps.
Looking at the nature of this issue, it would require intensive
troubleshooting which would be done quickly and effectively with direct
assistance from a Microsoft Support Professional through Microsoft Product
Support Services. I suggest you contact Microsoft Product Support directly
to discuss additional support options you may have available, by contacting
us at 1-(800)936-5800 or by choosing one of the options listed at
http://support.microsoft.com/default.aspx?scid=sz;en-us;top. As a MSDN
subscriber, you have two free support incidents.