Re: Copy & paste from IE/FF into a new Outlook email via VBScript

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




<damista@xxxxxxxxx> wrote in message
news:0b646b2f-f564-4362-8821-85a58c78d4b0@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi there

I need to write a script which refreshes a browser window/tab (IE or
FF in our case), copies the content into a new email in Outlook and
sends it off to a set address.

We're using a software to manage our job sheets for billing purposes.
The software exports the job sheets as a HTML file. This file is then
manually opened in a browser, the content copied into a new email and
sent off to the finance department for billing (yes I know it isn't
the most elegant way but that's how it is). This can be a rather
tedious job and it would be much easier to simply create a new job
sheet, fire up a script in Outlook to automatically refresh the
browser window/tab, copy the content across into a new email and send
it off. Simply opening the HTML file won't cut it since it only shows
the HTML code in the email, making it virtually unreadable. Of course
if anybody can tell me how to get Outlook to render the code rather
than display it, things would be much neater and more efficient.

The part I am stuck on atm is the "refreshing the browser window" and
"copy to the clipboard".

Sorry for my ignorance but I'm not very familiar with Windows
scripting and have been "thrown into cold water" here.

I've spent the last few days searching the web left, right and centre
for ideas but couldn't find anything useful so far. Any ideas how I
can get this done?

For those who don't want to learn scripting to read/parse a file
appropriately, one could use SendKeys. It's not a reliable method, but it is
what you are asking for.

' For IE...
set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.SendKeys "{F5}" 'Refresh
Wscript.Sleep 500 'Pause 1/2 second
WshShell.SendKeys "^A" 'Select all Control+A
Wscript.Sleep 500 'Pause 1/2 second
WshShell.SendKeys "^c" 'Copy Control+C
Wscript.Sleep 500 'Pause 1/2 second
' Google for commands to send an email.

--
Todd Vargo
(Post questions to group only. Remove "z" to email personal messages)

.



Relevant Pages

  • Re: Script to Refresh Desktop
    ... It turns out that there is no underline for "Refresh" on my Win XP SP2 ... Sounds more like there is no "desktop" for a scheduled script. ... "Chris A. Zanowick" wrote: ... Just don't know if Microsoft will fix what they ...
    (microsoft.public.scripting.wsh)
  • Re: Script to Refresh Desktop
    ... I tried the script but received the below error: ... It turns out that there is no underline for "Refresh" on my Win XP SP2 ... "Chris A. Zanowick" wrote: ...
    (microsoft.public.scripting.wsh)
  • Re: Dynamic HTML from Python Script
    ... To create the CGI script, I used Flaming Thunder's cross compiling ... I then ftp'd refresh.cgi up to the cgi directory on my server, ... just need to refresh the static file in your browser to see updates... ...
    (comp.lang.python)
  • Re: IE Page Freezes
    ... I have a website ... > refresh occurs the page stops rendering at the point where my script ...
    (comp.lang.php)
  • Copy & paste from IE/FF into a new Outlook email via VBScript
    ... I need to write a script which refreshes a browser window/tab (IE or ... fire up a script in Outlook to automatically refresh the ... browser window/tab, copy the content across into a new email and send ...
    (microsoft.public.scripting.vbscript)