I need a script that will examine a folder to discover all the files (jpg
images) in the folder and then create html that displays the images in my
current FrontPage web page . I can then move the images around on the page
and then save the page which will place the images in the web's images
folder.

If I do it manually using Insert/Picture etc then I get html which looks
like:

<p><img border="0" src="../../Data/LEASURE/Places/Newbury/DSC01160.JPG"
width="480" height="640">

I am puzzled that the drive and highest level folder which contains the
image is not shown.

I have only a little experience of VB and none of using VBA in FrontPage (if
VBA CAN be used in FrontPage)

any thoughts?

Davy

Re: Script to Auto Insert Images into MS FrontPage? by Paul

Paul
Wed Jan 30 13:13:55 CST 2008


"Davy" <david@REMOVEallTHISchobham.org.uk> wrote in message
news:MPidndPDm6UEpj3anZ2dnUVZ8rKdnZ2d@brightview.com...
>I need a script that will examine a folder to discover all the files
>(jpg
> images) in the folder and then create html that displays the images
> in my
> current FrontPage web page . I can then move the images around on
> the page
> and then save the page which will place the images in the web's
> images
> folder.
>
> If I do it manually using Insert/Picture etc then I get html which
> looks
> like:
>
> <p><img border="0"
> src="../../Data/LEASURE/Places/Newbury/DSC01160.JPG"
> width="480" height="640">
>
> I am puzzled that the drive and highest level folder which contains
> the
> image is not shown.
>
> I have only a little experience of VB and none of using VBA in
> FrontPage (if
> VBA CAN be used in FrontPage)
>
> any thoughts?

Hi, Davy

I never got around to playing with any version FrontPage. I don't
think it had a VBA or macro language, but I could be wrong.

Microsoft has had many flavors of the BASIC programming language over
the years. Visual Basic (aka VB) was the expensive top-of-the-line
flavor, whose last version was 6.0, I think, which came out late in
the last century. It is completely different from VBA, which replaces
the macro language of previous versions of the various Office
applications. There is VBA for Word, VBA for Access, VBA for Excel,
and perhaps other flavors of VBA; they are similar but contain things
specific to their office application. I suppose there could be a VBA
for your version of FrontPage. VB and VBA are completely different
from VBScript, which was originally designed to be used for scripting
within web pages, but which can be used within any windows scripting
host, like WSH, .HTA, and .HTML files.

This is a VBScript newsgroup; VBScript is easily capable of recursing
through a folder and its subfolders, and building HTML anchor or image
element strings which can be written to a simple HTML file, and maybe
your version of FrontPage will be able to manipulate things the way
you want.

The scripting documentation is in file SCRIPT56.CHM which should
already be installed on your system, but which you can download from
msdn.microsoft.com. In general this documentation is quite good,
although there are some undocumented features. One you might want to
use is the picture object, which will get you the dimensions of the
pictures (it is in the Visual Basic documentation). Maybe FrontPage
will do this for you more easily.

The format you talked about,
> <p><img border="0"
> src="../../Data/LEASURE/Places/Newbury/DSC01160.JPG"
> width="480" height="640">
isn't so puzzling if you remember how to use the chdir or cd commands
to move upward in the directory structure in a command line window
(aka DOS box).
Something like cd ../../data/LEASURE/Places/Newbury/DSC01160.JPG
would take you up two directory levels from the current directory
level, then down multiple levels through the data folder to the .JPG
file. This format is called a relative path -- relative to the path
of the HTML file the anchor or image element resides in. If a drive
letter and path were used, it would be an absolute path. If you
decided to move the whole set of web pages and the underlying files to
a different drive or folder, it would be a piece of cake with relative
paths - just move the folder structure; it would be a nightmare of
changes with absolue paths.

The file system object (explained in the scripting help file) has some
handy path-parsing methods which work equally well for file paths and
url paths. These method names all start with the word get, like
GetParentFolderName and GetExtensionName.

-Paul Randall



Re: Script to Auto Insert Images into MS FrontPage? by Davy

Davy
Thu Jan 31 03:11:54 CST 2008

Paul,
thanks for the prompt and comprehensive reply. At least now I understand
the file path.
I will try to investigate some of the leads you have given me,
thanks
Davy
"Paul Randall" <paulr901@cableone.net> wrote in message
news:OQ9MDS3YIHA.536@TK2MSFTNGP06.phx.gbl...
>
> "Davy" <david@REMOVEallTHISchobham.org.uk> wrote in message
> news:MPidndPDm6UEpj3anZ2dnUVZ8rKdnZ2d@brightview.com...
> >I need a script that will examine a folder to discover all the files
> >(jpg
> > images) in the folder and then create html that displays the images
> > in my
> > current FrontPage web page . I can then move the images around on
> > the page
> > and then save the page which will place the images in the web's
> > images
> > folder.
> >
> > If I do it manually using Insert/Picture etc then I get html which
> > looks
> > like:
> >
> > <p><img border="0"
> > src="../../Data/LEASURE/Places/Newbury/DSC01160.JPG"
> > width="480" height="640">
> >
> > I am puzzled that the drive and highest level folder which contains
> > the
> > image is not shown.
> >
> > I have only a little experience of VB and none of using VBA in
> > FrontPage (if
> > VBA CAN be used in FrontPage)
> >
> > any thoughts?
>
> Hi, Davy
>
> I never got around to playing with any version FrontPage. I don't
> think it had a VBA or macro language, but I could be wrong.
>
> Microsoft has had many flavors of the BASIC programming language over
> the years. Visual Basic (aka VB) was the expensive top-of-the-line
> flavor, whose last version was 6.0, I think, which came out late in
> the last century. It is completely different from VBA, which replaces
> the macro language of previous versions of the various Office
> applications. There is VBA for Word, VBA for Access, VBA for Excel,
> and perhaps other flavors of VBA; they are similar but contain things
> specific to their office application. I suppose there could be a VBA
> for your version of FrontPage. VB and VBA are completely different
> from VBScript, which was originally designed to be used for scripting
> within web pages, but which can be used within any windows scripting
> host, like WSH, .HTA, and .HTML files.
>
> This is a VBScript newsgroup; VBScript is easily capable of recursing
> through a folder and its subfolders, and building HTML anchor or image
> element strings which can be written to a simple HTML file, and maybe
> your version of FrontPage will be able to manipulate things the way
> you want.
>
> The scripting documentation is in file SCRIPT56.CHM which should
> already be installed on your system, but which you can download from
> msdn.microsoft.com. In general this documentation is quite good,
> although there are some undocumented features. One you might want to
> use is the picture object, which will get you the dimensions of the
> pictures (it is in the Visual Basic documentation). Maybe FrontPage
> will do this for you more easily.
>
> The format you talked about,
> > <p><img border="0"
> > src="../../Data/LEASURE/Places/Newbury/DSC01160.JPG"
> > width="480" height="640">
> isn't so puzzling if you remember how to use the chdir or cd commands
> to move upward in the directory structure in a command line window
> (aka DOS box).
> Something like cd ../../data/LEASURE/Places/Newbury/DSC01160.JPG
> would take you up two directory levels from the current directory
> level, then down multiple levels through the data folder to the .JPG
> file. This format is called a relative path -- relative to the path
> of the HTML file the anchor or image element resides in. If a drive
> letter and path were used, it would be an absolute path. If you
> decided to move the whole set of web pages and the underlying files to
> a different drive or folder, it would be a piece of cake with relative
> paths - just move the folder structure; it would be a nightmare of
> changes with absolue paths.
>
> The file system object (explained in the scripting help file) has some
> handy path-parsing methods which work equally well for file paths and
> url paths. These method names all start with the word get, like
> GetParentFolderName and GetExtensionName.
>
> -Paul Randall
>
>