Private Sub Command1_Click() Text1.Text = Inet1.OpenURL(Text2.Text) End Sub
เท่านี้ Code HTML จาก URL ที่ใส่ใน Text2 ก็จะมาอยู่ใน Text1 แล้วครับ
Private Sub Command1_Click() Text1.Text = Inet1.OpenURL(Text2.Text) End Sub
Function Chr2Hex(ByVal strChr As String) As String Dim i As Integer For i = 46 To 122 Step 1 If Chr(i) = strChr Then Chr2Hex = Hex(i) Exit Function End If Next End Function Function Chr2HexAd(ByVal strChr As String) As String Dim i As Integer, strA As String strA = "" For i = 1 To Len(strChr) Step 1 If Len(strA) = 0 Then strA = Chr2Hex(Mid(strChr, i, 1)) Else strA = strA & Chr2Hex(Mid(strChr, i, 1)) End If Next Chr2HexAd = strA End Function
Public Function ReplaceText(ByVal txt As String, ByVal from_str As String, ByVal to_str As String) As String Dim result As String Dim from_len As Integer Dim pos As Integer from_len = Len(from_str) Do While Len(txt) > 0 pos = InStr(txt, from_str) If pos = 0 Then result = result & txt txt = "" Else result = result & Left$(txt, pos - 1) & to_str txt = Mid$(txt, pos + from_len) End If Loop ReplaceText = result End FunctionUse : Replace(text1.text,"a","b")
Private Function MidText(ByVal strText As String, ByVal Find1 As String, ByVal Find2 As String, Optional ByVal lStart As Long = 1, Optional ByVal Compare As VbCompareMethod = vbBinaryCompare) As String Dim lRet As Long, sRet As String lRet = InStr(lStart, strText, Find1, Compare) If lRet Then sRet = Mid$(strText, lRet + Len(Find1)) lRet = InStr(1, sRet, Find2, Compare) If lRet Then MidText = Left$(sRet, lRet - 1) End If End If End Function