Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Counting Images In Html *Solved*


Very long time since my last post :P

Well, I have a new little project going.. and this is part of it...

I have an html file loaded up in a Webbrowser, and I'm wondering How can count all the images (which are inside table rows) and have a certain dimension (40x40)

Its been a while but i was trying to remember the name...
I thought you could do something like..

For each Imgobject in webbrowser1.document.innerhtml
if imgobject.width = 40 then
if imgobject.height = 40 then
imgcounter = imgcounter + 1
end if
end if
next

?? Something simple like that.. I just cant remeber what to refrence in order to see the properties/elements/methods after web.document ......

Any help or examples are cool.

** edit **

Well, I toyed with it and plowed through the msdn.. and finally came up with this code... works absolutley flawless... adding the source incase anyone every needs it


Code:
u = 0
For Each HTMLImg In web1.document.getElementsByTagName("IMG")
If HTMLImg.Width = 40 Then
If HTMLImg.Height = 40 Then
Debug.Print HTMLImg.src
u = u + 1
End If
End If
Next

lblu.Caption = u




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
*Solved* Removing Images From A Downloaded HTML File ?
Ok I've written a ugly but functional parsing program for a website. That part works fine, but rather slow.

I need to find some method of stripping the url of any image in a predownloaded webpage. Something simple like a method of going through each img tag and setting the url = "" or removing the img tag all together...

Problem Is I'm using that api for downloading a site, and it pulls it as 1 giant block, and when read into vb it stays as one giant string.


Code:
Public Function DownloadFile(URL As String, LocalFilename As String) As Boolean
Dim lngRetVal As Long
lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
If lngRetVal = 0 Then DownloadFile = True
End Function


Thats the api i'm talking about...

Need any more info just ask... Ive been working on this project for a week straight now

Counting Down [SOLVED]
I have a timer and a label with the caption set as 90 (seconds)

How do i get the label to countdown til it gets to 0?

Cheers

Counting With SQL [not Solved]
Because I'm not so familliar with SQL I want to ask how I count in a databse. There is a column called "be" and I want to count how often the content of "be" is e.g. "ML". (my initials )
Additionally how do I put this in my vbcode and display the result in a msgbox.
The things I fund in my VB-Help aren't helpful for me yet (german):

VB Code:
'COUNT-Befehl (Beispiel)'Im folgenden Beispiel werden die Kunden in Paris gezählt und das Ergebnis angezeigt. CLOSE DATABASESOPEN DATABASE (HOME(2) + 'Data estdata')USE customer  && Öffnet Tabelle Customer CLEARCOUNT FOR UPPER(city) = 'PARIS'DISPLAY FIELDS company, contact FOR UPPER(city) = 'PARIS'  

Is it something like this???:
Data6.RecordSource = "SELECT Count('be') AS [not Null] FROM tab1 WHERE be = 'ML'"

Thanks for some Help, Matthew

[SOLVED!!]Noob Help!!!! Counting
Hello!!!

I need help counting the total number twos there are in a A1:E5 data range of numbers...any help would be appreciated

something like

1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5

messagebox: there are four number twos

please help!!!!
thanks in advance

Counting Not Working [solved]
the thing you use to count up is not working for some reason, im using
VB Code:
countn = countn + 1
but its not counting up, heres my code


VB Code:
Private Sub Command1_Click()     savey = Text1.Text     Text1.Text = savey & "p" & countn & "_Click" & vbNewLine     countn = countn + 1 '#this is not working#     If countn = 100 Then Exit SubEnd Sub


so tell me, why isn't it working?

Counting Records *SOLVED*
Say i've got 154 records in my table and when I scroll through the records I want to be able to display which record it is and how many records there are in the table. New records are always added to the table so the total number of records needs to change when a new record is added.

In a label I want it to display something like.......002 of 154

Lintz

Counting Check Boxes *SOLVED*
Just wanting a little help with some code to count the number of check boxes ticked and displayed the result in a text box or label automatically.

Thanks
Lintz.

Counting The Images In A String?
Is there a way to either count the URLs or the Images in a string?

I have the source of a page saved to a string, through Inet, but would like to see the number of times a specific string appears.

HTML Help Workshop: Html Files Without Images
Hi,

I've done many html page with text and image.
Then I've created an help guidi with "HTML Help Workshop".

The matter is that I've an help file with text but Without images.

Why the compiler doesn't save images to the final file?
As a result of compile run is:

Compiling c:LavoriSCGuida.chm


Compile time: 0 minutes, 1 second
17 Topics
32 Local links
0 Internet links
0 Graphics <--- why is this zero?


Created c:LavoriSCGuida.chm, 10,595 bytes
Compression increased file by 10,279 bytes.

thanx in advance

Counting Pages Of A HTML File
Greetings!
Does any of you know for some api code or someting like that for counting pages for an existing HTML file?
The webBrowser or DHTMLEdit Control don't do it (or I haven't find someting about them)

Thanks in advance

HTML Help Workshop: Html Without Images
Hi,

I've done many html page with text and image.
Then I've created an help guidi with "HTML Help Workshop".

The matter is that I've an help file with text but Without images.

Why the compiler doesn't save images to the final file?
As a result of compile run is:

Compiling c:LavoriSCGuida.chm


Compile time: 0 minutes, 1 second
17 Topics
32 Local links
0 Internet links
0 Graphics <--- why this is zero?


Created c:LavoriSCGuida.chm, 10,595 bytes
Compression increased file by 10,279 bytes.

thanx in advance

Flash Images [SOLVED]
If I create an animated flash image, is there a way to show it in my vb app, and to still have it animated?

Loading Images[solved]
Is it possible to load an image (with LoadPicture()) into an variable?

I need to preload some images before i use them, and using an ImageList seems kinda komplex, so i'm wondering if you can load images into variables in runtime, or something like that.

Thanks in advance

HOW TO DISPLAY GIF IMAGES? ***[101% SOLVED]***
Hello friends,
Can any one suggest me how to dispaly GIF animations in VB6. I use scriptlet but it shows white back ground and a bigger annoying borders around thw image. Any suggestions plz

Haris



Edited by - harisraz on 8/22/2004 11:08:33 AM

Images In Popup Menus (**SOLVED**)
I have a popup menu with an icon next to the text in the menu (icons come from a invisible picturebox) Works great, but when i turn the menu invisible so its not seen at the top of the form and only seen if a button is clicked. The pictures don't show up. here is my code.


Module:
Code:
Public Declare Function GetMenuItemID Lib "user32" (ByVal hMenu As Long, _
  ByVal nPos As Long) As Long
Public Declare Function GetSubMenu Lib "user32" (ByVal hMenu As Long, _
  ByVal nPos As Long) As Long
Public Declare Function SetMenuItemBitmaps Lib "user32" (ByVal hMenu As Long, _
  ByVal nPosition As Long, ByVal wFlags As Long, ByVal hBitmapUnchecked As Long, _
  ByVal hBitmapChecked As Long) As Long



Form Load:
Code:
Private Sub Form_Load()
Dim hMenu As Long
  Dim hSubMenu As Long
  Dim nPosition As Long
  Dim i As Long
  Dim x As Long
  
  hMenu = GetMenu(Me.hwnd)
  hSubMenu = GetSubMenu(hMenu, 0) '0 = the position of the menu on the menu bar
  For i = 0 To 2
    nPosition = GetMenuItemID(hSubMenu, i)
    x = SetMenuItemBitmaps(hMenu, nPosition, 0, CLng(Picture1(i).Picture), CLng(Picture1(i).Picture))
  Next
End Sub
 

I don't understand why this doesn't work. It's probably something simple that I have overlooked.
Thanks for your help.




Edited by - mgodfreys on 12/8/2003 3:13:31 PM

HTML && VB6 Question **SOLVED**
I am trying to get this HTML:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">

into a text box with the proper formatting.


Private Sub Command3_Click()

Text9.Text = "<form action=" & "https://www.paypal.com/cgi-bin/webscr" & "method=" & "post" & ">"

End Sub


I cannot get "https://www.paypal.com/cgi-bin/webscr" and

"post" to correctly format using the " "

Thanks for any help.

Send HTML To IE ***SOLVED***
Hi all.

I have generated HTML code using XML and XSL in XMLDOM object in VB. I now need to display that HTML in IE (cannot use the webbrowser control, doesn't recognize <style> tags). I can open IE using the ShellExecute function, but now how do i display my HTML with is stored in a string variable in IE (no writing to file should be done).

Thanks, Help would really be appreciated and is highly needed.

***Once again thanks for your help***



Edited by - rlrob008 on 4/6/2004 3:23:34 AM

HTML-Images
How to align Images in Center.

<Img src="c:
anjithdog.gif" align="middle"> is not working.

HTML To RTF Images
Hello, I am new on this forum and I hope you can help me in my problems !

I've got an HTML files with images (on same directory), I take this HTML file and convert it in RTF Format

Set oWord = New Word.Application

nFile = CStr(numFile) & ".html"

oWord.Visible = False
oWord.Documents.Open (App.Path & "" & nFile)

oWord.ActiveDocument.SaveAs FileName:=App.Path & "" & CStr(numFile) & ".rtf", _
FileFormat:=wdFormatRTF

oWord.ActiveDocument.Close

By doing that, I was hoping that RTF file will transform image in its format and not make an INCLUDE PICTURE

In fact, the RTF file must be saved in a BLOB table in Database and I would like to "include" pictures in RTF and not to make reference

Could you help me ?
Thanks

Text Form Html? [Solved]
I was thinking if it was possible to get the text from a html page.

I don't want the source code, i just want the text, simple text.

Thanks

Parsing Through A .html File, And... *Solved*
How would i start Parsing through a .html File, and...
writing all occurances of http://MySite.com/****** to a .txt file,
*** can be anything,

It will always be enclosed like:

href="http://MySite.com/***"

Now, i have the .html document, using the
HTML=INet1.openURL(URL)

Anyone help me with this please?

TNX

Get Images From HTML Files
Hi every one
I realy need to get the images in a HTML file
but with out using WebBrowser only With HTML Object Library
by the way i can get the images using both WB and HTML OL

Code:
Private Sub Getimages(StrURL As String)
MousePointer = vbHourglass
Dim iDoc As HTMLDocument
Dim Element As Object

WebBrowser1.navigate StrURL

While Not WebBrowser1.readyState = READYSTATE_COMPLETE
DoEvents
Wend
Set iDoc = WebBrowser1.document
For Each Element In iDoc.All
If Element.tagName = "IMG" Then

LstImages.AddItem Element.href
End If
Next
MousePointer = vbDefault
End Sub
Why I want that because it's faster then waiting the WB to comlete loading files

SO I WANT TO GET IMAGES WITHOUT USING WEBBROWSER ONLY HTML OBJECT LIBRARY

Thumbnails For PDF, HTML, PPT (not Just Images)
Hello All,

Is there an API that can "bring" the thumbnail of any file (if there is, If not I know how to extract the application icon). In explorer I can click on view => thumbnails and see the thumbnails of PDF, HTML, PPT files and more..

I have search and all I found were projects for thumbnails that worked only on images (jpg,gif,bmp..) But I want it to work as in explorer, for all supported types.

Any ideas ?

Thanks allot,

- George

Get All Images Link From HTML
i wrote this.......

but when i use debug.print img then it dont show anything in intermediate area


vb Code:
Public Sub imgTag(theData As String)Dim I As Long, Z As Long, S As Long, IMG As StringOn Error GoTo HeLLS = 1Dim DD As String    For I = 1 To UBound(Split(Text2.Text, "src="))        S = InStr(S, Text2.Text, "<img src=" & Chr(34))        Z = InStr(S, Text2.Text, Chr(34))        IMG = Mid(Text2.Text, S, (Z - Z))        debug.print IMG        S = S + 5    NextHeLL:    Exit SubEnd Sub

Images Not Showing In HTML Help
Hi team

I'm currently building a compiled HTML help file using the HTML Help utility from Microsoft. I have built the help pages using Frontpage and added screenshots. It all works in the design environment. However, when I compile the help file the images do show in the resulting chm file. Does anyone know what's wrong?

Thanks

FW

HTML Help Workshop No Images
I compiled my HTML Help workshop project, included all my html and jpg images in the [FILES] section of the project and Image tags to the files in the actual htmll files. Project files and all source files exist in same directory. After compilation it reports no graphics compiled, looks fine when I open .chm file (and .chm file is pretty big so obviously contains all images) but when I open it on another PC all the images are broken.

Has anyone seen this before?

Thanks!

Html Preformatted Text?(SOLVED BYME)
Is there a way to format text in vb to be html preformatted?

*solved* Reading The HTML Of A Document, Via WebBrowserControl?
How can i get the HTML of a document in the web browser control?

*edit*

I tried to use the INet control,
But it Forwards to the next page (meta-refresh) before it collects the data or that ?

So is there a way with the webbrowser control?
And if so, how can i stop Images Downloading? (they lag out so much

Downloading Images After HTML Parse
Hi,

this is my first post so go easy on me

I have written some code to parse HTML and rip out the url for each of the images. How do I save each of these images to disk?

Thanks in advance

marto

Datareport - HTML Export - Images
I create a datareport and successfully preview/print the image in a rptImage control.

When I export the report as HTML I loose the image.

Is there anyway I can overcome this?

RTF 2 HTML (Images In RTF Document 2 JPEG) How ?
Hi,

This is the code I use for converting RTF 2 HTML


VB Code:
Function RichToHTML(rtbRichTextBox As RichTextLib.RichTextBox, Optional lngStartPosition As Long, Optional lngEndPosition As Long) As String'Description: Converts rich text to HTML.'Original Code by Josheph Huntley'Edited by Dasith Wijesirieadena to convert more efficiantly Form11.ShowfMainForm.WindowState = vbMinimized fMainForm.Enabled = False On Error Resume NextForm11.SetFocus Dim blnBold As Boolean, blnUnderline As Boolean, blnStrikeThru As BooleanDim blnItalic As Boolean, strLastFont As String, lngLastFontColor As LongDim strHTML As String, lngColor As Long, lngRed As Long, lngGreen As LongDim lngBlue As Long, lngCurText As Long, strHex As String, intLastAlignment As Integer fMainForm.MousePointer = vbHourglassfMainForm.RichText2.TextRTF = ""fMainForm.RichText2.Width = rtbRichTextBox.WidthfMainForm.RichText2.Height = rtbRichTextBox.HeightfMainForm.RichText2.TextRTF = Replace(rtbRichTextBox.TextRTF, vbCrLf & "par", Chr(31) & vbCrLf & "par") lngStartPosition& = 0lngEndPosition& = Len(fMainForm.RichText2.text) Const AlignLeft = 0, AlignRight = 1, AlignCenter = 2 'check for lngStartPosition ad lngEndPosition If IsMissing(lngStartPosition&) Then lngStartPosition& = 0If IsMissing(lngEndPosition&) Then lngEndPosition& = Len(fMainForm.RichText2.text) lngLastFontColor& = -1 'no colorintLastAlignment% = -1    For lngCurText& = lngStartPosition& To lngEndPosition&      Form11.ProgressBar1.Value = (lngCurText& / lngEndPosition&) * 100   DoEvents          fMainForm.RichText2.SelStart = lngCurText&       fMainForm.RichText2.SelLength = 1                      If intLastAlignment% <> fMainForm.RichText2.SelAlignment Then             intLastAlignment% = fMainForm.RichText2.SelAlignment                 Select Case fMainForm.RichText2.SelAlignment                   Case AlignLeft: strHTML$ = strHTML$ & "<p align=left>"                   Case AlignRight: strHTML$ = strHTML$ & "<p align=right>"                   Case AlignCenter: strHTML$ = strHTML$ & "<p align=center>"                End Select                          End If             If blnBold <> fMainForm.RichText2.SelBold Then               If fMainForm.RichText2.SelBold = True Then                 strHTML$ = strHTML$ & "<b>"               Else                 strHTML$ = strHTML$ & "</b>"               End If             blnBold = fMainForm.RichText2.SelBold          End If           If blnUnderline <> fMainForm.RichText2.SelUnderline Then               If fMainForm.RichText2.SelUnderline = True Then                 strHTML$ = strHTML$ & "<u>"               Else                 strHTML$ = strHTML$ & "</u>"               End If             blnUnderline = fMainForm.RichText2.SelUnderline          End If              If blnItalic <> fMainForm.RichText2.SelItalic Then               If fMainForm.RichText2.SelItalic = True Then                 strHTML$ = strHTML$ & "<i>"               Else                 strHTML$ = strHTML$ & "</i>"               End If             blnItalic = fMainForm.RichText2.SelItalic          End If            If blnStrikeThru <> fMainForm.RichText2.SelStrikeThru Then               If fMainForm.RichText2.SelStrikeThru = True Then                 strHTML$ = strHTML$ & "<s>"               Else                 strHTML$ = strHTML$ & "</s>"               End If             blnStrikeThru = fMainForm.RichText2.SelStrikeThru          End If          If (strLastFont$ <> fMainForm.RichText2.SelFontName) Or (strLastFontsize$ <> fMainForm.RichText2.SelFontSize) _         Or (lngLastFontColor& <> fMainForm.RichText2.SelColor) Then                     strLastFont$ = fMainForm.RichText2.SelFontName            strLastFontsize$ = fMainForm.RichText2.SelFontSize                        If strLastFontsize$ = 0 Then                strLastFontsize$ = 1            End If                        lngLastFontColor& = fMainForm.RichText2.SelColor                        ''Get hexidecimal value of color            strHex$ = Hex(fMainForm.RichText2.SelColor)            strHex$ = String$(6 - Len(strHex$), "0") & strHex$            strHex$ = Right$(strHex$, 2) & Mid$(strHex$, 3, 2) & Left$(strHex$, 2)                                                'strHTML$ = strHTML$ + "</font><font face=" & Chr(34) & strLastFont$ & Chr(34) & " size=" & Round(strLastFontsize$ * 4 / 18, 0) & " color=#" & strHex$ & ">"            strHTML$ = strHTML$ + "</font><font face=" & Chr(34) & strLastFont$ & Chr(34) & " size=" & Round(strLastFontsize$ * 4 / 18, 0) & " style=" & Chr(34) & "font-size:" & strLastFontsize$ & "pt" & Chr(34) & " color=#" & strHex$ & ">"         End If         strHTML$ = strHTML$ & Replace(fMainForm.RichText2.SelText, Chr(31), "<br>" & vbCrLf)    Next lngCurText&   strHTML$ = Replace(strHTML$, "      ", "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;")strHTML$ = Replace(strHTML$, "     ", "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;")strHTML$ = Replace(strHTML$, "    ", "&nbsp;&nbsp;&nbsp;&nbsp;")strHTML$ = Replace(strHTML$, "   ", "&nbsp;&nbsp;&nbsp;")strHTML$ = Replace(strHTML$, "  ", "&nbsp;&nbsp;") RichToHTML = strHTML$ Unload Form11fMainForm.WindowState = vbMaximizedfMainForm.Enabled = True fMainForm.MousePointer = vbNormal 'MsgBox ("Done Converting To HTML !")fMainForm.RichText2.TextRTF = "" End Function


But as You can see the images won't be inserted into the HTML documents .......

Can you please suggest a way to detect images in a RTF document and insert them as JPEG to a HTML file .......

*I have a code that converts BMP's to JPEg........


VB Code:
I want something like this htmlcode = convert2Html(rtfCode) Doif seltext is image = true then   convert rtf image to bmp/jpeg   add a <img> tag to the html codeelse   convert the normal rtftext to html using my above codeend ifloop

[SOLVED] HTML Form DOM/Script Error Woes
I have a web browser object on my VB project, and in the page I am loading I have the following HTML object:


Code:
<textarea name="message">


I know it is possible, but how would I go about setting the contents of this textarea to a VB variable's value?


VB Code:
webbrowser.document.all.message.text = myMessage


or something?

Part 2 to my question is how to simulate through VB code, the clicking on an image in the webbrowser?

here is my html code for my button:

Code:
<input type="image" src="http://www.mysite.com/images/button.gif" onClick="document.post.post.value='true';" alt="Submit" title="Submit" width="67" height="15" />

Send Html Mail With Images Through Outlook Using VB 6.0
Dear sir,

I developed one application for sending bulk mail through outlook 2000, by programming in VB 6.0. Now i face a problem that i can't send images through my html mail. there r more than one images.

I think now i have to use CDO object, but i don't know how to use it in my application. I find some code from net but i have more images so,i don't know how can i use it?, Please check this below code and guide me.

my image path is like C:........*.jpg that's why i can't see it in my mail.
so what i have to do for change it and place it on net.

' create new Outlook MailItem
Set objApp = CreateObject("Outlook.Application")
Set l_Msg = objApp.CreateItem(olMailItem)
' add graphic as attachment to Outlook message
' change path to graphic as needed
Set colAttach = l_Msg.Attachments
Set l_Attach = colAttach.Add("c: estgraphic.jpg")
l_Msg.Close olSave
strEntryID = l_Msg.EntryID
Set l_Msg = Nothing
' *** POSITION CRITICAL *** you must dereference the
' attachment objects before changing their properties
' via CDO
Set colAttach = Nothing
Set l_Attach = Nothing

' initialize CDO session
On Error Resume Next
Set oSession = CreateObject("MAPI.Session")
oSession.Logon "", "", False, False

' get the message created earlier
Set oMsg = oSession.GetMessage(strEntryID)
' set properties of the attached graphic that make
' it embedded and give it an ID for use in an <IMG> tag
Set oAttachs = oMsg.Attachments
Set oAttach = oAttachs.Item(1)
Set colFields = oAttach.Fields
Set oField = colFields.Add(CdoPR_ATTACH_MIME_TAG, "image/jpeg")
Set oField = colFields.Add(&H3712001E, "myident")
oMsg.Fields.Add "{0820060000000000C000000000000046}0x8514", 11, True
oMsg.Update

' get the Outlook MailItem again
Set l_Msg = objApp.GetNamespace("MAPI").GetItemFromID(strEntryID)
' add HTML content -- the <IMG> tag
l_Msg.HTMLBody = "<IMG align=baseline border=0 hspace=0 src=cid:myident>"
l_Msg.Close (olSave)
l_Msg.Display

' clean up objects
Set oField = Nothing
Set colFields = Nothing
Set oMsg = Nothing
oSession.Logoff
Set oSession = Nothing

Please Reply soon.

Thanks
Kinjal.

Displaying And Resizing Vector Images Using ASP/HTML
Ok, I'm not even sure this is the right place to ask so apologies if it isn't.

I have a title graphic that I want to display across the full width of a page. I have drawn it as a vector image and would much prefer to use it in this format as it would scale much better (although I'm using it as an exported JPG at the moment). It forms the top of a menu table down the side of the page as well so this is why the scaling is also important.

I want to basically resize the image depending on the users screen resolution/browser width (whichever is best to use) and then I can scale the rest of the menu images by the same amount.

Any ideas?

How Do I Remove JavaScript From HTML Source Using Regular Expressions. Almost Solved.
Well, almost solved, though I cant get rid of the darn JavaScript. Here's what I got so far:

Add references to "Microsoft VBScript Regular Expressions 5.5".

On Form:
place 2 text boxes, 1 Inet control, and 2 buttons.

VB Code:
Private Sub Command1_Click()Text1 = Inet1.OpenURL("http://www.yujunet.com/")End Sub Private Sub Command2_Click()Dim temp1 As StringDim temp2 As StringDim temp3 As StringDim newstringtemp1 = RemoveLines(Text1)temp2 = RegExFind(temp1, "<script[^>]*>(.*)</script>")temp3 = RegExReplace(temp1, temp2, "")temp3 = RemoveHTML(temp3)Text2 = temp3End Sub


In Module:

VB Code:
Function RemoveLines(myString As String)    'convert multiline to single line string:    myString = Replace(myString, vbTab, " ")   'removes Tabs    myString = Replace(myString, Chr(13), " ")    myString = Replace(myString, Chr(10), " ")    myString = Replace(myString, vbCrLf, " ")    myString = Replace(myString, vbNewLine, " ")    RemoveLines = myStringEnd Function  Function RegExFind(myString As String, FindWhat As String)On Error Resume Next    'Create objects.   Dim objRegExp As RegExp   Dim objMatch As Match   Dim colMatches   As MatchCollection   Dim RetStr As String    Set objRegExp = New RegExp   objRegExp.Pattern = FindWhat   objRegExp.IgnoreCase = True   objRegExp.Global = True   objRegExp.MultiLine = True   If (objRegExp.Test(myString) = True) Then    Set colMatches = objRegExp.Execute(myString)    For Each objMatch In colMatches      RetStr = objMatch.Value    Next   Else    RetStr = "" 'No matches   End If   RegExFind = RetStrEnd Function  Function RegExReplace(myString As String, FindThis As String, ReplaceWithThis As String)On Error Resume Next    'search string for item and then replace with new item:    Dim sourse1 As String, resourse As Object    sourse1 = myString    Set resourse = New RegExp    resourse.Pattern = FindThis    resourse.Global = True    resourse.IgnoreCase = True    If resourse.Test(sourse1) = True Then        myString = resourse.Replace(sourse1, ReplaceWithThis)    End If    RegExReplace = myStringEnd Function  Function RemoveHTML(strText As String)    Dim RegEx    Set RegEx = New RegExp    RegEx.Pattern = "<[^>]*>"    RegEx.Global = True    RegEx.IgnoreCase = True    strText = Replace(strText, "&nbsp;", "")    RemoveHTML = RegEx.Replace(strText, "")End Function


Any suggestions would really help

BHO Question- How To Save Images To Disk (from Within A HTML Page In IE)??
Hai all,

I am writing a BHO application in VB6. I am now able to access the HTML content from within IE windows.

All was going well for me until I had to do this:

I have to copy all image/css files in the HTML document to a folder on the hard-disk.

I DONT want to do this by copying the images from Temporary Internet Files folder. Is there any possible method by which we can directly read out the image files from the IE window? (just as we read out HTML with outerHTML())

I also dont want to use sockets to read the files from the server again.

Below is some code which will print out the names of all the images in the current document. I hope some addition here would do the job for me!?!?


Code:


Dim HTMLDoc As mshtml.HTMLDocument
Dim ElementCollection As Object
Dim tmp_imageName As String
Set HTMLDoc = ie_Obj.document

Dim HTML_img_element As mshtml.HTMLImg
For Each HTML_img_element In HTMLDoc.images
tmp_imageName = HTML_img_element.src
debug.Print tmp_imageName
Next



any help would be greatly appreciated!
thanks for ur time!

regards,

Pradeep V

Missing Vertical Lines And Images In Exportreport (html)
I have a datareport and want to export it to html (I will upload it later), the problem is tha i lost all the vertical lines, is there any way to see that? and, is there any way to export the images in the report, in the HTML I onlyu have the text and the horizontal lines :S

thanks

BHO Question- How To Save Images To Disk (from Within A HTML Page In IE)??
Hai all,

I am writing a BHO application in VB6. I am now able to access the HTML content from within IE windows.

All was going well for me until I had to do this:

I have to copy all image/css files in the HTML document to a folder on the hard-disk.

I DONT want to do this by copying the images from Temporary Internet Files folder. Is there any possible method by which we can directly read out the image files from the IE window? (just as we read out HTML with outerHTML())

I also dont want to use sockets to read the files from the server again.

Below is some code which will print out the names of all the images in the current document. I hope some addition here would do the job for me!?!?


Code:

Dim HTMLDoc As mshtml.HTMLDocument
Dim ElementCollection As Object
Dim tmp_imageName As String
Set HTMLDoc = ie_Obj.document

Dim HTML_img_element As mshtml.HTMLImg
For Each HTML_img_element In HTMLDoc.images
tmp_imageName = HTML_img_element.src
debug.Print tmp_imageName
Next


any help would be greatly appreciated!
thanks for ur time!

regards,

Pradeep V

Problems With Inserting Html Files With Gif/jpg Images Into Word 2000 Doc -help
Hi ,
I am pretty new to this forum this also includes being new to programming in word with visual basic 6..
Anyway, at the moment I have a slight problem.. I have noticed that when I save a html file into a word document using the word object model under visual basic 6, the gif/jpg image appears great. However, the moment I then insert this temporary document into the final word document the gif/jpg image all of a sudden disappears. I was wondering if anyone knows whta I have done wrong or how I can get around this problem..
Also the version of word that I have installed on my XP machine is:
windows 2000 (9.04402 SR-1)
I would be extremely greatful for your help
thanks
gladrags

[SOLVED] Logical Thinking Required (strings), Parsing Links, And HTML Content
In this thread we're going to build a complete URL string from multiple strings. Some logical thinking required

HTML links can be very different:

Code:
1 <a href="index.html">file in this directory</a>
2 <a href="./index.html">file in this directory</a>
3 <a href="../index.html">file in one directory down</a>
4 <a href="../../index.html">file in two directories down</a>
5 <a href="../../">a directory two directories down</a>
6 <a href="/file.html">file in root directory</a>
7 <a href="http://server.com/file.html">complete link to the file</a>
8 <a href="http://server.com/////file.html">same as above</a>
9 <a href="http://server.com/././///./file.html">same as above</a>
10 <a href="/">root directory</a>


Lets say we stripped the HTML codes, and got one of the links from the above:

VB Code:
myURL = "./index.html"


And here's some VB code to construct some of the above links into a complete URL:


VB Code:
Function FixURL(myURL As String, myBaseURL As String, ThisLocation As String)Dim myNewURL As String        If Left$(myURL, 2) = "./" Then            myNewURL = ThisLocation & Right$(myURL, Len(myURL) - 2)        ElseIf Left$(myURL, 1) = "/" Then            myNewURL = myBaseURL & Right$(myURL, Len(myURL) - 1)        ElseIf Left$(myURL, 3) = "../" Then            myNewURL = myBaseURL & Right$(myURL, Len(myURL) - 3)        ElseIf Left$(myURL, 7) = "http://" Then            myNewURL = myURL        Else            myNewURL = ThisLocation & myURL        End If        FixURL = myNewURLEnd Function

Well, lets say we have few strings to play with:

VB Code:
myHTML = Inet1.OpenURL(xURL)'do some other stuff here myURL = "./index.html" 'it could be any of the example links from the above myBaseURL = "http://" & Inet1.RemoteHostIf Right$(myBaseURL, 1) <> "/" Then myBaseURL = myBaseURL & "/" 'example: ThisLocation = "http://www.google.com/about/"ThisLocation = Inet1.URLIf Right$(ThisLocation, 1) <> "/" Then ThisLocation = ThisLocation & "/" 'lets use the above function to get a complete URL:myURL = FixURL(myURL, myBaseURL, ThisLocation)


In the above example we will build a complete URL: http://www.google.com/about/index.html

The problem is that ThisLocation could be:
ThisLocation = "http://www.google.com/dir/sample.html"
and myURL could be"
myURL = "otherfile.html"
Then the output will be incorrect:
http://www.google.com/dir/sample.html/otherfile.html

The problem is in FixURL function. Would anyone one take this logical challenge?

Character Counting, Line Counting And Saving RTB Files Without Formatting
Hi,

I quickly need to get a bit of help with the 3 things mentioned in the topic title:

Character Counting
When the RichTextBox is changed I want a label's caption to be changed so it counts all characters in the RTB. Not just words, I mean as in each and every letter, space, etc. I searched and search, and found nothing.

Line Counting
I also want, when the RTB is changed, for another label's caption is changed and now says how many lines are in the RTB. I tried doing this myself with getting the label's caption to be +1 for every time enter (vbCrLf) is clicked or used, but that didn't work and properly wouldn't do what I need it to do anyway.

Saving through a RTB without formatting
Basically, when you use the "SaveFile()" Protocol in a RTB it saves, yes, but it has formatting, like so:


Code:
{
tf1ansideff0{fonttbl{f0fnilfcharset0 MS Sans Serif;}}
viewkind4uc1pardlang1033f0fs17 [b]|<b>
par line 2
par line 2
par line3
par
par }


Which isn't what I want it to do, I just want it to save it like a normal text file, no formatting, just text, is there a way to override it's default action to do the above formatting?

Thanks in advanced.

Runtime Error 91. [Solved], ADO Global Connect [Not Solved]
I am sure this problem has to do with further lack of my knowledge of modules. But here is what is happening.

If you remember from my last post, I have a module now named Uconnect. Here is the code in thre:


VB Code:
Public Conn As ADODB.Connection  Public Sub UserConnect()Set Conn = New ADODB.ConnectionConn.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};" _& "SERVER=192.168.0.10;" _& "DATABASE=testim;" _& "UID=" & Form1.txtUser.Text & ";" _& "PWD=" & Form1.txtPass.Text & ";" _& "OPTION=" & 1 + 2 + 8 + 32 + 2048 + 16384 Conn.CursorLocation = adUseClientConn.OpenDebug.Print Conn.State End Sub


That all works great now when I call the Sub from my main form. Connection state shows a 1. Here is the problem. Right after I call this sub from the main form, I have an If Else statement checking to see if the connection is good.


VB Code:
Call UserConnectIf Conn.State = 1 Then Unload frmInfo Form1.Caption = "You are logged " Set rs = New ADODB.Recordset Etc, Etc, Etc.


On debugging, as soon as the Call to UserConnect is done I get this error on the If Conn.State =1 Then line.

RunTime Error 91
Object Variable or With block variable not set.

As usual, I am sure I am missing something simple.

Thanks again

Simple Question Solved, One More Thing Please. Solved
I am using VBA in Excel.

I want to save the excel sheet as a .txt file delimited by a pipe and overwrite it without that pop-up you get with that warning that you are overwriting an existing file.

Any quick help would make my day!





Edited by - jonnie on 10/6/2003 4:58:13 PM

Solved - How To Close Solved Threads?
I am a new member to this forum.
can somebody tell me how to close solved threads.
I have created 2 threads and which are solved. I would like to close them.
thanx

[SOLVED] Wierd Saving Bug [SOLVED]
i am using this code to save some settings to a file

VB Code:
Public Sub saveini(filename As String)If Replace(filename, " ", "") = "" Then filename = "default.ini"  Open (filename) For Output As #1   Print #1, "[Ump3 V2 ini file]"   Print #1, "Groups{" & playlistsettings.GROUPS   Print #1, "Playlist{" & playlistsettings.file   Print #1, "Skin=default"   Print #1, "randomize{" & playback.randomized   Print #1, "repeat{" & playback.repeat  Close #1  SaveSetting "ump3v2", "settings", "ini file", App.PATH & "" & filenameEnd Sub


what i get is :

[Ump3 V2 ini file]
Groups{Waar
Playlist{none
Skin=default
randomize{Onwaar
repeat{Onwaar


everything ok here.. BUT ... instead of giving me TRUE OR FALSE it gives me the values WAAR (true) and onwaar (FALSE well un true to be freely translating but still) this is really anoying because onload of my form i cant read those values into a boolean .... how to fix this stupid saving thing???

running on windows XP pro , Sp1 , Vb6

Creating Images With Preset Images
Well this is a short little question, no real big explanation needed thank god

I'm needing to know if it is possible to create an image by combining about 3-6 images together and positioning them. Let's say I have Image1.gif, Image2.gif, Image3.gif, and Image4.gif. I want to combine them all together with Image1.gif at the top, Image2.gif at the bottom, Image3.gif to the right, and Image4.gif to the right. Is this possible?

Thanks in advance!
~S0RD3N

Clicking Images On Google Images
hi..i've asked a similar question like this before, but my old method doesnt seem to work.

when you search google images, and get your results, i want to click the first result tha ti get with my app.

im using this code but it doesnt work.


Code:
WebBrowser1.Document.All.Item("tDataImage0").Click



how would one go about doing this?

How To Shade Between Cells In HTML, I Am Creating Report In Html From Vb6 ! Attached
Hi,

I need a help in shading between cells in my report which i prepar in HTML. Here with this post i attached my project in a Zip file, the database is also in the same Directory. You can open and run the project named Scheduler.vbp inside the Folder Sheduler. It will work. The path for database is already assigned.

1. Run the Project, in the main Form u can see the "Forecast Shutdown" Button & Click it. U will see the Form where i generate report. Just click the report button to see the report in the Internet Explorer, because all values are given default.

2. What i require is, the final look of my html report will be as similar to the scd.bmp in Sheduler Folder. You can see the shade starts from middle of one cell & ends in the middle of the next cell.

I populated data from table and the work is completed except the shade similar to the scd.bmp

3. Now i am changing the background color only. But i need to shade as it is in the scd.bmp.

The shade is given based on 3 fields, you see the Field name in the Report heading.

1. T&I ETS as per OSPAS (Shade should start from this date)
2. D-OFF STRM (Adding this value to StartDate the shade should end)

I posted this question in some Forums, i get some replies, but i am not able to solve the issue.
the link follows

http://www.htmlforums.com/showthread...172#post432172

http://www.siteexperts.com/forums/vi...=17282&start=4

http://www.siteexperts.com/forums/vi...d=18336&Sort=0

http://forum.java.sun.com/thread.jsp...004753#4004753

It will be much helpful if i get help & solved this, bcause my contract ends (Dec 15th).


Instead of giving ideas, it wouldl be better if you given me the solution by modifiying the code. Because i got some suggestions and i tried them & it didn't work out & some suggestions i can't use and see because of not having proper knowledge in the specified area. The project is also there. So it will be more helpful if u give me the solution. Hope the one who works with web development & Vb6 can give me a solution.

Thankyou,
Chock.

Three Objects For HTML Via VB 6 (Inet, WebBrowser && HTML) GET META && InnerText
Dear Fellows,

I have few issues in the HTML.

WebBrowser (control):
I am using the WebBrowser component to receive the HTML of web pages, but:
The InnerHTML returning INSIDE the <BODY> (the body tag not includes).
The OuterHTML returning from the <BODY>.


Inet (control):
Or else I am using the Inet component to retrieve the HTML and it dose get it all (with the meta).
I have browse the Inet object to get the InnerText, I haven’t found.
 
I NEED TO GET THE META OBJECT.
I NEED TO GET THE InnerText.

I don’t want to mix with the two objects in order to receive both (Meta & InnerText)

I have started to develop a function that will CONVERT the HTML to TEXT.
I am sure that it dose exist out there.
I AM LOOKING FOR THIS OBJECT (that can be one help)
Note: the conversion of the html should get the html with the tags and the “&”marks (&amp; = “&” or &gt; = “>” etc…) [I don’t know the official naming for them].

Some web pages have redirect when you type one address in the address bar and you get the second one as a result, I need the object to get it too.

Main Question:
1.    how do I get (which object) all the HTML, within it the Title & META and the InnerText of a web page.
I need that object to get me the redirect of URL.


Best regards & thank your 4 using VbCity,
Isaac

Copyright © 2005-08 www.BigResource.com, All rights reserved