मैंने एक ऐसा फ़ंक्शन बनाया जो दूसरों के लिए सहायक हो सकता है। यह एक फ़ाइल पथ लेता है और फिर दस्तावेज़ पूरा होने तक लिंक का पालन करता है। आपको रिपोर्ट को एक HTML फ़ाइल में निर्यात करने की आवश्यकता है और फिर इस फ़ंक्शन में उस पथ का उपयोग करें। मैं इसे Outlook के लिए संदेश बनाने के लिए उपयोग करता हूं। यह विंडोज स्क्रिप्ट होस्ट ऑब्जेक्ट मॉडल
Public Function fReadFile(strFile As String) As String
On Error GoTo ErrHandler
Dim FSO As FileSystemObject
Dim tsInput As TextStream
Dim strLine, strMessage As String
Dim strNextFile As String
Dim blnEnd As Boolean
Do While Not blnEnd
Set FSO = New FileSystemObject
Set tsInput = FSO.OpenTextFile(strFile, 1)
Do While Not tsInput.AtEndOfStream
strLine = tsInput.ReadLine
If InStr(1, strLine, ">First<", vbTextCompare) > 0 And InStr(1, strLine, ">Previous<", vbTextCompare) > 0 And InStr(1, strLine, ">Next<", vbTextCompare) > 0 And InStr(1, strLine, ">Last<", vbTextCompare) > 0 Then
Debug.Print strLine
strNextFile = Mid(strLine, InStr(1, strLine, ">Previous</A> <A HREF=", vbTextCompare) + 23, InStr(1, strLine, """>Next<", vbTextCompare) - (InStr(1, strLine, ">Previous</A> <A HREF=", vbTextCompare) + 23))
rem put the directory back in the file name
strNextFile = IIf(strNextFile <> "#", Mid(strFile, 1, (InStrRev(strFile, "\"))) & strNextFile, strFile)
blnEnd = (strNextFile = strFile)
Else
strMessage = strMessage & strLine
End If
Loop
tsInput.Close
Set FSO = Nothing
strFile = strNextFile
Loop
fReadFile = strMessage
Exit Function
ErrHandler:
Debug.Print Err.Description & " " & "fReadFile"
Resume Next
End Function
क्या आपने कोई प्रश्न बनाने का प्रयास किया है, और उसके बाद उसे HTML के रूप में निर्यात किया है? परिणाम एक HTML तालिका होगी, और पेज ब्रेक के बिना और केवल एक दस्तावेज़ होगा। –