Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Copy & paste from IE/FF into a new Outlook email via VBScript

Reply
 
Old 03-22-2009   #1 (permalink)
damista


 
 

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

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?

Cheers
Tom

My System SpecsSystem Spec
Old 03-23-2009   #2 (permalink)
Todd Vargo


 
 

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


<damista@xxxxxx> wrote in message
news:0b646b2f-f564-4362-8821-85a58c78d4b0@xxxxxx
Quote:

> 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)

My System SpecsSystem Spec
Old 03-23-2009   #3 (permalink)
damista


 
 

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

On Mar 23, 2:03*pm, "Todd Vargo" <tlva...@xxxxxx> wrote:
Quote:

>
> 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 itis
> 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)
Thanks for your reply Todd.

I was afraid there isn't a neater solution for this, other than
sending key strokes.

It's not that I don't want to learn but more a case of "We need this
yesterday, so just do it.". I got around this by simply using my
brain, reading up on a few things and using the "HTMLBody" property of
an Outlook mail. This way I don't have to worry about copy and paste
but simply read the HTML file into a string and set this string as
the message body. Works a charm

Cheers
Tom
My System SpecsSystem Spec
Old 03-23-2009   #4 (permalink)
gimme_this_gimme_that


 
 

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

Hi Tom,

You might try lynx : http://lynx.isc.org/

This is an ascii browser that is up to the task of downloading an HTML
page.


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
How to copy Outlook Email to Memory Stick Vista mail
Copy & Paste Email Address's NOT ! Live Mail
Copy and paste General Discussion
Copy / paste doesn't copy pictures Vista General
Copy and paste Vista performance & maintenance


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46