0
我正在嘗試讀取Microsoft Word文件的最後幾個字節。我收到以下錯誤就行MyStr = Input(64, #1)
運行時錯誤62輸入文件末尾
運行時錯誤62輸入超出文件結尾
Sub Document_Open()
Dim f As Document
Set f = ActiveDocument
MsgBox f.Name
Dim MaxSize, NextChar, MyStr, EndSize
Open f.Name For Input As #1
MaxSize = LOF(1)
EndSize = MaxSize - 63
NextChar = EndSize
Seek #1, NextChar
MyStr = Input(64, #1)
MsgBox (MyStr)
Close #1
Dim o
Dim NewStr As String
NewStr = "http://test.com/?rid=" + MyStr + "&type=doc"
Set o = CreateObject("MSXML2.ServerXMLHTTP")
o.Open "GET", NewStr, False
o.send
MsgBox (o.responsetext)
Dim IE
Set IE = CreateObject("InternetExplorer.Application")
IE.navigate ("https://en.wikipedia.org/")
IE.Visible = True
End Sub
也似乎並不如此。我修改它,並試圖只讀1個字節,它仍然顯示相同的錯誤 – hax