Expand|Select|Wrap|Line Numbers
- Public Const SW_HIDE = 0
- Public Const SW_MINIMIZE = 6
- Public Const SW_RESTORE = 9
- Public Const SW_SHOW = 5
- Public Const SW_SHOWMAXIMIZED = 3
- Public Const SW_SHOWMINIMIZED = 2
- Public Const SW_SHOWMINNOACTIVE = 7
- Public Const SW_SHOWNA = 8
- Public Const SW_SHOWNOACTIVATE = 4
- Public Const SW_SHOWNORMAL = 1
- Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
- (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
- ByVal lpParameters As String, ByVal lpDirectory As String, _
- ByVal nShowCmd As Long) As Long
- Public Sub ExecuteFile(sFileName As String, sAction As String)
- Dim vReturn As Long
- 'sAction can be either "Open" or "Print".
- If ShellExecute(Access.hWndAccessApp, sAction, sFileName, vbNullString, "", SW_SHOWNORMAL) < 33 Then
- DoCmd.Beep
- MsgBox "File not found."
- End If
- End Sub
Expand|Select|Wrap|Line Numbers
- Private Sub cmdPrintAllDocs_Click()
- On Error GoTo ErrorHandler
- Dim db As DAO.Database
- Dim rs As DAO.Recordset
- Dim strDocumentPath As String
- Set db = CurrentDb
- Set rs = db.OpenRecordset("qryScopeHyperlinks")
- With rs
- rs.MoveFirst
- Do Until rs.EOF
- If rs.Fields("lngScopeIDLink") = WhatRecord(Forms.frmScope.CurrentRecord) Then
- strDocumentPath = Mid(rs.Fields("hyplink"), 1, (InStr(rs.Fields("hypLink"), "#") - 1))
- Call ExecuteFile(strDocumentPath, "Print")
- Else
- End If
- rs.MoveNext
- Loop
- End With
- rs.Close
- Set rs = Nothing ......
So basically what I would like to do is have my code somehow acknowledge the popup or bypass it, then have excel print the file in its entirety (including all tabs). I was thinking maybe to put
Expand|Select|Wrap|Line Numbers
- If Right(sFileName, 4) = ".xls" Then
rsmccli