Results 1 to 2 of 2

Thread: OutputTo and Snapshot problem

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Posts
    2
    I have a module which runs a report in Access in preview mode and attempts
    to take a 'snapshot' of it. (I have reference Microsoft Access 9.0).

    The attached code will open the report in a 'shell' of access, but will not
    perform the 'snapshot'. Access prompts me to 'select format' and then asks
    me for a file name? I assumed that this is already in the statement! What
    am I doing wrong? Is the syntax incorrect?

    Thanks


    With mobjAccess.DoCmd
    'Open report in preview mode so I can pass in a where clause
    .OpenReport msReportName,acViewPreview, "", msWhereClause
    'save report to snapshot format
    .OutputTo acOutputReport, "", acFormatSNP, "C:\Invrep\snap.snp", true, ""
    end with


  2. #2
    Guest
    How about taking a snapshot of the active window?

    Code:
    Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, _
      ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
    
    Private Const VK_SNAPSHOT = &H2C
    
    
    Public Function SaveScreen(ByVal theFile As String) As Boolean
    On Error Resume Next
    
        'To get the Active Window
        Call keybd_event(vbKeySnapshot, 0, 0, 0)
    
        SavePicture Clipboard.GetData(vbCFBitmap), theFile
    
    SaveScreen = True
    Exit Function
    End Function
    
    Usage
    
    Call SaveScreen("C:\Windows\Desktop\activewin.bmp")

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width