当我使用带有Report的Export to html功能时,Access会生成多个html页面(每个页面大约有30行左右的数据)。
如何强制Access为整个报告生成ONE SINGLE html文件?感谢。
答案 0 :(得分:3)
我创建了一个可能对其他人有帮助的功能。它采用文件路径,然后跟随链接,直到文档完成。您需要将报告导出到html文件,然后在此函数中使用该路径。我用它来为Outlook创建一条消息。 这需要引用Windows脚本宿主对象模型
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
答案 1 :(得分:2)
答案 2 :(得分:1)
无法完成。必须根据打印机驱动程序设置纸张尺寸。即使页面设置中存在此选项,Access也不允许用户定义的纸张大小。