Paul
Fri Sep 07 04:27:22 PDT 2007
<richard.clayton@office2office.biz> wrote in message
news:1189158160.364049.177410@o80g2000hse.googlegroups.com...
>I wany to put the following in the HTA <body>
>
> <TABLE><TR><TD><A href=001.txt>001</A></TD><TD><A href=002.txt>002</
> A></TD></TR>
> </TABLE>
> The idea being the user clicks on the link and it brings up Notepad.
>
>>From what I've read I believe something like the following needs to be
> in the script.
> Set objNotepad = CreateObject("Notepad.Application")
> objNotepad.Visible = True
>
> but this gives an Active-X error and even if it didn't give an error I
> don't know what to do after that.
>
> Thanks in anticipation
Wouldn't it be nice if every program you use could be treated as a COM
object? Well, a whole lot of programming goes into this interaction between
programs. Many (probably most) programs do not have a COM interface.
Notepad does not. It cannot be used with the CreateObject() statement.
The windows OS comes with lots of COM objects you can use in scripts, like
Internetexplorer.application. You need an 'object browser' to find out what
they are and what properties, methods, events, etc. are associated with
these objects. Each of the M$ Office applications include a form of VBA and
an editor. The editor includes the capability to browse the objects on your
computer. TLViewer is one free third-party object browser which I like
better. It is available at
http://www.tlviewer.org/tlviewer/index.htm.
There are other ways to start and run an application. You might use the
shell.application object to run a command; this command might be Notepad
followed by the name of a file that you want to open in notepad. I don't
recall whethe the <href ...> tag can be used to shell run Notepad; I think
it might require some JScript. Hopefully someone else will present an
example.
Do you want Notepad to just display the text, manipulate the text within
notepad or print it? Notepad has some command line options available.
-Paul Randall