This seemed like a Windows question more than a Word question, I sent
it to a Windows newsgroup, and was told it was a Word question. So here
goes.



Here's the kind of thing I do a million times. I've just copied some
text from a web page into Word. Now I want to copy the URL of that web
page into Word.

I do Alt+Tab to switch back to the Internet Exporer page.

I press Alt+D to place cursor in address bar.

I press Ctrl+C to copy the address.

I use Alt+Tab switch back to Word.

I press Ctrl+V to paste the url into Word.

Would there be a way to automate these five steps into one action,
whether done by a .vbs file or some other means?

Re: Automating steps to copy URL from IE into Word by Steve

Steve
Mon May 09 09:57:43 CDT 2005

Larry,

This is more a vbs and html solution than Word and it isn't quite what you
asked for but I think the end result is something you will like. I've done
a script that adds a new item to your Internet Explorer context menu. If
you select some text on a web page and then right click the selected text,
instead of selecting 'Copy' you select the new item 'Research Entry'. The
script looks in your MyDocuments folder for a Word document named
"Web_Research.doc" and creates it if it doesn't already exist. It then
appends that document with the date and time, the URL of the page, the
document title for the page and the selected text. You get a pop up html
window to confirm that you want all this to happen and you can enter a typed
comment if you want to add a note to the text capture.

The easy way to get all this is to go to http://yandlfiles.home.comcast.net/
and click the link in the upper left for my text archive programs (you will
want the second one which requires Word). The zip files contain a ReadMe
file, the core htm file and installation and uninstall scripts. All can be
opened in notepad allowing you to check for security concerns or modify the
scripts if you're comfortable with that sort of thing.

If you want do do this the manual way, it isn't that tough. Essentially, a
new registry key called HKEY_CURRENT_USER\Software\Microsoft\Internet
Explorer\MenuExt\Research_Entry is created. It is given a default value
that is the path and file name to the new htm file with the working
components of the script. There is also a value named "Flags" with DWord
value of 1.

The critical part of the new htm file (beside placing where the above
registry key points) are the lines below:
Set oWindow=window.external.menuArguments
Set oDocument=oWindow.document
docAddress=oDocument.URL
docTitle=oDocument.Title

When those lines are in a script launched from the IE context menu, the
appropriate information from the document that was right click is returned.
The entire contents of the html file I use is below:

<html>
<head>
<TITLE>Retrieve and Save Web Document Information</TITLE>
</head>

<BODY STYLE="BACKGROUND-COLOR:#EEEEEE; MARGIN:10">
<P ID=para1></P>
<P ID=para2></P>
<P ID=para3></P>
<P ID=para4></P>
<P ID=para5></P>
<p><font size="4" color="red">Enter any comments to go with the document
information</font></p>

<TEXTAREA ID="comments" cols="52"></TEXTAREA>
<P ID=para6></P>
<P ID=para7></P>
<p><input type="button" name="B1" value=" SAVE TO WEB_RESEARCH.DOC ">

<script language="VBScript"><!--

Dim oWindow, oDocument, docAddress, docTitle, oSelect, oSelectRange,
strSelection, WSH, fso
Set oWindow=window.external.menuArguments
Set oDocument=oWindow.document
docAddress=oDocument.URL
docTitle=oDocument.Title
If docTitle = "" Then
docTitle = "(no document title)"
End If
Set oSelect=oDocument.selection
Set oSelectRange=oSelect.createRange()
strSelection=oSelectRange.text
Set WSH = CreateObject ("WScript.shell")
strMyDocs = WSH.SpecialFolders("MyDocuments")
' strMyDocs = "C:\Test\myfolder"
Set fso = CreateObject("Scripting.FileSystemObject")

Dim dy, mo, yr, hr, mi, se, dyStr, moStr, yrStr, hrStr, miStr, seStr, serStr
mo=month(Now)
dy=day(Now)
yr=year(Now)
hr=hour(Now)
mi=minute(Now)
se=second(Now)
'
If len(CStr(mo))=1 Then
moStr="0"&CStr(mo)
Else
moStr=CStr(mo)
End If
'
If len(CStr(dy))=1 Then
dyStr="0"&CStr(dy)
Else
dyStr=CStr(dy)
End If
'
yrStr=Right(CStr(yr),2)
'
If len(CStr(hr))=1 Then
hrStr="0"&CStr(hr)
Else
hrStr=CStr(hr)
End If
'
If len(CStr(mi))=1 Then
miStr="0"&CStr(mi)
Else
miStr=CStr(mi)
End If
'
If len(CStr(se))=1 Then
seStr="0"&CStr(se)
Else
seStr=CStr(se)
End If
'
serStr="T"&yrStr&moStr&dyStr&hrStr&miStr&seStr

document.all("para1").innerText="Information collected at: " & Now
document.all("para2").innerText="Document URL = " & docAddress
document.all("para3").innerText="Document Title = " & docTitle
document.all("para4").innerText="Document Last Modified on " &
oDocument.LastModified
If strSelection <> "" Then
document.all("para5").innerText="Document Selection = " & strSelection
End If
document.all("para6").innerText="The info will be bookmarked as " & serStr &
" in Word document below"
document.all("para7").innerText=strMyDocs & "\Web_Research.doc"

Sub B1_onClick
On Error Resume Next
Dim oWd, doc
Set oWd = CreateObject("Word.Application")
If Err.Number <> 0 Then
Alert "Problem opening Word or initiating some other object"
Window.Close
End If
If fso.FileExists(strMyDocs & "\Web_Research.doc") Then
Set doc = oWd.documents.open(strMyDocs & "\Web_Research.doc")
Else
Set doc = oWd.documents.add
doc.SaveAs strMyDocs & "\Web_Research.doc"
End If
Dim rngCurrent
oWd.Selection.WholeStory
oWd.Selection.MoveRight
oWd.Selection.TypeParagraph
oWd.Selection.TypeText("Information gathered at " & Now)
oWd.Selection.TypeParagraph

Set rngCurrent = oWd.Selection
oWd.ActiveDocument.Bookmarks.Add serStr,rngCurrent

oWd.Selection.TypeText("From ")
oWd.Selection.Font.Color=255
oWd.Selection.TypeText("URL ")
oWd.Selection.Font.Color=0
oWd.Selection.TypeText(docAddress)
oWd.Selection.TypeParagraph
oWd.Selection.TypeText("Document Title = " & docTitle & " then last modified
on " & oDocument.LastModified)
If strSelection <> "" Then
oWd.Selection.TypeParagraph
oWd.Selection.Font.Color=255
oWd.Selection.TypeText("Selected Text = ")
oWd.Selection.Font.Color=0
oWd.Selection.TypeText(strSelection)
End If
If comments.Value <> "" Then
oWd.Selection.TypeParagraph
oWd.Selection.Font.Color=255
oWd.Selection.TypeText("Comment = ")
oWd.Selection.Font.Color=0
oWd.Selection.TypeText(comments.Value)
End If
oWd.Selection.TypeParagraph
oWd.Selection.TypeText("********************************")
oWd.ActiveDocument.Save
oWd.ActiveDocument.Close
oWd.Quit
Set oWd = Nothing
Window.Close

End Sub

Set WSH = Nothing

--></script>

</BODY>
</html>

"Larry" <larry328NOSPAM@att.net> wrote in message
news:%23ExdcyGVFHA.580@TK2MSFTNGP15.phx.gbl...
> This seemed like a Windows question more than a Word question, I sent
> it to a Windows newsgroup, and was told it was a Word question. So here
> goes.
>
>
>
> Here's the kind of thing I do a million times. I've just copied some
> text from a web page into Word. Now I want to copy the URL of that web
> page into Word.
>
> I do Alt+Tab to switch back to the Internet Exporer page.
>
> I press Alt+D to place cursor in address bar.
>
> I press Ctrl+C to copy the address.
>
> I use Alt+Tab switch back to Word.
>
> I press Ctrl+V to paste the url into Word.
>
> Would there be a way to automate these five steps into one action,
> whether done by a .vbs file or some other means?
>
>
>
>



Re: Automating steps to copy URL from IE into Word by Larry

Larry
Tue May 10 04:27:11 CDT 2005

Steve,

This is just amazing. It will be fantastic to be able to do all this in
one step. I can't wait to install and try this out. I didn't know that
an html file could have text that was executible code that could be run
like a macro or a .vbs script.

I'm going to use your install files rather than try to create this
manually. The only change I will have to make is changing the path of
Web_Research" doc since I long ago change my "My Documents" folder's
name to "Documents."

I'll let you know how it goes.

I'm curious to see if character formatting in the selection, such as
italics, is carried over.

Larry



Steve Yandl wrote:
> Larry,
>
> This is more a vbs and html solution than Word and it isn't quite
> what you asked for but I think the end result is something you will
> like. I've done a script that adds a new item to your Internet
> Explorer context menu. If you select some text on a web page and
> then right click the selected text, instead of selecting 'Copy' you
> select the new item 'Research Entry'. The script looks in your
> MyDocuments folder for a Word document named "Web_Research.doc" and
> creates it if it doesn't already exist. It then appends that
> document with the date and time, the URL of the page, the document
> title for the page and the selected text. You get a pop up html
> window to confirm that you want all this to happen and you can enter
> a typed comment if you want to add a note to the text capture.
>
> The easy way to get all this is to go to
> http://yandlfiles.home.comcast.net/ and click the link in the upper
> left for my text archive programs (you will want the second one which
> requires Word). The zip files contain a ReadMe file, the core htm
> file and installation and uninstall scripts. All can be opened in
> notepad allowing you to check for security concerns or modify the
> scripts if you're comfortable with that sort of thing.
>
> If you want do do this the manual way, it isn't that tough.
> Essentially, a new registry key called
> HKEY_CURRENT_USER\Software\Microsoft\Internet
> Explorer\MenuExt\Research_Entry is created. It is given a default
> value that is the path and file name to the new htm file with the
> working components of the script. There is also a value named
> "Flags" with DWord value of 1.
>
> The critical part of the new htm file (beside placing where the above
> registry key points) are the lines below:
> Set oWindow=window.external.menuArguments
> Set oDocument=oWindow.document
> docAddress=oDocument.URL
> docTitle=oDocument.Title
>
> When those lines are in a script launched from the IE context menu,
> the appropriate information from the document that was right click is
> returned. The entire contents of the html file I use is below:
>
> <html>
> <head>
> <TITLE>Retrieve and Save Web Document Information</TITLE>
> </head>
>
> <BODY STYLE="BACKGROUND-COLOR:#EEEEEE; MARGIN:10">
> <P ID=para1></P>
> <P ID=para2></P>
> <P ID=para3></P>
> <P ID=para4></P>
> <P ID=para5></P>
> <p><font size="4" color="red">Enter any comments to go with the
> document information</font></p>
>
> <TEXTAREA ID="comments" cols="52"></TEXTAREA>
> <P ID=para6></P>
> <P ID=para7></P>
> <p><input type="button" name="B1" value=" SAVE TO WEB_RESEARCH.DOC
> ">
>
> <script language="VBScript"><!--
>
> Dim oWindow, oDocument, docAddress, docTitle, oSelect, oSelectRange,
> strSelection, WSH, fso
> Set oWindow=window.external.menuArguments
> Set oDocument=oWindow.document
> docAddress=oDocument.URL
> docTitle=oDocument.Title
> If docTitle = "" Then
> docTitle = "(no document title)"
> End If
> Set oSelect=oDocument.selection
> Set oSelectRange=oSelect.createRange()
> strSelection=oSelectRange.text
> Set WSH = CreateObject ("WScript.shell")
> strMyDocs = WSH.SpecialFolders("MyDocuments")
> ' strMyDocs = "C:\Test\myfolder"
> Set fso = CreateObject("Scripting.FileSystemObject")
>
> Dim dy, mo, yr, hr, mi, se, dyStr, moStr, yrStr, hrStr, miStr, seStr,
> serStr mo=month(Now)
> dy=day(Now)
> yr=year(Now)
> hr=hour(Now)
> mi=minute(Now)
> se=second(Now)
> '
> If len(CStr(mo))=1 Then
> moStr="0"&CStr(mo)
> Else
> moStr=CStr(mo)
> End If
> '
> If len(CStr(dy))=1 Then
> dyStr="0"&CStr(dy)
> Else
> dyStr=CStr(dy)
> End If
> '
> yrStr=Right(CStr(yr),2)
> '
> If len(CStr(hr))=1 Then
> hrStr="0"&CStr(hr)
> Else
> hrStr=CStr(hr)
> End If
> '
> If len(CStr(mi))=1 Then
> miStr="0"&CStr(mi)
> Else
> miStr=CStr(mi)
> End If
> '
> If len(CStr(se))=1 Then
> seStr="0"&CStr(se)
> Else
> seStr=CStr(se)
> End If
> '
> serStr="T"&yrStr&moStr&dyStr&hrStr&miStr&seStr
>
> document.all("para1").innerText="Information collected at: " & Now
> document.all("para2").innerText="Document URL = " & docAddress
> document.all("para3").innerText="Document Title = " & docTitle
> document.all("para4").innerText="Document Last Modified on " &
> oDocument.LastModified
> If strSelection <> "" Then
> document.all("para5").innerText="Document Selection = " & strSelection
> End If
> document.all("para6").innerText="The info will be bookmarked as " &
> serStr & " in Word document below"
> document.all("para7").innerText=strMyDocs & "\Web_Research.doc"
>
> Sub B1_onClick
> On Error Resume Next
> Dim oWd, doc
> Set oWd = CreateObject("Word.Application")
> If Err.Number <> 0 Then
> Alert "Problem opening Word or initiating some other object"
> Window.Close
> End If
> If fso.FileExists(strMyDocs & "\Web_Research.doc") Then
> Set doc = oWd.documents.open(strMyDocs & "\Web_Research.doc")
> Else
> Set doc = oWd.documents.add
> doc.SaveAs strMyDocs & "\Web_Research.doc"
> End If
> Dim rngCurrent
> oWd.Selection.WholeStory
> oWd.Selection.MoveRight
> oWd.Selection.TypeParagraph
> oWd.Selection.TypeText("Information gathered at " & Now)
> oWd.Selection.TypeParagraph
>
> Set rngCurrent = oWd.Selection
> oWd.ActiveDocument.Bookmarks.Add serStr,rngCurrent
>
> oWd.Selection.TypeText("From ")
> oWd.Selection.Font.Color=255
> oWd.Selection.TypeText("URL ")
> oWd.Selection.Font.Color=0
> oWd.Selection.TypeText(docAddress)
> oWd.Selection.TypeParagraph
> oWd.Selection.TypeText("Document Title = " & docTitle & " then last
> modified on " & oDocument.LastModified)
> If strSelection <> "" Then
> oWd.Selection.TypeParagraph
> oWd.Selection.Font.Color=255
> oWd.Selection.TypeText("Selected Text = ")
> oWd.Selection.Font.Color=0
> oWd.Selection.TypeText(strSelection)
> End If
> If comments.Value <> "" Then
> oWd.Selection.TypeParagraph
> oWd.Selection.Font.Color=255
> oWd.Selection.TypeText("Comment = ")
> oWd.Selection.Font.Color=0
> oWd.Selection.TypeText(comments.Value)
> End If
> oWd.Selection.TypeParagraph
> oWd.Selection.TypeText("********************************")
> oWd.ActiveDocument.Save
> oWd.ActiveDocument.Close
> oWd.Quit
> Set oWd = Nothing
> Window.Close
>
> End Sub
>
> Set WSH = Nothing
>
> --></script>
>
> </BODY>
> </html>
>
> "Larry" <larry328NOSPAM@att.net> wrote in message
> news:%23ExdcyGVFHA.580@TK2MSFTNGP15.phx.gbl...
> > This seemed like a Windows question more than a Word question, I
> > sent it to a Windows newsgroup, and was told it was a Word
> > question. So here goes.
> >
> >
> >
> > Here's the kind of thing I do a million times. I've just copied
> > some text from a web page into Word. Now I want to copy the URL of
> > that web page into Word.
> >
> > I do Alt+Tab to switch back to the Internet Exporer page.
> >
> > I press Alt+D to place cursor in address bar.
> >
> > I press Ctrl+C to copy the address.
> >
> > I use Alt+Tab switch back to Word.
> >
> > I press Ctrl+V to paste the url into Word.
> >
> > Would there be a way to automate these five steps into one action,
> > whether done by a .vbs file or some other means?



Re: Automating steps to copy URL from IE into Word by Steve

Steve
Tue May 10 09:35:50 CDT 2005

Larry,

You may not have to worry about changing the "My Documents" folder. Try it
first to see. The Windows Script Host has a set of special folders and the
path should be returned even if it isn't in the usual location or has been
renamed.

The only questions I've received from people have involved notifications
from Norton AV or some other anti-virus software. If you're familiar with
using vbs, this won't throw you off but non scripting types can get
concerned and don't know what to check to feel safe.


Steve


"Larry" <larry328NOSPAM@att.net> wrote in message
news:%23xTuFJUVFHA.3532@TK2MSFTNGP09.phx.gbl...
> Steve,
>
> This is just amazing. It will be fantastic to be able to do all this in
> one step. I can't wait to install and try this out. I didn't know that
> an html file could have text that was executible code that could be run
> like a macro or a .vbs script.
>
> I'm going to use your install files rather than try to create this
> manually. The only change I will have to make is changing the path of
> Web_Research" doc since I long ago change my "My Documents" folder's
> name to "Documents."
>
> I'll let you know how it goes.
>
> I'm curious to see if character formatting in the selection, such as
> italics, is carried over.
>
> Larry
>
>
>
> Steve Yandl wrote:
>> Larry,
>>
>> This is more a vbs and html solution than Word and it isn't quite
>> what you asked for but I think the end result is something you will
>> like. I've done a script that adds a new item to your Internet
>> Explorer context menu. If you select some text on a web page and
>> then right click the selected text, instead of selecting 'Copy' you
>> select the new item 'Research Entry'. The script looks in your
>> MyDocuments folder for a Word document named "Web_Research.doc" and
>> creates it if it doesn't already exist. It then appends that
>> document with the date and time, the URL of the page, the document
>> title for the page and the selected text. You get a pop up html
>> window to confirm that you want all this to happen and you can enter
>> a typed comment if you want to add a note to the text capture.
>>
>> The easy way to get all this is to go to
>> http://yandlfiles.home.comcast.net/ and click the link in the upper
>> left for my text archive programs (you will want the second one which
>> requires Word). The zip files contain a ReadMe file, the core htm
>> file and installation and uninstall scripts. All can be opened in
>> notepad allowing you to check for security concerns or modify the
>> scripts if you're comfortable with that sort of thing.
>>
>> If you want do do this the manual way, it isn't that tough.
>> Essentially, a new registry key called
>> HKEY_CURRENT_USER\Software\Microsoft\Internet
>> Explorer\MenuExt\Research_Entry is created. It is given a default
>> value that is the path and file name to the new htm file with the
>> working components of the script. There is also a value named
>> "Flags" with DWord value of 1.
>>
>> The critical part of the new htm file (beside placing where the above
>> registry key points) are the lines below:
>> Set oWindow=window.external.menuArguments
>> Set oDocument=oWindow.document
>> docAddress=oDocument.URL
>> docTitle=oDocument.Title
>>
>> When those lines are in a script launched from the IE context menu,
>> the appropriate information from the document that was right click is
>> returned. The entire contents of the html file I use is below:
>>
>> <html>
>> <head>
>> <TITLE>Retrieve and Save Web Document Information</TITLE>
>> </head>
>>
>> <BODY STYLE="BACKGROUND-COLOR:#EEEEEE; MARGIN:10">
>> <P ID=para1></P>
>> <P ID=para2></P>
>> <P ID=para3></P>
>> <P ID=para4></P>
>> <P ID=para5></P>
>> <p><font size="4" color="red">Enter any comments to go with the
>> document information</font></p>
>>
>> <TEXTAREA ID="comments" cols="52"></TEXTAREA>
>> <P ID=para6></P>
>> <P ID=para7></P>
>> <p><input type="button" name="B1" value=" SAVE TO WEB_RESEARCH.DOC
>> ">
>>
>> <script language="VBScript"><!--
>>
>> Dim oWindow, oDocument, docAddress, docTitle, oSelect, oSelectRange,
>> strSelection, WSH, fso
>> Set oWindow=window.external.menuArguments
>> Set oDocument=oWindow.document
>> docAddress=oDocument.URL
>> docTitle=oDocument.Title
>> If docTitle = "" Then
>> docTitle = "(no document title)"
>> End If
>> Set oSelect=oDocument.selection
>> Set oSelectRange=oSelect.createRange()
>> strSelection=oSelectRange.text
>> Set WSH = CreateObject ("WScript.shell")
>> strMyDocs = WSH.SpecialFolders("MyDocuments")
>> ' strMyDocs = "C:\Test\myfolder"
>> Set fso = CreateObject("Scripting.FileSystemObject")
>>
>> Dim dy, mo, yr, hr, mi, se, dyStr, moStr, yrStr, hrStr, miStr, seStr,
>> serStr mo=month(Now)
>> dy=day(Now)
>> yr=year(Now)
>> hr=hour(Now)
>> mi=minute(Now)
>> se=second(Now)
>> '
>> If len(CStr(mo))=1 Then
>> moStr="0"&CStr(mo)
>> Else
>> moStr=CStr(mo)
>> End If
>> '
>> If len(CStr(dy))=1 Then
>> dyStr="0"&CStr(dy)
>> Else
>> dyStr=CStr(dy)
>> End If
>> '
>> yrStr=Right(CStr(yr),2)
>> '
>> If len(CStr(hr))=1 Then
>> hrStr="0"&CStr(hr)
>> Else
>> hrStr=CStr(hr)
>> End If
>> '
>> If len(CStr(mi))=1 Then
>> miStr="0"&CStr(mi)
>> Else
>> miStr=CStr(mi)
>> End If
>> '
>> If len(CStr(se))=1 Then
>> seStr="0"&CStr(se)
>> Else
>> seStr=CStr(se)
>> End If
>> '
>> serStr="T"&yrStr&moStr&dyStr&hrStr&miStr&seStr
>>
>> document.all("para1").innerText="Information collected at: " & Now
>> document.all("para2").innerText="Document URL = " & docAddress
>> document.all("para3").innerText="Document Title = " & docTitle
>> document.all("para4").innerText="Document Last Modified on " &
>> oDocument.LastModified
>> If strSelection <> "" Then
>> document.all("para5").innerText="Document Selection = " & strSelection
>> End If
>> document.all("para6").innerText="The info will be bookmarked as " &
>> serStr & " in Word document below"
>> document.all("para7").innerText=strMyDocs & "\Web_Research.doc"
>>
>> Sub B1_onClick
>> On Error Resume Next
>> Dim oWd, doc
>> Set oWd = CreateObject("Word.Application")
>> If Err.Number <> 0 Then
>> Alert "Problem opening Word or initiating some other object"
>> Window.Close
>> End If
>> If fso.FileExists(strMyDocs & "\Web_Research.doc") Then
>> Set doc = oWd.documents.open(strMyDocs & "\Web_Research.doc")
>> Else
>> Set doc = oWd.documents.add
>> doc.SaveAs strMyDocs & "\Web_Research.doc"
>> End If
>> Dim rngCurrent
>> oWd.Selection.WholeStory
>> oWd.Selection.MoveRight
>> oWd.Selection.TypeParagraph
>> oWd.Selection.TypeText("Information gathered at " & Now)
>> oWd.Selection.TypeParagraph
>>
>> Set rngCurrent = oWd.Selection
>> oWd.ActiveDocument.Bookmarks.Add serStr,rngCurrent
>>
>> oWd.Selection.TypeText("From ")
>> oWd.Selection.Font.Color=255
>> oWd.Selection.TypeText("URL ")
>> oWd.Selection.Font.Color=0
>> oWd.Selection.TypeText(docAddress)
>> oWd.Selection.TypeParagraph
>> oWd.Selection.TypeText("Document Title = " & docTitle & " then last
>> modified on " & oDocument.LastModified)
>> If strSelection <> "" Then
>> oWd.Selection.TypeParagraph
>> oWd.Selection.Font.Color=255
>> oWd.Selection.TypeText("Selected Text = ")
>> oWd.Selection.Font.Color=0
>> oWd.Selection.TypeText(strSelection)
>> End If
>> If comments.Value <> "" Then
>> oWd.Selection.TypeParagraph
>> oWd.Selection.Font.Color=255
>> oWd.Selection.TypeText("Comment = ")
>> oWd.Selection.Font.Color=0
>> oWd.Selection.TypeText(comments.Value)
>> End If
>> oWd.Selection.TypeParagraph
>> oWd.Selection.TypeText("********************************")
>> oWd.ActiveDocument.Save
>> oWd.ActiveDocument.Close
>> oWd.Quit
>> Set oWd = Nothing
>> Window.Close
>>
>> End Sub
>>
>> Set WSH = Nothing
>>
>> --></script>
>>
>> </BODY>
>> </html>
>>
>> "Larry" <larry328NOSPAM@att.net> wrote in message
>> news:%23ExdcyGVFHA.580@TK2MSFTNGP15.phx.gbl...
>> > This seemed like a Windows question more than a Word question, I
>> > sent it to a Windows newsgroup, and was told it was a Word
>> > question. So here goes.
>> >
>> >
>> >
>> > Here's the kind of thing I do a million times. I've just copied
>> > some text from a web page into Word. Now I want to copy the URL of
>> > that web page into Word.
>> >
>> > I do Alt+Tab to switch back to the Internet Exporer page.
>> >
>> > I press Alt+D to place cursor in address bar.
>> >
>> > I press Ctrl+C to copy the address.
>> >
>> > I use Alt+Tab switch back to Word.
>> >
>> > I press Ctrl+V to paste the url into Word.
>> >
>> > Would there be a way to automate these five steps into one action,
>> > whether done by a .vbs file or some other means?
>
>



Re: Automating steps to copy URL from IE into Word by Larry

Larry
Wed May 11 12:15:33 CDT 2005

This is a multi-part message in MIME format.

------=_NextPart_000_0651_01C5562B.83581EE0
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable


Steve,

This is great, it's wonderful to know that such capabities exist, but =
this program is geared for a different set up from mine. Here are my =
thoughts and suggestions. =20

What this does is append each entry to a _closed_ Word document. This =
is perfect for accumulating a lot of material from the web in a kind of =
research project. However, if the document is open, it opens a second =
instance of Word without my custom toolbar and prompts the user to save =
it. So that would have to be changed. The program needs to insert the =
material into open document. And it must not open additional instances =
of Word if Word is already open. That creates problems for me. =20

Also, I don't need a single saved document into which to put the =
information from many different such operations. Each such insert could =
go into its own, new Word document, which I could then save manually. =20

When the application opens, it prompts the user for a comment, which =
then makes it necessary to scroll down to where the button is to execute =
the program. It would be better to skip all that and have the whole =
operation take place in one step. I could do without the comment, since =
I'm going to be working on the Word document into which I've inserted =
the material, I can add whatever I want directly in the Word document. =20

Another thing. This does not carry over character formatting of the =
selected text, such as italics. I don't supposed that would be =
possible? If it's not possible, what I might want to do is change the =
program so that it inserts the title and url into a new Word document, =
while copying the selected text in the webpage AND switching the focus =
to the Word document, so then all I have to do is paste the (formatted) =
text underneath the title and url. =20

Thanks,
Larry



Thanks,
Larry




"Steve Yandl" <syandl@comcast.net> wrote in message =
news:leqdnfyyKohbWx3fRVn-2Q@comcast.com...
> Larry,
>=20
> You may not have to worry about changing the "My Documents" folder. =
Try it=20
> first to see. The Windows Script Host has a set of special folders =
and the=20
> path should be returned even if it isn't in the usual location or has =
been=20
> renamed.
>=20
> The only questions I've received from people have involved =
notifications=20
> from Norton AV or some other anti-virus software. If you're familiar =
with=20
> using vbs, this won't throw you off but non scripting types can get=20
> concerned and don't know what to check to feel safe.
>=20
>=20
> Steve
>=20
>=20
> "Larry" <larry328NOSPAM@att.net> wrote in message=20
> news:%23xTuFJUVFHA.3532@TK2MSFTNGP09.phx.gbl...
> > Steve,
> >
> > This is just amazing. It will be fantastic to be able to do all =
this in
> > one step. I can't wait to install and try this out. I didn't know =
that
> > an html file could have text that was executible code that could be =
run
> > like a macro or a .vbs script.
> >
> > I'm going to use your install files rather than try to create this
> > manually. The only change I will have to make is changing the path =
of
> > Web_Research" doc since I long ago change my "My Documents" folder's
> > name to "Documents."
> >
> > I'll let you know how it goes.
> >
> > I'm curious to see if character formatting in the selection, such as
> > italics, is carried over.
> >
> > Larry
> >
> >
> >
> > Steve Yandl wrote:
> >> Larry,
> >>
> >> This is more a vbs and html solution than Word and it isn't quite
> >> what you asked for but I think the end result is something you will
> >> like. I've done a script that adds a new item to your Internet
> >> Explorer context menu. If you select some text on a web page and
> >> then right click the selected text, instead of selecting 'Copy' you
> >> select the new item 'Research Entry'. The script looks in your
> >> MyDocuments folder for a Word document named "Web_Research.doc" and
> >> creates it if it doesn't already exist. It then appends that
> >> document with the date and time, the URL of the page, the document
> >> title for the page and the selected text. You get a pop up html
> >> window to confirm that you want all this to happen and you can =
enter
> >> a typed comment if you want to add a note to the text capture.
> >>
> >> The easy way to get all this is to go to
> >> http://yandlfiles.home.comcast.net/ and click the link in the upper
> >> left for my text archive programs (you will want the second one =
which
> >> requires Word). The zip files contain a ReadMe file, the core htm
> >> file and installation and uninstall scripts. All can be opened in
> >> notepad allowing you to check for security concerns or modify the
> >> scripts if you're comfortable with that sort of thing.
> >>
> >> If you want do do this the manual way, it isn't that tough.
> >> Essentially, a new registry key called
> >> HKEY_CURRENT_USER\Software\Microsoft\Internet
> >> Explorer\MenuExt\Research_Entry is created. It is given a default
> >> value that is the path and file name to the new htm file with the
> >> working components of the script. There is also a value named
> >> "Flags" with DWord value of 1.
> >>
> >> The critical part of the new htm file (beside placing where the =
above
> >> registry key points) are the lines below:
> >> Set oWindow=3Dwindow.external.menuArguments
> >> Set oDocument=3DoWindow.document
> >> docAddress=3DoDocument.URL
> >> docTitle=3DoDocument.Title
> >>
> >> When those lines are in a script launched from the IE context menu,
> >> the appropriate information from the document that was right click =
is
> >> returned. The entire contents of the html file I use is below:
> >>
> >> <html>
> >> <head>
> >> <TITLE>Retrieve and Save Web Document Information</TITLE>
> >> </head>
> >>
> >> <BODY STYLE=3D"BACKGROUND-COLOR:#EEEEEE; MARGIN:10">
> >> <P ID=3Dpara1></P>
> >> <P ID=3Dpara2></P>
> >> <P ID=3Dpara3></P>
> >> <P ID=3Dpara4></P>
> >> <P ID=3Dpara5></P>
> >> <p><font size=3D"4" color=3D"red">Enter any comments to go with the
> >> document information</font></p>
> >>
> >> <TEXTAREA ID=3D"comments" cols=3D"52"></TEXTAREA>
> >> <P ID=3Dpara6></P>
> >> <P ID=3Dpara7></P>
> >> <p><input type=3D"button" name=3D"B1" value=3D" SAVE TO =
WEB_RESEARCH.DOC
> >> ">
> >>
> >> <script language=3D"VBScript"><!--
> >>
> >> Dim oWindow, oDocument, docAddress, docTitle, oSelect, =
oSelectRange,
> >> strSelection, WSH, fso
> >> Set oWindow=3Dwindow.external.menuArguments
> >> Set oDocument=3DoWindow.document
> >> docAddress=3DoDocument.URL
> >> docTitle=3DoDocument.Title
> >> If docTitle =3D "" Then
> >> docTitle =3D "(no document title)"
> >> End If
> >> Set oSelect=3DoDocument.selection
> >> Set oSelectRange=3DoSelect.createRange()
> >> strSelection=3DoSelectRange.text
> >> Set WSH =3D CreateObject ("WScript.shell")
> >> strMyDocs =3D WSH.SpecialFolders("MyDocuments")
> >> ' strMyDocs =3D "C:\Test\myfolder"
> >> Set fso =3D CreateObject("Scripting.FileSystemObject")
> >>
> >> Dim dy, mo, yr, hr, mi, se, dyStr, moStr, yrStr, hrStr, miStr, =
seStr,
> >> serStr mo=3Dmonth(Now)
> >> dy=3Dday(Now)
> >> yr=3Dyear(Now)
> >> hr=3Dhour(Now)
> >> mi=3Dminute(Now)
> >> se=3Dsecond(Now)
> >> '
> >> If len(CStr(mo))=3D1 Then
> >> moStr=3D"0"&CStr(mo)
> >> Else
> >> moStr=3DCStr(mo)
> >> End If
> >> '
> >> If len(CStr(dy))=3D1 Then
> >> dyStr=3D"0"&CStr(dy)
> >> Else
> >> dyStr=3DCStr(dy)
> >> End If
> >> '
> >> yrStr=3DRight(CStr(yr),2)
> >> '
> >> If len(CStr(hr))=3D1 Then
> >> hrStr=3D"0"&CStr(hr)
> >> Else
> >> hrStr=3DCStr(hr)
> >> End If
> >> '
> >> If len(CStr(mi))=3D1 Then
> >> miStr=3D"0"&CStr(mi)
> >> Else
> >> miStr=3DCStr(mi)
> >> End If
> >> '
> >> If len(CStr(se))=3D1 Then
> >> seStr=3D"0"&CStr(se)
> >> Else
> >> seStr=3DCStr(se)
> >> End If
> >> '
> >> serStr=3D"T"&yrStr&moStr&dyStr&hrStr&miStr&seStr
> >>
> >> document.all("para1").innerText=3D"Information collected at: " & =
Now
> >> document.all("para2").innerText=3D"Document URL =3D " & docAddress
> >> document.all("para3").innerText=3D"Document Title =3D " & docTitle
> >> document.all("para4").innerText=3D"Document Last Modified on " &
> >> oDocument.LastModified
> >> If strSelection <> "" Then
> >> document.all("para5").innerText=3D"Document Selection =3D " & =
strSelection
> >> End If
> >> document.all("para6").innerText=3D"The info will be bookmarked as " =
&
> >> serStr & " in Word document below"
> >> document.all("para7").innerText=3DstrMyDocs & "\Web_Research.doc"
> >>
> >> Sub B1_onClick
> >> On Error Resume Next
> >> Dim oWd, doc
> >> Set oWd =3D CreateObject("Word.Application")
> >> If Err.Number <> 0 Then
> >> Alert "Problem opening Word or initiating some other object"
> >> Window.Close
> >> End If
> >> If fso.FileExists(strMyDocs & "\Web_Research.doc") Then
> >> Set doc =3D oWd.documents.open(strMyDocs & "\Web_Research.doc")
> >> Else
> >> Set doc =3D oWd.documents.add
> >> doc.SaveAs strMyDocs & "\Web_Research.doc"
> >> End If
> >> Dim rngCurrent
> >> oWd.Selection.WholeStory
> >> oWd.Selection.MoveRight
> >> oWd.Selection.TypeParagraph
> >> oWd.Selection.TypeText("Information gathered at " & Now)
> >> oWd.Selection.TypeParagraph
> >>
> >> Set rngCurrent =3D oWd.Selection
> >> oWd.ActiveDocument.Bookmarks.Add serStr,rngCurrent
> >>
> >> oWd.Selection.TypeText("From ")
> >> oWd.Selection.Font.Color=3D255
> >> oWd.Selection.TypeText("URL ")
> >> oWd.Selection.Font.Color=3D0
> >> oWd.Selection.TypeText(docAddress)
> >> oWd.Selection.TypeParagraph
> >> oWd.Selection.TypeText("Document Title =3D " & docTitle & " then =
last
> >> modified on " & oDocument.LastModified)
> >> If strSelection <> "" Then
> >> oWd.Selection.TypeParagraph
> >> oWd.Selection.Font.Color=3D255
> >> oWd.Selection.TypeText("Selected Text =3D ")
> >> oWd.Selection.Font.Color=3D0
> >> oWd.Selection.TypeText(strSelection)
> >> End If
> >> If comments.Value <> "" Then
> >> oWd.Selection.TypeParagraph
> >> oWd.Selection.Font.Color=3D255
> >> oWd.Selection.TypeText("Comment =3D ")
> >> oWd.Selection.Font.Color=3D0
> >> oWd.Selection.TypeText(comments.Value)
> >> End If
> >> oWd.Selection.TypeParagraph
> >> oWd.Selection.TypeText("********************************")
> >> oWd.ActiveDocument.Save
> >> oWd.ActiveDocument.Close
> >> oWd.Quit
> >> Set oWd =3D Nothing
> >> Window.Close
> >>
> >> End Sub
> >>
> >> Set WSH =3D Nothing
> >>
> >> --></script>
> >>
> >> </BODY>
> >> </html>
> >>
> >> "Larry" <larry328NOSPAM@att.net> wrote in message
> >> news:%23ExdcyGVFHA.580@TK2MSFTNGP15.phx.gbl...
> >> > This seemed like a Windows question more than a Word question, I
> >> > sent it to a Windows newsgroup, and was told it was a Word
> >> > question. So here goes.
> >> >
> >> >
> >> >
> >> > Here's the kind of thing I do a million times. I've just copied
> >> > some text from a web page into Word. Now I want to copy the URL =
of
> >> > that web page into Word.
> >> >
> >> > I do Alt+Tab to switch back to the Internet Exporer page.
> >> >
> >> > I press Alt+D to place cursor in address bar.
> >> >
> >> > I press Ctrl+C to copy the address.
> >> >
> >> > I use Alt+Tab switch back to Word.
> >> >
> >> > I press Ctrl+V to paste the url into Word.
> >> >
> >> > Would there be a way to automate these five steps into one =
action,
> >> > whether done by a .vbs file or some other means?
> >
> >=20
>=20
>=20
"Steve Yandl" <syandl@comcast.net> wrote in message =
news:leqdnfyyKohbWx3fRVn-2Q@comcast.com...
> Larry,
>=20
> You may not have to worry about changing the "My Documents" folder. =
Try it=20
> first to see. The Windows Script Host has a set of special folders =
and the=20
> path should be returned even if it isn't in the usual location or has =
been=20
> renamed.
>=20
> The only questions I've received from people have involved =
notifications=20
> from Norton AV or some other anti-virus software. If you're familiar =
with=20
> using vbs, this won't throw you off but non scripting types can get=20
> concerned and don't know what to check to feel safe.
>=20
>=20
> Steve
>=20
>=20
> "Larry" <larry328NOSPAM@att.net> wrote in message=20
> news:%23xTuFJUVFHA.3532@TK2MSFTNGP09.phx.gbl...
> > Steve,
> >
> > This is just amazing. It will be fantastic to be able to do all =
this in
> > one step. I can't wait to install and try this out. I didn't know =
that
> > an html file could have text that was executible code that could be =
run
> > like a macro or a .vbs script.
> >
> > I'm going to use your install files rather than try to create this
> > manually. The only change I will have to make is changing the path =
of
> > Web_Research" doc since I long ago change my "My Documents" folder's
> > name to "Documents."
> >
> > I'll let you know how it goes.
> >
> > I'm curious to see if character formatting in the selection, such as
> > italics, is carried over.
> >
> > Larry
> >
> >
> >
> > Steve Yandl wrote:
> >> Larry,
> >>
> >> This is more a vbs and html solution than Word and it isn't quite
> >> what you asked for but I think the end result is something you will
> >> like. I've done a script that adds a new item to your Internet
> >> Explorer context menu. If you select some text on a web page and
> >> then right click the selected text, instead of selecting 'Copy' you
> >> select the new item 'Research Entry'. The script looks in your
> >> MyDocuments folder for a Word document named "Web_Research.doc" and
> >> creates it if it doesn't already exist. It then appends that
> >> document with the date and time, the URL of the page, the document
> >> title for the page and the selected text. You get a pop up html
> >> window to confirm that you want all this to happen and you can =
enter
> >> a typed comment if you want to add a note to the text capture.
> >>
> >> The easy way to get all this is to go to
> >> http://yandlfiles.home.comcast.net/ and click the link in the upper
> >> left for my text archive programs (you will want the second one =
which
> >> requires Word). The zip files contain a ReadMe file, the core htm
> >> file and installation and uninstall scripts. All can be opened in
> >> notepad allowing you to check for security concerns or modify the
> >> scripts if you're comfortable with that sort of thing.
> >>
> >> If you want do do this the manual way, it isn't that tough.
> >> Essentially, a new registry key called
> >> HKEY_CURRENT_USER\Software\Microsoft\Internet
> >> Explorer\MenuExt\Research_Entry is created. It is given a default
> >> value that is the path and file name to the new htm file with the
> >> working components of the script. There is also a value named
> >> "Flags" with DWord value of 1.
> >>
> >> The critical part of the new htm file (beside placing where the =
above
> >> registry key points) are the lines below:
> >> Set oWindow=3Dwindow.external.menuArguments
> >> Set oDocument=3DoWindow.document
> >> docAddress=3DoDocument.URL
> >> docTitle=3DoDocument.Title
> >>
> >> When those lines are in a script launched from the IE context menu,
> >> the appropriate information from the document that was right click =
is
> >> returned. The entire contents of the html file I use is below:
> >>
> >> <html>
> >> <head>
> >> <TITLE>Retrieve and Save Web Document Information</TITLE>
> >> </head>
> >>
> >> <BODY STYLE=3D"BACKGROUND-COLOR:#EEEEEE; MARGIN:10">
> >> <P ID=3Dpara1></P>
> >> <P ID=3Dpara2></P>
> >> <P ID=3Dpara3></P>
> >> <P ID=3Dpara4></P>
> >> <P ID=3Dpara5></P>
> >> <p><font size=3D"4" color=3D"red">Enter any comments to go with the
> >> document information</font></p>
> >>
> >> <TEXTAREA ID=3D"comments" cols=3D"52"></TEXTAREA>
> >> <P ID=3Dpara6></P>
> >> <P ID=3Dpara7></P>
> >> <p><input type=3D"button" name=3D"B1" value=3D" SAVE TO =
WEB_RESEARCH.DOC
> >> ">
> >>
> >> <script language=3D"VBScript"><!--
> >>
> >> Dim oWindow, oDocument, docAddress, docTitle, oSelect, =
oSelectRange,
> >> strSelection, WSH, fso
> >> Set oWindow=3Dwindow.external.menuArguments
> >> Set oDocument=3DoWindow.document
> >> docAddress=3DoDocument.URL
> >> docTitle=3DoDocument.Title
> >> If docTitle =3D "" Then
> >> docTitle =3D "(no document title)"
> >> End If
> >> Set oSelect=3DoDocument.selection
> >> Set oSelectRange=3DoSelect.createRange()
> >> strSelection=3DoSelectRange.text
> >> Set WSH =3D CreateObject ("WScript.shell")
> >> strMyDocs =3D WSH.SpecialFolders("MyDocuments")
> >> ' strMyDocs =3D "C:\Test\myfolder"
> >> Set fso =3D CreateObject("Scripting.FileSystemObject")
> >>
> >> Dim dy, mo, yr, hr, mi, se, dyStr, moStr, yrStr, hrStr, miStr, =
seStr,
> >> serStr mo=3Dmonth(Now)
> >> dy=3Dday(Now)
> >> yr=3Dyear(Now)
> >> hr=3Dhour(Now)
> >> mi=3Dminute(Now)
> >> se=3Dsecond(Now)
> >> '
> >> If len(CStr(mo))=3D1 Then
> >> moStr=3D"0"&CStr(mo)
> >> Else
> >> moStr=3DCStr(mo)
> >> End If
> >> '
> >> If len(CStr(dy))=3D1 Then
> >> dyStr=3D"0"&CStr(dy)
> >> Else
> >> dyStr=3DCStr(dy)
> >> End If
> >> '
> >> yrStr=3DRight(CStr(yr),2)
> >> '
> >> If len(CStr(hr))=3D1 Then
> >> hrStr=3D"0"&CStr(hr)
> >> Else
> >> hrStr=3DCStr(hr)
> >> End If
> >> '
> >> If len(CStr(mi))=3D1 Then
> >> miStr=3D"0"&CStr(mi)
> >> Else
> >> miStr=3DCStr(mi)
> >> End If
> >> '
> >> If len(CStr(se))=3D1 Then
> >> seStr=3D"0"&CStr(se)
> >> Else
> >> seStr=3DCStr(se)
> >> End If
> >> '
> >> serStr=3D"T"&yrStr&moStr&dyStr&hrStr&miStr&seStr
> >>
> >> document.all("para1").innerText=3D"Information collected at: " & =
Now
> >> document.all("para2").innerText=3D"Document URL =3D " & docAddress
> >> document.all("para3").innerText=3D"Document Title =3D " & docTitle
> >> document.all("para4").innerText=3D"Document Last Modified on " &
> >> oDocument.LastModified
> >> If strSelection <> "" Then
> >> document.all("para5").innerText=3D"Document Selection =3D " & =
strSelection
> >> End If
> >> document.all("para6").innerText=3D"The info will be bookmarked as " =
&
> >> serStr & " in Word document below"
> >> document.all("para7").innerText=3DstrMyDocs & "\Web_Research.doc"
> >>
> >> Sub B1_onClick
> >> On Error Resume Next
> >> Dim oWd, doc
> >> Set oWd =3D CreateObject("Word.Application")
> >> If Err.Number <> 0 Then
> >> Alert "Problem opening Word or initiating some other object"
> >> Window.Close
> >> End If
> >> If fso.FileExists(strMyDocs & "\Web_Research.doc") Then
> >> Set doc =3D oWd.documents.open(strMyDocs & "\Web_Research.doc")
> >> Else
> >> Set doc =3D oWd.documents.add
> >> doc.SaveAs strMyDocs & "\Web_Research.doc"
> >> End If
> >> Dim rngCurrent
> >> oWd.Selection.WholeStory
> >> oWd.Selection.MoveRight
> >> oWd.Selection.TypeParagraph
> >> oWd.Selection.TypeText("Information gathered at " & Now)
> >> oWd.Selection.TypeParagraph
> >>
> >> Set rngCurrent =3D oWd.Selection
> >> oWd.ActiveDocument.Bookmarks.Add serStr,rngCurrent
> >>
> >> oWd.Selection.TypeText("From ")
> >> oWd.Selection.Font.Color=3D255
> >> oWd.Selection.TypeText("URL ")
> >> oWd.Selection.Font.Color=3D0
> >> oWd.Selection.TypeText(docAddress)
> >> oWd.Selection.TypeParagraph
> >> oWd.Selection.TypeText("Document Title =3D " & docTitle & " then =
last
> >> modified on " & oDocument.LastModified)
> >> If strSelection <> "" Then
> >> oWd.Selection.TypeParagraph
> >> oWd.Selection.Font.Color=3D255
> >> oWd.Selection.TypeText("Selected Text =3D ")
> >> oWd.Selection.Font.Color=3D0
> >> oWd.Selection.TypeText(strSelection)
> >> End If
> >> If comments.Value <> "" Then
> >> oWd.Selection.TypeParagraph
> >> oWd.Selection.Font.Color=3D255
> >> oWd.Selection.TypeText("Comment =3D ")
> >> oWd.Selection.Font.Color=3D0
> >> oWd.Selection.TypeText(comments.Value)
> >> End If
> >> oWd.Selection.TypeParagraph
> >> oWd.Selection.TypeText("********************************")
> >> oWd.ActiveDocument.Save
> >> oWd.ActiveDocument.Close
> >> oWd.Quit
> >> Set oWd =3D Nothing
> >> Window.Close
> >>
> >> End Sub
> >>
> >> Set WSH =3D Nothing
> >>
> >> --></script>
> >>
> >> </BODY>
> >> </html>
> >>
> >> "Larry" <larry328NOSPAM@att.net> wrote in message
> >> news:%23ExdcyGVFHA.580@TK2MSFTNGP15.phx.gbl...
> >> > This seemed like a Windows question more than a Word question, I
> >> > sent it to a Windows newsgroup, and was told it was a Word
> >> > question. So here goes.
> >> >
> >> >
> >> >
> >> > Here's the kind of thing I do a million times. I've just copied
> >> > some text from a web page into Word. Now I want to copy the URL =
of
> >> > that web page into Word.
> >> >
> >> > I do Alt+Tab to switch back to the Internet Exporer page.
> >> >
> >> > I press Alt+D to place cursor in address bar.
> >> >
> >> > I press Ctrl+C to copy the address.
> >> >
> >> > I use Alt+Tab switch back to Word.
> >> >
> >> > I press Ctrl+V to paste the url into Word.
> >> >
> >> > Would there be a way to automate these five steps into one =
action,
> >> > whether done by a .vbs file or some other means?
> >
> >=20
>=20
>
------=_NextPart_000_0651_01C5562B.83581EE0
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dwindows-1252">
<META content=3D"MSHTML 6.00.2800.1491" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV>&nbsp;</DIV>
<DIV>Steve,</DIV>
<DIV><BR>This is great, it's wonderful to know that such capabities =
exist, but=20
this program is geared for a different set up from mine.&nbsp; Here are =
my=20
thoughts and suggestions.&nbsp; </DIV>
<DIV>&nbsp;</DIV>
<DIV>What this does is append each entry to a _closed_ Word =
document.&nbsp; This=20
is perfect for accumulating a lot of material from the web in a kind of =
research=20
project.&nbsp; However, if the document is open, it opens a second =
instance of=20
Word without my custom toolbar and prompts the user to save it.&nbsp; So =
that=20
would have to be changed.&nbsp; The program needs to insert the material =
into=20
open document.&nbsp; And it must not open additional instances of Word =
if Word=20
is already open.&nbsp; That creates problems for me.&nbsp; </DIV>
<DIV>&nbsp;</DIV>
<DIV>Also, I don't need a single saved document into which to put the=20
information from many different such operations.&nbsp; Each such insert =
could go=20
into its own, new Word document, which I could then save manually.&nbsp; =
</DIV>
<DIV>&nbsp;</DIV>
<DIV>When the application opens, it prompts the user for a comment, =
which then=20
makes it necessary to scroll down to where the button is to execute the=20
program.&nbsp; It would be better to skip all that and have the whole =
operation=20
take place in one step.&nbsp; I could do without the comment, since I'm =
going to=20
be working on the Word document into which I've inserted the material, I =
can add=20
whatever I want directly in the Word document.&nbsp; </DIV>
<DIV>&nbsp;</DIV>
<DIV>Another thing.&nbsp; This does not carry over character formatting =
of the=20
selected text, such as italics.&nbsp; I don't supposed that would be=20
possible?&nbsp; If it's not possible, what I might want to do is change =
the=20
program so that it inserts the title and url into a new =
Word&nbsp;document,=20
while <EM>copying</EM> the selected text in the webpage&nbsp;AND =
switching the=20
focus to the Word document, so then all I have to do is paste the =
(formatted)=20
text underneath the title and url.&nbsp; </DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks,</DIV>
<DIV>Larry</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks,<BR>Larry</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>"Steve Yandl" &lt;<A=20
href=3D"mailto:syandl@comcast.net">syandl@comcast.net</A>&gt; wrote in =
message <A=20
href=3D"news:leqdnfyyKohbWx3fRVn-2Q@comcast.com">news:leqdnfyyKohbWx3fRVn=
-2Q@comcast.com</A>...<BR>&gt;=20
Larry,<BR>&gt; <BR>&gt; You may not have to worry about changing the "My =

Documents" folder.&nbsp; Try it <BR>&gt; first to see.&nbsp; The Windows =
Script=20
Host has a set of special folders and the <BR>&gt; path should be =
returned even=20
if it isn't in the usual location or has been <BR>&gt; renamed.<BR>&gt; =
<BR>&gt;=20
The only questions I've received from people have involved notifications =

<BR>&gt; from Norton AV or some other anti-virus software.&nbsp; If =
you're=20
familiar with <BR>&gt; using vbs, this won't throw you off but non =
scripting=20
types can get <BR>&gt; concerned and don't know what to check to feel=20
safe.<BR>&gt; <BR>&gt; <BR>&gt; Steve<BR>&gt; <BR>&gt; <BR>&gt; "Larry" =
&lt;<A=20
href=3D"mailto:larry328NOSPAM@att.net">larry328NOSPAM@att.net</A>&gt; =
wrote in=20
message <BR>&gt; <A=20
href=3D"news:%23xTuFJUVFHA.3532@TK2MSFTNGP09.phx.gbl">news:%23xTuFJUVFHA.=
3532@TK2MSFTNGP09.phx.gbl</A>...<BR>&gt;=20
&gt; Steve,<BR>&gt; &gt;<BR>&gt; &gt; This is just amazing.&nbsp; It =
will be=20
fantastic to be able to do all this in<BR>&gt; &gt; one step.&nbsp; I =
can't wait=20
to install and try this out.&nbsp; I didn't know that<BR>&gt; &gt; an =
html file=20
could have text that was executible code that could be run<BR>&gt; &gt; =
like a=20
macro or a .vbs script.<BR>&gt; &gt;<BR>&gt; &gt; I'm going to use your =
install=20
files rather than try to create this<BR>&gt; &gt; manually.&nbsp;&nbsp; =
The only=20
change I will have to make is changing the path of<BR>&gt; &gt; =
Web_Research"=20
doc since I long ago change my "My Documents" folder's<BR>&gt; &gt; name =
to=20
"Documents."<BR>&gt; &gt;<BR>&gt; &gt; I'll let you know how it =
goes.<BR>&gt;=20
&gt;<BR>&gt; &gt; I'm curious to see if character formatting in the =
selection,=20
such as<BR>&gt; &gt; italics, is carried over.<BR>&gt; &gt;<BR>&gt; &gt; =

Larry<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt; Steve Yandl=20
wrote:<BR>&gt; &gt;&gt; Larry,<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt; This is =
more a=20
vbs and html solution than Word and it isn't quite<BR>&gt; &gt;&gt; what =
you=20
asked for but I think the end result is something you will<BR>&gt; =
&gt;&gt;=20
like.&nbsp; I've done a script that adds a new item to your =
Internet<BR>&gt;=20
&gt;&gt; Explorer context menu.&nbsp; If you select some text on a web =
page=20
and<BR>&gt; &gt;&gt; then right click the selected text, instead of =
selecting=20
'Copy' you<BR>&gt; &gt;&gt; select the new item 'Research Entry'.&nbsp; =
The=20
script looks in your<BR>&gt; &gt;&gt; MyDocuments folder for a Word =
document=20
named "Web_Research.doc" and<BR>&gt; &gt;&gt; creates it if it doesn't =
already=20
exist.&nbsp; It then appends that<BR>&gt; &gt;&gt; document with the =
date and=20
time, the URL of the page, the document<BR>&gt; &gt;&gt; title for the =
page and=20
the selected text.&nbsp; You get a pop up html<BR>&gt; &gt;&gt; window =
to=20
confirm that you want all this to happen and you can enter<BR>&gt; =
&gt;&gt; a=20
typed comment if you want to add a note to the text capture.<BR>&gt;=20
&gt;&gt;<BR>&gt; &gt;&gt; The easy way to get all this is to go =
to<BR>&gt;=20
&gt;&gt; <A=20
href=3D"http://yandlfiles.home.comcast.net/">http://yandlfiles.home.comca=
st.net/</A>=20
and click the link in the upper<BR>&gt; &gt;&gt; left for my text =
archive=20
programs (you will want the second one which<BR>&gt; &gt;&gt; requires=20
Word).&nbsp; The zip files contain a ReadMe file, the core htm<BR>&gt; =
&gt;&gt;=20
file and installation and uninstall scripts.&nbsp; All can be opened =
in<BR>&gt;=20
&gt;&gt; notepad allowing you to check for security concerns or modify=20
the<BR>&gt; &gt;&gt; scripts if you're comfortable with that sort of=20
thing.<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt; If you want do do this the =
manual way,=20
it isn't that tough.<BR>&gt; &gt;&gt; Essentially, a new registry key=20
called<BR>&gt; &gt;&gt; =
HKEY_CURRENT_USER\Software\Microsoft\Internet<BR>&gt;=20
&gt;&gt; Explorer\MenuExt\Research_Entry is created.&nbsp; It is given a =

default<BR>&gt; &gt;&gt; value that is the path and file name to the new =
htm=20
file with the<BR>&gt; &gt;&gt; working components of the script.&nbsp; =
There is=20
also a value named<BR>&gt; &gt;&gt; "Flags" with DWord value of =
1.<BR>&gt;=20
&gt;&gt;<BR>&gt; &gt;&gt; The critical part of the new htm file (beside =
placing=20
where the above<BR>&gt; &gt;&gt; registry key points) are the lines=20
below:<BR>&gt; &gt;&gt; Set =
oWindow=3Dwindow.external.menuArguments<BR>&gt;=20
&gt;&gt; Set oDocument=3DoWindow.document<BR>&gt; &gt;&gt;=20
docAddress=3DoDocument.URL<BR>&gt; &gt;&gt; =
docTitle=3DoDocument.Title<BR>&gt;=20
&gt;&gt;<BR>&gt; &gt;&gt; When those lines are in a script launched from =
the IE=20
context menu,<BR>&gt; &gt;&gt; the appropriate information from the =
document=20
that was right click is<BR>&gt; &gt;&gt; returned. The entire contents =
of the=20
html file I use is below:<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt; =
&lt;html&gt;<BR>&gt;=20
&gt;&gt; &lt;head&gt;<BR>&gt; &gt;&gt; &lt;TITLE&gt;Retrieve and Save =
Web=20
Document Information&lt;/TITLE&gt;<BR>&gt; &gt;&gt; =
&lt;/head&gt;<BR>&gt;=20
&gt;&gt;<BR>&gt; &gt;&gt; &lt;BODY STYLE=3D"BACKGROUND-COLOR:#EEEEEE;=20
MARGIN:10"&gt;<BR>&gt; &gt;&gt; &lt;P ID=3Dpara1&gt;&lt;/P&gt;<BR>&gt; =
&gt;&gt;=20
&lt;P ID=3Dpara2&gt;&lt;/P&gt;<BR>&gt; &gt;&gt; &lt;P=20
ID=3Dpara3&gt;&lt;/P&gt;<BR>&gt; &gt;&gt; &lt;P =
ID=3Dpara4&gt;&lt;/P&gt;<BR>&gt;=20
&gt;&gt; &lt;P ID=3Dpara5&gt;&lt;/P&gt;<BR>&gt; &gt;&gt; =
&lt;p&gt;&lt;font=20
size=3D"4" color=3D"red"&gt;Enter any comments to go with the<BR>&gt; =
&gt;&gt;=20
document information&lt;/font&gt;&lt;/p&gt;<BR>&gt; &gt;&gt;<BR>&gt; =
&gt;&gt;=20
&lt;TEXTAREA ID=3D"comments" cols=3D"52"&gt;&lt;/TEXTAREA&gt;<BR>&gt; =
&gt;&gt; &lt;P=20
ID=3Dpara6&gt;&lt;/P&gt;<BR>&gt; &gt;&gt; &lt;P =
ID=3Dpara7&gt;&lt;/P&gt;<BR>&gt;=20
&gt;&gt; &lt;p&gt;&lt;input type=3D"button" name=3D"B1" value=3D"&nbsp; =
SAVE TO=20
WEB_RESEARCH.DOC<BR>&gt; &gt;&gt; "&gt;<BR>&gt; &gt;&gt;<BR>&gt; =
&gt;&gt;=20
&lt;script language=3D"VBScript"&gt;&lt;!--<BR>&gt; &gt;&gt;<BR>&gt; =
&gt;&gt; Dim=20
oWindow, oDocument, docAddress, docTitle, oSelect, oSelectRange,<BR>&gt; =

&gt;&gt; strSelection, WSH, fso<BR>&gt; &gt;&gt; Set=20
oWindow=3Dwindow.external.menuArguments<BR>&gt; &gt;&gt; Set=20
oDocument=3DoWindow.document<BR>&gt; &gt;&gt; =
docAddress=3DoDocument.URL<BR>&gt;=20
&gt;&gt; docTitle=3DoDocument.Title<BR>&gt; &gt;&gt; If docTitle =3D "" =
Then<BR>&gt;=20
&gt;&gt; docTitle =3D "(no document title)"<BR>&gt; &gt;&gt; End =
If<BR>&gt;=20
&gt;&gt; Set oSelect=3DoDocument.selection<BR>&gt; &gt;&gt; Set=20
oSelectRange=3DoSelect.createRange()<BR>&gt; &gt;&gt;=20