Page 1 of 2 12 LastLast
Results 1 to 40 of 41

Thread: add texet 1 vb6 to td table htm Then save

  1. #1

    Thread Starter
    Lively Member k7l2010's Avatar
    Join Date
    Feb 2017
    Posts
    70

    add texet 1 vb6 to td table htm Then save

    Hello
    Please Help
    add texet 1 vb6 to td table htm Then save


    index.htm

    PHP Code:
    <html dir="ltr">

    <
    head>
    <
    meta http-equiv="Content-Language" content="ar-sa">
    <
    meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <
    title>save page</title>
    </
    head>

    <
    body>
     

    <
    div align="center">
        <
    table border="1" id="m" style="border-collapse: collapse" width="87" bordercolorlight="#808080" bordercolordark="#808080">
            <
    tr>
                <
    td bgcolor="#C0C0C0"><span lang="en-us">name</span></td>
            </
    tr>
            <
    tr>
                <
    td><span lang="en-us">hhh</span></td>
            </
    tr>
            <
    tr>
                <
    td><span lang="en-us">adf</span></td>
            </
    tr>
        </
    table>
    </
    div>

    </
    body>

    </
    html

    Required Edit Code vb6


    On Error GoTo Error
    Open App.Path & "\index.htm" For Output As #1

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: add texet 1 vb6 to td table htm Then save

    Can you be more specific? Are you trying create a <td> entry for each line of a multi-line textbox? If not, where is the text from the textbox suppose to be inserted exactly?

    Also where does this html exist in your code? A variable, another textbox, something else? You must be writing it to App.Path, correct? Are you writing the entire html at once, or line by line? It may be helpful to see that part of the code.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3

    Thread Starter
    Lively Member k7l2010's Avatar
    Join Date
    Feb 2017
    Posts
    70

    Re: add texet 1 vb6 to td table htm Then save

    LaVolpe Thank you for your quick interaction on the subject

    Required

    add new td to table htm

    And save the page

    in a way

    On Error GoTo Error
    Open App.Path & "\index.htm" For Output As #1

    text1 = i

  4. #4
    Fanatic Member
    Join Date
    Apr 2017
    Posts
    554

    Re: add texet 1 vb6 to td table htm Then save

    I get the impression that OP wants to add the text to the td lines where it has hhh and adf. Also, maybe the line that has name but not sure. But then in post #3 OP says to add new td to table so I am not 100% sure what's being asked here

    <td><span lang="en-us">hhh</span></td>
    </tr>
    <tr>
    <td><span lang="en-us">adf</span></td>
    Last edited by Code Dummy; Aug 21st, 2017 at 10:30 AM.

  5. #5

    Thread Starter
    Lively Member k7l2010's Avatar
    Join Date
    Feb 2017
    Posts
    70

    Re: add texet 1 vb6 to td table htm Then save


  6. #6
    Fanatic Member
    Join Date
    Apr 2017
    Posts
    554

    Re: add texet 1 vb6 to td table htm Then save

    If I enter a name into the textbox do you want that name added to the td table

    For example:

    Before I enter name into textbox

    Code:
    <table border="1" id="m" style="border-collapse: collapse" width="87" bordercolorlight="#808080" bordercolordark="#808080">
    
      <tr> 
        <td bgcolor="#C0C0C0"><span lang="en-us">name</span></td>
      </tr> 
      
      <tr> 
        <td><span lang="en-us">hhh</span></td> 
      </tr> 
       
      <tr> 
        <td><span lang="en-us">adf</span></td> 
      </tr> 
    
    </table>
    After I enter name into textbox

    Code:
    <table border="1" id="m" style="border-collapse: collapse" width="87" bordercolorlight="#808080" bordercolordark="#808080">
    
      <tr> 
        <td bgcolor="#C0C0C0"><span lang="en-us">name</span></td>
      </tr> 
      
      <tr> 
        <td><span lang="en-us">hhh</span></td> 
      </tr> 
       
      <tr> 
        <td><span lang="en-us">adf</span></td> 
      </tr> 
    
      <tr> 
        <td><span lang="en-us">Code Dummy</span></td> 
      </tr> 
    
    </table>

  7. #7

    Thread Starter
    Lively Member k7l2010's Avatar
    Join Date
    Feb 2017
    Posts
    70

    Re: add texet 1 vb6 to td table htm Then save

    Code Dummy
    Thank you for your interaction


    Yes this is required

  8. #8

    Thread Starter
    Lively Member k7l2010's Avatar
    Join Date
    Feb 2017
    Posts
    70

    Re: add texet 1 vb6 to td table htm Then save

    ؟؟؟؟

  9. #9
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,871

    Re: add texet 1 vb6 to td table htm Then save

    What have you tried so far?
    Where did you get stuck?

  10. #10

    Thread Starter
    Lively Member k7l2010's Avatar
    Join Date
    Feb 2017
    Posts
    70

    Re: add texet 1 vb6 to td table htm Then save

    Arnoutdv

    Code is required to add text in the web page table and then save

  11. #11
    Fanatic Member
    Join Date
    Apr 2017
    Posts
    554

    Re: add texet 1 vb6 to td table htm Then save

    No one is going to write the code for you. You need to write some code and post it then we will try to help you with that. You have to make an effort

  12. #12

    Thread Starter
    Lively Member k7l2010's Avatar
    Join Date
    Feb 2017
    Posts
    70

    Re: add texet 1 vb6 to td table htm Then save

    These are some of my attempts



    On Error GoTo Error
    Open App.Path & "\index.htm" For Output As #1
    For i = 0 To 100
    Text1 = i
    Write #1, m.rows[i].cells[0].innerText
    Next i
    Error:
    Close #1

  13. #13
    Fanatic Member
    Join Date
    Apr 2017
    Posts
    554

    Re: add texet 1 vb6 to td table htm Then save

    Why are you putting i into Text1? Is it just to see the numbers as you go through the loop

    What is m

    What does your code do? Does it give any results. If yes show what the results are

  14. #14

    Thread Starter
    Lively Member k7l2010's Avatar
    Join Date
    Feb 2017
    Posts
    70

    Re: add texet 1 vb6 to td table htm Then save

    Code Dummy

    Becoming page index.htm laminate insert data

  15. #15

    Thread Starter
    Lively Member k7l2010's Avatar
    Join Date
    Feb 2017
    Posts
    70

    Re: add texet 1 vb6 to td table htm Then save

    The same illustration is required


    https://e.top4top.net/p_598n1dwm1.gif

  16. #16

    Thread Starter
    Lively Member k7l2010's Avatar
    Join Date
    Feb 2017
    Posts
    70

    Re: add texet 1 vb6 to td table htm Then save

    Please help me


    Name:  بدون بب.png
Views: 318
Size:  179.3 KB

  17. #17
    Fanatic Member
    Join Date
    Apr 2017
    Posts
    554

    Re: add texet 1 vb6 to td table htm Then save

    You did not answer my question. I wont help you if you don't help me

  18. #18

    Thread Starter
    Lively Member k7l2010's Avatar
    Join Date
    Feb 2017
    Posts
    70

    Re: add texet 1 vb6 to td table htm Then save

    Code Dummy



    No results appear

    Editing is required until the result appears

  19. #19
    Fanatic Member
    Join Date
    Apr 2017
    Posts
    554

    Re: add texet 1 vb6 to td table htm Then save

    What about the other 2 questions

  20. #20

    Thread Starter
    Lively Member k7l2010's Avatar
    Join Date
    Feb 2017
    Posts
    70

    Re: add texet 1 vb6 to td table htm Then save

    do not understand much in the English language Google translate

    Can you help me with my problem?
    Add a table to index.htm

  21. #21
    Fanatic Member
    Join Date
    Apr 2017
    Posts
    554

    Re: add texet 1 vb6 to td table htm Then save

    In your code in post 12

    Write #1, m.rows[i].cells[0].innerText

    What is m

  22. #22

    Thread Starter
    Lively Member k7l2010's Avatar
    Join Date
    Feb 2017
    Posts
    70

    Re: add texet 1 vb6 to td table htm Then save

    table border="1" id="m" in page index.htm

  23. #23
    Fanatic Member
    Join Date
    Apr 2017
    Posts
    554

    Re: add texet 1 vb6 to td table htm Then save

    I think this is what you want
    Attached Files Attached Files

  24. #24

    Thread Starter
    Lively Member k7l2010's Avatar
    Join Date
    Feb 2017
    Posts
    70

    Re: add texet 1 vb6 to td table htm Then save

    code dummy

    There is no code in the example

  25. #25
    Fanatic Member
    Join Date
    Apr 2017
    Posts
    554

    Re: add texet 1 vb6 to td table htm Then save

    Sorry about that
    Attached Files Attached Files

  26. #26

    Thread Starter
    Lively Member k7l2010's Avatar
    Join Date
    Feb 2017
    Posts
    70

    Re: add texet 1 vb6 to td table htm Then save

    code dummy

    Thanks this is already required

  27. #27

    Thread Starter
    Lively Member k7l2010's Avatar
    Join Date
    Feb 2017
    Posts
    70

    Re: add texet 1 vb6 to td table htm Then save

    There is a problem when adding another table to a page. Can I specify this field to id?

    So that the addition is only in the table id = m

    trIndex = InStrRev(InputString, "</tr>")

  28. #28
    Fanatic Member
    Join Date
    Apr 2017
    Posts
    554

    Re: add texet 1 vb6 to td table htm Then save

    I do not understand what your problem is. Every new name added to the table is in the table with id of m. Look at the htm code and you see all names in table id=m. If you have made any changes to the code then you need to show what you have

  29. #29

    Thread Starter
    Lively Member k7l2010's Avatar
    Join Date
    Feb 2017
    Posts
    70

    Re: add texet 1 vb6 to td table htm Then save

    HTML Code:
    <html dir="ltr">
    
    <head>
    <meta http-equiv="Content-Language" content="ar-sa">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>save page</title>
    </head>
    
    <body>
    <div ></div>
    
    
    <div align="center">
    <table border="1" id="m" style="border-collapse: collapse" width="87" bordercolorlight="#808080" bordercolordark="#808080">
    <tr>
      <td bgcolor="#C0C0C0"><span lang="en-us">name</span></td>
      <td bgcolor="#C0C0C0"><span lang="en-us">number</span></td>
    </tr>
    <tr>
      <td>hhh</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>adf</td>
      <td>&nbsp;</td>
    </tr>
    
      </table>
    </div>
    
    </span></p>
    
    <p>&nbsp;</p>
    <div align="center">
    	<table border="1" style="border-collapse: collapse" width="158" bordercolorlight="#808080" bordercolordark="#808080">
    		<tr>
    			<td bgcolor="#999966"><span lang="en-us">d</span></td>
    			<td bgcolor="#999966"><span lang="en-us">d</span></td>
    		</tr>
    		<tr>
    			<td>&nbsp;</td>
    			<td>&nbsp;</td>
    		</tr>
    	</table>
    </div>
    
    </body>
    
    </html>

    Here lies the addendum to the last table required to add the ID m




    Private Sub Command1_Click()
    Dim InputString As String

    Dim Name As String

    Open App.Path & "\index.htm" For Binary As #1
    InputString = String(LOF(1), " ")
    Get #1, 1, InputString
    Close #1

    Dim trIndex As Long
    Dim s1 As String, s2, s3, s4

    trIndex = InStrRev(InputString, "</tr>")

    If trIndex > 0 Then
    s1 = Left(InputString, trIndex + 6)
    s2 = Mid(InputString, trIndex - 1)

    Name = Text1.Text

    s1 = s1 & "<tr>" & vbCrLf & _
    "<td><span lang=""en-us""" & ">" & _
    Name & _
    "</span></td>" & _
    "<td><span lang=""en-us""" & ">" & _
    Text2.Text & _
    "</span></td>" & _
    "</tr>" & vbCrLf & _
    Mid(InputString, trIndex - 1)

    Open App.Path & "\index.htm" For Output As #2
    Print #2, s1
    Close #2

    Else
    Stop
    '
    ' Do what you want here
    '
    End If

    ShowDocument
    End Sub

  30. #30
    Fanatic Member
    Join Date
    Apr 2017
    Posts
    554

    Re: add texet 1 vb6 to td table htm Then save

    I see you have changed everything, the code and the html.

    OK, so now what do you want. What goes into the other table and what is in Text2

  31. #31

    Thread Starter
    Lively Member k7l2010's Avatar
    Join Date
    Feb 2017
    Posts
    70

    Re: add texet 1 vb6 to td table htm Then save

    Required is added only in table id m


    Name:  صورة1.jpg
Views: 245
Size:  7.4 KB

  32. #32

    Thread Starter
    Lively Member k7l2010's Avatar
    Join Date
    Feb 2017
    Posts
    70

    Re: add texet 1 vb6 to td table htm Then save

    Who can make the code stylistically

    Text1.text=m.rows[i].cells[0].innerText

    Text2.text=m.rows[i].cells[1].innerText


    Instead of this complicated code


    trIndex = InStrRev(InputString, "</tr>")

    If trIndex > 0 Then
    s1 = Left(InputString, trIndex + 6)
    s2 = Mid(InputString, trIndex - 1)

    Name = Text1.Text

    s1 = s1 & "<tr>" & vbCrLf & _
    "<td><span lang=""en-us""" & ">" & _
    Name & _
    "</span></td>" & "</tr>" & vbCrLf & _
    Mid(InputString, trIndex - 1)

  33. #33
    Fanatic Member
    Join Date
    Apr 2017
    Posts
    554

    Re: add texet 1 vb6 to td table htm Then save

    Do you want this

    Text1.text=m.rows[i].cells[0].innerText

    Text2.text=m.rows[i].cells[1].innerText


    or do you want this

    m.rows[i].cells[0].innerText = Text1.text

    m.rows[i].cells[1].innerText = Text2.text

  34. #34

    Thread Starter
    Lively Member k7l2010's Avatar
    Join Date
    Feb 2017
    Posts
    70

    Re: add texet 1 vb6 to td table htm Then save

    m.rows[i].cells[0].innerText = Text1.text

    m.rows[i].cells[1].innerText = Text2.text


    Yes this is required

  35. #35
    Fanatic Member
    Join Date
    Apr 2017
    Posts
    554

    Re: add texet 1 vb6 to td table htm Then save

    I don't know how to do this using the method you prefer so you either have to accept my complicated code or get someone else to do it for you I don't care one way or another

  36. #36

    Thread Starter
    Lively Member k7l2010's Avatar
    Join Date
    Feb 2017
    Posts
    70

    Re: add texet 1 vb6 to td table htm Then save

    I would like a complicated route

  37. #37
    Fanatic Member
    Join Date
    Apr 2017
    Posts
    554

    Re: add texet 1 vb6 to td table htm Then save

    I will try to do it like you prefer but if I can't I'll post the other way

    The problem is you already have two td elements; hhh and adf. Now I know that

    m.cols(1).cells(0) is hhh and m.cols(1).cells(1) is the number for hhh and

    m.cols(2).cells(0) is adf and m.cols(2).cells(1) is the number for adf

    but now there are no more td's so the problem is I don't know how to add a table element after adf so I then would use

    m.cols(3).cells(0) = Text1 and m.cols(3).cells(1) = Text2

    I have never done this before so I have to find out how to add another table td entry
    Last edited by Code Dummy; Aug 23rd, 2017 at 04:23 PM.

  38. #38

    Thread Starter
    Lively Member k7l2010's Avatar
    Join Date
    Feb 2017
    Posts
    70

    Re: add texet 1 vb6 to td table htm Then save

    code dummy

    Thank you for supporting me waiting for you


  39. #39
    Fanatic Member
    Join Date
    Apr 2017
    Posts
    554

    Re: add texet 1 vb6 to td table htm Then save

    I trust you will find this a bit more stylistic
    Attached Files Attached Files

  40. #40

    Thread Starter
    Lively Member k7l2010's Avatar
    Join Date
    Feb 2017
    Posts
    70

    Re: add texet 1 vb6 to td table htm Then save

    Thanks for the Nobel Prize
    Yes this is required
    The last request is completed
    Can I do this without having to

    the tool WebBrowser1

    this way

    Dim InputString As String

    Dim Name As String

    Open App.Path & "\index.htm" For Binary As #1
    InputString = String(LOF(1), " ")
    Get #1, 1, InputString
    Close #1

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width