Das Notes Forum

Domino 9 und frühere Versionen => Entwicklung => Thema gestartet von: Notes-Tiger am 22.06.02 - 19:54:49

Titel: C Notes API
Beitrag von: Notes-Tiger am 22.06.02 - 19:54:49
Hi,
folgende Funtction wird in meinem Script aufgerufen.
Ich finde aber ind er gesamten Doku zur API keine Function mit dem Namen "NEMGetFile" .
Hat jemand einen Tipp.
Danke

Declare Function W32_NEMGetFile Lib "nnotesws" Alias "NEMGetFile" ( wUnk As Integer, Byval szFileName As String,
Titel: Re: C Notes API
Beitrag von: eknori am 23.06.02 - 09:22:12
Die Funktion NEMGEtFIle ist ebenso undokumentiert wie die Funktion NEMPutFile.
Beide Funktionen waren erstmals mit der Version 4.6.verfügbar.
Titel: Re: C Notes API
Beitrag von: Notes-Tiger am 23.06.02 - 12:06:12
Hi,
was kann man denn als alterative verwenden.
ich möchte das Script im Backend laufen lassen und die Datei vorgeben.


strFileName = Chr(0)
     'strFileName="f:\import\REPORT_Vorlage.xls" &|"|
     strTitle$ = "Select Excel file to export to."
     strFilter$ = "MS Excel Files|*.xls|All Files|*.*|" 'Use this format for ANY file type
'%REM
     If IsDefined ("WIN32") Then
           If W32_NEMGetFile (1, strFileName, strFilter$, strTitle$) <> 0 Then
                 strFileName = strFileName & |"| 'We need to do this because the return is a NULL terminated string.
                 Bovie = strFileName & |"| 'We need to do this because the return is a NULL terminated string.
           Else 'The user chose to Cancel the operation so exit the subroutine
                 Exit Sub
           End If
     Elseif IsDefined ("WIN16") Then
           If W16_NEMGetFile (0, strFileName, strFilter$, strTitle$) <> 0 Then
                 strFileName = strFileName & |"|
           Else 'The user chose to Cancel the operation so exit the subroutine
                 Exit Sub
           End If
     Else
           Msgbox "Cannot load file dialog window on this operating system." & Chr(13) & "Process Terminated",0+64,"Error"
           Exit Sub
     End If
Titel: Re: C Notes API
Beitrag von: eknori am 23.06.02 - 12:24:18
In deinem Fall brauchst du doch den ganzen code nicht. Wenn du die Datei fest vorgibst brauchst du doch keinen Dialog, um eine Datei auszuwählen. Das wäre im BACKEND ja sowieso nicht möglich.
strFilename =  reicht doch völlig aus. damit übergibst du ja den Dateinamen.

eknori
Titel: Re: C Notes API
Beitrag von: Notes-Tiger am 23.06.02 - 12:46:01
Hatte ich mir auch so gedacht aber ... und hier bekommt er es nicht mehr hin.
DIM strFileName As Sting*256
...
...
Set Handle = CreateObject("Excel.Application")
     Set WBook = Handle.Workbooks.Open(StrFileName)
     If Err = 213 Then
           Set WBook = Handle.Workbooks.Add
     Else
           If Msgbox ("The export to Excel is about to begin.  All existing spreadsheet contents will be overwritten!" & Chr(13) & Chr(13) & "Do you wish to proceed?",4+48,"Export to Excel") = 7 Then
                 WBook.Close
                 Handle.DisplayAlerts = True
                 Handle.Quit
                 Set Handle = Nothing
                 Exit Sub
           End If
     End If
    'Handle.Visible = True 'Uncomment if you wish Excel to be seen
     Set Wsheet = WBook.Application.Workbooks(1).Worksheets(4)
     Handle.DisplayAlerts =  True 'False
Titel: Re: C Notes API
Beitrag von: Notes-Tiger am 24.06.02 - 19:18:16
Herzlichen DANK eknori,
du hast mir sehr geholfen.
Gruss

Thema kann geschlossen werden.