اذهب الي المحتوي
أوفيسنا

جلب قيمة من مستند على صفحة ويب


مالك2006
إذهب إلى أفضل إجابة Solved by Moosak,

الردود الموصى بها

السلام عليكم

الموضوع ثم اعادة طلب

الموضوع كالاتي

اريد مثلا من عنوان صغحة على نت   www.exemple.com\Ma.txt  

عند تحميل النمودج  اريد محتوى  ( Ma.txt  )  يظهر في مربع في نمودج 

رابط هذا التعليق
شارك

  • أفضل إجابة

تفضل 🙂 

استخدم هذا الكود على زر أمر بحيث تغير رابط الملف النصي وتغير اسم مربع النص اللي بيلصق النص فيه:

Private Sub btnGetText_Click()
    ' Declare variables to hold the text from the online file and the textbox
    Dim strText As String
    Dim txtTarget As TextBox

    ' Set the URL of the online text file
    Dim strURL As String
    strURL = "http://www.website.com/text.txt"

    ' Use the XMLHTTP object to retrieve the text from the online file
    Dim objXMLHTTP As Object
    Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP")
    objXMLHTTP.Open "GET", strURL, False
    objXMLHTTP.Send

    ' Check if the request was successful
    If objXMLHTTP.Status = 200 Then
        ' Get the text from the response
        strText = objXMLHTTP.responseText

        ' Get a reference to the textbox on the form
        Set txtTarget = Me.txtTextBox

        ' Put the text from the online file into the textbox
        txtTarget.Value = strText
    Else
        ' Show an error message if the request was not successful
        MsgBox "There was an error retrieving the text from the online file." & vbCrLf & _
               "HTTP Status: " & objXMLHTTP.Status, vbExclamation
    End If

    ' Clean up
    Set objXMLHTTP = Nothing
    Set txtTarget = Nothing
End Sub

وهذا مثال :

Read Online Txt File.accdb

  • Thanks 1
رابط هذا التعليق
شارك

السلام عليكم

اخي الكريم في الاول تمام رغم ثلاثة رسائل تظهر وتخنفي

وبعدين لم تعد تظهر النتيجة في المربع 

تطلع رسالة  ( خطا في تحميل مكتبة  DLL )

Error in Loading DDL

رابط هذا التعليق
شارك

زائر
هذا الموضوع مغلق.
  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information