يكي كار مي كردي مفيدتر بود ..
از رفرنس:
Microsoft HTML object liberary
اضافة مي كردي ...
كه تمام چیزها object شن
من شخصا از اين module استفادة مي كنم
'************************************************* **********************
'* Coded By : Mohammed Saeed *'
'* e-Mail : MS190@Gawab.com *'
'* Bahrain - Karbabad *'
'************************************************* **********************
Dim objMSHTML As New MSHTML.HTMLDocument 'HTML DOC
Dim objDoc As New MSHTML.HTMLDocument
'-----------------
' *** Reg *** '
Const REG_SZ = 1 ' Unicode nul terminated string
Const REG_BINARY = 3 ' Free form binary
Const HKEY_CURRENT_USER = &H80000001
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Private Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long
''''''''''''''''''''''''''''''''''
Private Function OPENHTMLDOC(ByVal strURL As String)
' HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\Disable Script Debugger
' Set Yes
Disable_Script_Debugger
Set objDoc = objMSHTML.createDocumentFromUrl(strURL, vbNullString)
While objDoc.readyState <> "complete"
DoEvents
Wend
End Function
Sub SaveString(hKey As Long, strPath As String, strValue As String, strData As String) 'Edit Key
Dim Ret
RegCreateKey hKey, strPath, Ret 'Create a new key
RegSetValueEx Ret, strValue, 0, REG_SZ, ByVal strData, Len(strData) 'Save a string to the key
' RegSetValueEx Ret, strValue, 0, REG_BINARY, CByte(strData), 4 ' IF Data Binary
RegCloseKey Ret 'close the key
End Sub
Public Sub Disable_Script_Debugger()
Dim strString As String
'Ask for a value
strString = 22
'Save the value to the registry
' SaveStringLong HKEY_CURRENT_USER, "KPD-Team", "BinaryValue", CByte(strString)
SaveString HKEY_CURRENT_USER, "Software\Microsoft\Internet Explorer\Main", "Disable Script Debugger", "yes"
End Sub
ونمونه آن
Dim l As HTMLLinkElement
For i = 0 To objDoc.links.length - 1
Link = objDoc.links.Item(i)
Set l = objDoc.links.Item(i)
MsgBox l.outerText
Next i
براي نشان دادن متني كه لينك است
اميدوارم پاسخ مفیدی اضافه کرده باشم