[AccessD] Snapshot question continued

Robert Gracie Subscriptions at servicexp.com
Mon May 26 08:48:32 CDT 2003


Try something like this..


Sub PublishOPObject(intObjectType As Integer, strObjectName As String, _
 Optional intFormat As String, _
 Optional strOutputFile As String, _
 Optional bolAutoStart As Boolean = False, _
 Optional strTemplateFile As String)

'Object Type Constants
  'acOutputDataAccessPage
  'acOutputForm
  'acOutputModule
  'acOutputQuery
  'acOutputReport
  'acOutputServerView
  'acOutputStoredProcedure
  'acOutputTable
'Output format Constants
  'acFormatASP
  'acFormatDAP
  'acFormatHTML
  'acFormatIIS
  'acFormatRTF
  'acFormatSNP
  'acFormatTXT
  'acFormatXLS


On Error GoTo HandleErr
    DoCmd.Hourglass True

    If strTemplateFile = "" Then
        DoCmd.OutputTo _
            ObjectType:=intObjectType, _
            ObjectName:=strObjectName, _
            OutputFormat:=intFormat, _
            OutputFile:=strOutputFile, _
            AutoStart:=bolAutoStart 'Preview Report
    Else
        DoCmd.OutputTo _
            ObjectType:=intObjectType, _
            ObjectName:=strObjectName, _
            OutputFormat:=intFormat, _
            OutputFile:=strOutputFile, _
            AutoStart:=bolAutoStart, _ 'Preview Report
            TemplateFile:=strTemplateFile
    End If

    DoCmd.Hourglass False

    MsgBox strObjectName & _
     " was successfully published to the " & _
     strOutputFile & " file.", _
     vbInformation + vbOKOnly, "PublishObject Sub"
ExitHere:

    Exit Sub

' Error handling block added by Error Handler Add-In. DO NOT EDIT this block
of code.
' Automatic error handler last updated at 11-30-2002 12:02:35
'ErrorHandler:$$D=11-30-2002    'ErrorHandler:$$T=12:02:35
HandleErr:
    Select Case Err.Number
        Case Else
            MsgBox "Error " & Err.Number & ": " & Err.Description,
vbCritical, "basPublish.PublishOPObject"
'ErrorHandler:$$N=basPublish.PublishOPObject
            'Log Error
            Call ErrorRecordSystem(Err.Number, Err.Description, Now,
"Un-Expected Error In Proc; " & "basPublish.PublishOPObject", CurrentUser)
'ErrorHandler:$$N=basPublish.PublishOPObject
            DoCmd.Hourglass False
            Resume ExitHere:
    End Select
' End Error handling block.
End Sub



-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Arthur Fuller
Sent: Monday, May 26, 2003 9:42 AM
To: AccessD
Subject: [AccessD] Snapshot question continued


I clicked Send too quickly. My second question is, can I save a report to a
snapshot without previewing it? I just want to create the SNP file and
attach it to an email. Since there could be 100 reports going out at once, I
certainly don't want to force the user to preview and close each one in
turn!

TIA,
Arthur

_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com





More information about the AccessD mailing list