Kaydet (Commit) 7bc56a95 authored tarafından Jean-Pierre Ledure's avatar Jean-Pierre Ledure

Access2Base - Dynamic combo list in PromptFormat()

to refelect various list of output formats in DoCmd.OutputTo() action

Change-Id: Ibb95020efa2995cde168efbd516f9b1e49d832a3
üst 14fb1d64
......@@ -608,7 +608,7 @@ Const cstThisSub = "Database.OutputTo"
If Not Utils._CheckArgument(UCase(pvOutputFormat), 3, vbString, Array( _
UCase(acFormatHTML), "HTML" _
, UCase(acFormatXLS), "XLS" _
, UCase(acFormatCALC), "ODS" _
, UCase(acFormatODS), "ODS" _
, UCase(acFormatTXT), "TXT", "CSV" _
, "")) _
Then Goto Exit_Function ' A 2nd time to allow case unsensitivity
......@@ -640,7 +640,7 @@ Dim sOutputFormat As String, iTemplate As Integer, iOutputFile As Integer, bOutp
'Determine format and parameters
If pvOutputFormat = "" Then
sOutputFormat = _PromptFormat() ' Prompt user for format
sOutputFormat = _PromptFormat(Array("HTML", "ODS", "XLS", "TXT")) ' Prompt user for format
If sOutputFormat = "" Then Goto Exit_Function
If Not Utils._CheckArgument(UCase(sOutputFormat), 3, vbString, Array(UCase(acFormatHTML), "HTML", "")) _
Then Goto Exit_Function ' Today only value, later maybe Calc ?
......
......@@ -1214,7 +1214,7 @@ Public Function OutputTo(ByVal pvObjectType As Variant _
) As Boolean
REM https://wiki.openoffice.org/wiki/Documentation/DevGuide/Spreadsheets/Filter_Options
'Supported: acFormatPDF, acFormatODT, acFormatDOC, acFormatHTML for forms
' acFormatHTML, acFormatXLS, acFormatCALC, acFormatTXT for tables and queries
' acFormatHTML, acFormatXLS, acFormatODS, acFormatTXT for tables and queries
If _ErrorHandler() Then On Local Error Goto Error_Function
Const cstThisSub = "OutputTo"
......@@ -1230,7 +1230,7 @@ Const cstThisSub = "OutputTo"
If pvOutputFormat <> "" Then
If Not Utils._CheckArgument(UCase(pvOutputFormat), 3, vbString, Array( _
UCase(acFormatPDF), UCase(acFormatODT), UCase(acFormatDOC), UCase(acFormatHTML) _
, UCase(acFormatXLS), UCase(acFormatCALC), UCase(acFormatTXT) _
, UCase(acFormatXLS), UCase(acFormatODS), UCase(acFormatTXT) _
, "PDF", "ODT", "DOC", "HTML", "XLS", "ODS", "TXT", "CSV", "" _
)) Then Goto Exit_Function ' A 2nd time to allow case unsensitivity
End If
......@@ -1280,7 +1280,7 @@ Dim vWindow As Variant, sOutputFile As String, ofForm As Object, i As Integer, b
'Determine format and parameters
Dim sOutputFormat As String, sFilter As String, oFilterData As Object, oExport As Object, sSuffix As String
If pvOutputFormat = "" Then
sOutputFormat = _PromptFormat() ' Prompt user for format
sOutputFormat = _PromptFormat(Array("PDF", "ODT", "DOC", "HTML")) ' Prompt user for format
If sOutputFormat = "" Then Goto Exit_Function
Else
sOutputFormat = UCase(pvOutputFormat)
......@@ -1787,7 +1787,7 @@ Const cstSemiColon = ";"
sDirectory = _getTempDirectoryURL()
If Right(sDirectory, 1) <> "/" Then sDirectory = sDirectory & "/"
If pvOutputFormat = "" Then
sOutputFormat = _PromptFormat() ' Prompt user for format
sOutputFormat = _PromptFormat(Array("PDF", "ODT", "DOC", "HTML")) ' Prompt user for format
If sOutputFormat = "" Then Goto Exit_Function
Else
sOutputFormat = UCase(pvOutputFormat)
......@@ -2143,7 +2143,7 @@ Trace_NotFound:
End Function ' _OpenObject V0.8.9
REM -----------------------------------------------------------------------------------------------------------------------
Private Function _PromptFormat() As String
Private Function _PromptFormat(ByVal pvList As Variant) As String
' Return user selection in Format dialog
Dim oDialog As Object, oDialogLib As Object, iOKCancel As Integer, oControl As Object
......@@ -2172,10 +2172,19 @@ Dim oDialog As Object, oDialogLib As Object, iOKCancel As Integer, oControl As O
oControl.Label = _GetLabel("DLGFORMAT_CMDCANCEL_LABEL")
oControl.HelpText = _GetLabel("DLGFORMAT_CMDCANCEL_HELP")
Set oControl = oDialog.Model.getByName("cboFormat")
If UBound(pvList) >= 0 Then
oControl.Text = pvList(0)
oControl.StringItemList = pvList
Else
oControl.Text = ""
oControl.StringItemList = Array()
End If
iOKCancel = oDialog.Execute()
Select Case iOKCancel
Case 1 ' OK
_PromptFormat = oDialog.Model.getByName("cboFormat").Text
_PromptFormat = oControl.Text
Case 0 ' Cancel
_PromptFormat = ""
Case Else
......
......@@ -288,7 +288,7 @@ Global Const acFormatODT = "writer8"
Global Const acFormatDOC = "MS Word 97"
Global Const acFormatHTML = "HTML"
Global Const acFormatXLS = "MS Excel 97"
Global Const acFormatCALC = "StarOffice XML (Calc)"
Global Const acFormatODS = "StarOffice XML (Calc)"
Global Const acFormatTXT = "Text - txt - csv (StarCalc)"
REM AcExportQuality
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment