PC Review


Reply
Thread Tools Rate Thread

Daily auto save Web page

 
 
hon
Guest
Posts: n/a
 
      31st Jul 2005

I have a job duty need to save daily stock data web page as .mht and .html
files (since include image).
I want to set a schdule task which can auto save the updated web page daily,
can I do that with script?

Thx a lot.


 
Reply With Quote
 
 
 
 
PaulR. Sadowski [MVP]
Guest
Posts: n/a
 
      1st Aug 2005
Hello, hon:
On Mon, 1 Aug 2005 03:44:42 +0800: you wrote...

h>
h> I have a job duty need to save daily stock data web page as .mht and
h> .html files (since include image).
h> I want to set a schdule task which can auto save the updated web page
h> daily, can I do that with script?

Does the machine have CDO installed?

'MakeMHT.vbs (not sure who I borrowed the sub SaveMessageToFile from)
URL = "http://www.paulsadowski.com/WSH/xmlhttp.htm"
Set objMessage = CreateObject("CDO.Message")
objMessage.CreateMHTMLBody URL
SaveMessageToFile objMessage, "C:\temp\test.mht"

Sub SaveMessageToFile(iMsg, Filepath)
Dim Stm
Const adTypeText = 2
Const adSaveCreateOverWrite = 2
Set Stm = CreateObject("ADODB.Stream")
Stm.Type = adTypeText ' 2
Stm.Charset = "US-ASCII"
Stm.Open
Dim iDsrc
Set iDsrc = iMsg.DataSource
iDsrc.SaveToObject Stm, "_Stream"
Stm.SaveToFile Filepath, adSaveCreateOverWrite
End Sub

For the HTML see GetHTMLSource.vbs on
http://www.paulsadowski.com/WSH/xmlhttp.htm
You'll have to modify it to save to a file rather than the STDOUT.

Regards, PaulR. Sadowski [MVP].


 
Reply With Quote
 
hon
Guest
Posts: n/a
 
      1st Aug 2005
Hello PaulR. Sadowski [MVP],

Really great ! Thanks a lot!

hon


"PaulR. Sadowski [MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello, hon:
> On Mon, 1 Aug 2005 03:44:42 +0800: you wrote...
>
> h>
> h> I have a job duty need to save daily stock data web page as .mht and
> h> .html files (since include image).
> h> I want to set a schdule task which can auto save the updated web page
> h> daily, can I do that with script?
>
> Does the machine have CDO installed?
>
> 'MakeMHT.vbs (not sure who I borrowed the sub SaveMessageToFile from)
> URL = "http://www.paulsadowski.com/WSH/xmlhttp.htm"
> Set objMessage = CreateObject("CDO.Message")
> objMessage.CreateMHTMLBody URL
> SaveMessageToFile objMessage, "C:\temp\test.mht"
>
> Sub SaveMessageToFile(iMsg, Filepath)
> Dim Stm
> Const adTypeText = 2
> Const adSaveCreateOverWrite = 2
> Set Stm = CreateObject("ADODB.Stream")
> Stm.Type = adTypeText ' 2
> Stm.Charset = "US-ASCII"
> Stm.Open
> Dim iDsrc
> Set iDsrc = iMsg.DataSource
> iDsrc.SaveToObject Stm, "_Stream"
> Stm.SaveToFile Filepath, adSaveCreateOverWrite
> End Sub
>
> For the HTML see GetHTMLSource.vbs on
> http://www.paulsadowski.com/WSH/xmlhttp.htm
> You'll have to modify it to save to a file rather than the STDOUT.
>
> Regards, PaulR. Sadowski [MVP].
>
>



 
Reply With Quote
 
David Candy
Guest
Posts: n/a
 
      2nd Aug 2005
ExecWB Method



Executes a command on an OLE object and returns the status of the command execution using the IOleCommandTarget interface.
Syntax
object.ExecWB( _
cmdID As OLECMDID, _
cmdexecopt As OLECMDEXECOPT, _
[pvaIn As Variant,] _
[pvaOut As Variant])
Parameters
cmdID
Long that represents the identifier of the command to execute. For more information on command identifiers, see MSHTML Command Identifiers.
cmdexecopt
OLECMDEXECOPT value that specifies the command options.
pvaIn
Optional. A Variant used for specifying command input arguments.
pvaOut
Optional. A Variant used for specifying command output arguments.
Applies To
[ Object Name ]
PlatformVersion
Win32:
WinCE:
Version data is listed when the mouse hovers over a link, or the link has focus.
InternetExplorer, WebBrowser
Move the mouse pointer over an element in the Applies To list to display availability information for the listed platforms. Internet Explorer does not expose this member on platforms that are not listed.

See Also
QueryStatusWB, IOLECMDEXECOPT



© 2001 Microsoft Corporation. All rights reserved. Terms of use.



IDM_SAVEAS Saves the current Web page to a file.

--
--------------------------------------------------------------------------------------------------
http://webdiary.smh.com.au/archives/...nt/001075.html
=================================================
"hon" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
>
> I have a job duty need to save daily stock data web page as .mht and ..html
> files (since include image).
> I want to set a schdule task which can auto save the updated web page daily,
> can I do that with script?
>
> Thx a lot.
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto Save Shared calendar daily SDB Microsoft Outlook Calendar 0 7th Dec 2009 02:01 PM
How to schedule an auto "Save As" of an Excel spreadsheet daily... Turbine Mechanic Microsoft Excel Worksheet Functions 2 16th Aug 2008 01:27 AM
How to setup daily auto-save-as of a dynamic worksheet Turbine Mechanic Microsoft Excel Misc 1 14th Aug 2008 04:59 PM
I want no auto save when tabbing from one page to the next in a m. =?Utf-8?B?cGhhZnJlZA==?= Microsoft Access Forms 1 5th Jan 2005 06:08 PM
Auto save calander to as web page Doug Fioor Microsoft Outlook Calendar 0 13th May 2004 09:27 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:32 PM.