Aug 21st, 2017, 06:57 AM
#1
Thread Starter
Lively Member
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
Aug 21st, 2017, 07:02 AM
#2
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.
Aug 21st, 2017, 07:10 AM
#3
Thread Starter
Lively Member
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
Aug 21st, 2017, 10:26 AM
#4
Fanatic Member
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 .
Aug 21st, 2017, 12:08 PM
#5
Thread Starter
Lively Member
Re: add texet 1 vb6 to td table htm Then save
Aug 21st, 2017, 01:31 PM
#6
Fanatic Member
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>
Aug 21st, 2017, 01:36 PM
#7
Thread Starter
Lively Member
Re: add texet 1 vb6 to td table htm Then save
Code Dummy
Thank you for your interaction
Yes this is required
Aug 22nd, 2017, 07:10 AM
#8
Thread Starter
Lively Member
Re: add texet 1 vb6 to td table htm Then save
Aug 22nd, 2017, 08:40 AM
#9
Re: add texet 1 vb6 to td table htm Then save
What have you tried so far?
Where did you get stuck?
Aug 22nd, 2017, 10:43 AM
#10
Thread Starter
Lively Member
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
Aug 22nd, 2017, 11:18 AM
#11
Fanatic Member
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
Aug 22nd, 2017, 11:27 AM
#12
Thread Starter
Lively Member
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
Aug 22nd, 2017, 01:03 PM
#13
Fanatic Member
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
Aug 22nd, 2017, 01:35 PM
#14
Thread Starter
Lively Member
Re: add texet 1 vb6 to td table htm Then save
Code Dummy
Becoming page index.htm laminate insert data
Aug 22nd, 2017, 01:37 PM
#15
Thread Starter
Lively Member
Re: add texet 1 vb6 to td table htm Then save
Aug 22nd, 2017, 01:48 PM
#16
Thread Starter
Lively Member
Re: add texet 1 vb6 to td table htm Then save
Please help me
Aug 22nd, 2017, 01:51 PM
#17
Fanatic Member
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
Aug 22nd, 2017, 02:07 PM
#18
Thread Starter
Lively Member
Re: add texet 1 vb6 to td table htm Then save
Code Dummy
No results appear
Editing is required until the result appears
Aug 22nd, 2017, 04:24 PM
#19
Fanatic Member
Re: add texet 1 vb6 to td table htm Then save
What about the other 2 questions
Aug 22nd, 2017, 04:35 PM
#20
Thread Starter
Lively Member
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
Aug 22nd, 2017, 05:11 PM
#21
Fanatic Member
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
Aug 22nd, 2017, 05:15 PM
#22
Thread Starter
Lively Member
Re: add texet 1 vb6 to td table htm Then save
table border="1" id="m" in page index.htm
Aug 22nd, 2017, 09:12 PM
#23
Fanatic Member
Re: add texet 1 vb6 to td table htm Then save
I think this is what you want
Attached Files
Aug 22nd, 2017, 09:19 PM
#24
Thread Starter
Lively Member
Re: add texet 1 vb6 to td table htm Then save
code dummy
There is no code in the example
Aug 22nd, 2017, 10:00 PM
#25
Fanatic Member
Re: add texet 1 vb6 to td table htm Then save
Attached Files
Aug 22nd, 2017, 10:59 PM
#26
Thread Starter
Lively Member
Re: add texet 1 vb6 to td table htm Then save
code dummy
Thanks this is already required
Aug 23rd, 2017, 11:34 AM
#27
Thread Starter
Lively Member
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>")
Aug 23rd, 2017, 11:59 AM
#28
Fanatic Member
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
Aug 23rd, 2017, 12:04 PM
#29
Thread Starter
Lively Member
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> </td>
</tr>
<tr>
<td> adf</td>
<td> </td>
</tr>
</table>
</div>
</span> </p>
<p> </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> </td>
<td> </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
Aug 23rd, 2017, 01:20 PM
#30
Fanatic Member
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
Aug 23rd, 2017, 01:31 PM
#31
Thread Starter
Lively Member
Re: add texet 1 vb6 to td table htm Then save
Required is added only in table id m
Aug 23rd, 2017, 01:37 PM
#32
Thread Starter
Lively Member
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)
Aug 23rd, 2017, 02:02 PM
#33
Fanatic Member
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
Aug 23rd, 2017, 02:05 PM
#34
Thread Starter
Lively Member
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
Aug 23rd, 2017, 03:36 PM
#35
Fanatic Member
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
Aug 23rd, 2017, 03:40 PM
#36
Thread Starter
Lively Member
Re: add texet 1 vb6 to td table htm Then save
I would like a complicated route
Aug 23rd, 2017, 04:14 PM
#37
Fanatic Member
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 .
Aug 23rd, 2017, 04:17 PM
#38
Thread Starter
Lively Member
Aug 23rd, 2017, 07:30 PM
#39
Fanatic Member
Re: add texet 1 vb6 to td table htm Then save
I trust you will find this a bit more stylistic
Attached Files
Aug 23rd, 2017, 11:01 PM
#40
Thread Starter
Lively Member
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
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width