Home All Groups Group Topic Archive Search About
Author
30 Jul 2010 3:47 PM
avi
Hello,

I want basically to create from vb6  an simple html file ("c:
\Image1.html") which will display a JPG image file ("c:\Image1.jpg")

I am not proficient at html

Is there a simple vb6 function to achieve this?

Regards
Avi

Author
30 Jul 2010 4:10 PM
Tom Shelton
avi used his keyboard to write :
> Hello,
>
> I want basically to create from vb6  an simple html file ("c:
> \Image1.html") which will display a JPG image file ("c:\Image1.jpg")
>
> I am not proficient at html
>
> Is there a simple vb6 function to achieve this?
>
> Regards
> Avi

There isn't a simple function built in.  But, I might still have my old
cgi class library laying around - and that had a lot of functions for
dynamcially generating html....  I look around, and if I find it - I'll
post the code somewhere.

--
Tom Shelton
Author
30 Jul 2010 4:48 PM
Larry Serflaten
"avi" <avi***@bezeqint.net.il> wrote
>
> I want basically to create from vb6  an simple html file ("c:
> \Image1.html") which will display a JPG image file ("c:\Image1.jpg")
>
> I am not proficient at html
>
> Is there a simple vb6 function to achieve this?

In a word....  (no)

Internet Explorer will open and display a jpg file (as well as other image
files).  Unless you want to add words, you do not need to create a page,
just open the file.

  Shell "C:\Program Files\Internet Explorer\IEXPLORE.EXE ""D:\temp\einstein.jpg"""

LFS
Author
30 Jul 2010 5:27 PM
avi
Thanks but I need it it with as an html file

Regards
Avi
Author
30 Jul 2010 5:41 PM
Kevin Provance
"avi" <avi***@bezeqint.net.il> wrote in message
news:7d0b54c8-8cf7-4988-92c2-ca5981d2e6d0@g19g2000yqc.googlegroups.com...
: Thanks but I need it it with as an html file
:
: Regards
: Avi

Air code, not tested

Public Function ImgToHTML (ByVal sImage As String) As String
    Dim sHTML    As String

    sHTML = "<HTML>"
    sHTML = sHTML & "<BODY>"
    sHTML = sHTML & "<img src=""" & sImage & """>"
    sHTML = sHTML & "</BODY>"
    sHTML = sHTML & "</HTML>"

    ImgToHTML = sHTML
End Function

Then save your html string to a file with a .html extension
Author
30 Jul 2010 5:52 PM
Jeff Johnson
"avi" <avi***@bezeqint.net.il> wrote in message
news:7d0b54c8-8cf7-4988-92c2-ca5981d2e6d0@g19g2000yqc.googlegroups.com...

> Thanks but I need it it with as an html file

Honestly, it's 2010. Learn HTML. It's not going anywhere and you'll be hard
pressed as a programmer to avoid it.
Author
30 Jul 2010 6:07 PM
avi
Kevin's code works nicely

Many thanks
avi