Hallo oro
Sieh dir mal genau diesen Script an:
%REM
Export-Script
This Script has been created by D. Hasa, Yel GmbH, Switzerland in April 2001
It may be distributed and modified freely, as long as this header is kept intact.
Please report any bugs, fixes or enhancements to [email protected]
This script exports a UIView ‚As-Is‘
–> every column (include headers) is a column in Excel
and every value displayed of a document is a row in Excel
Every Value will be inserted as Text into Excel
================================================================================
Implementation
It is only a script without any Dialog-Boxes by exception --> Distribution and
Implementation is very easy
Simply copy this whole file into an Agent:
Name: Export to Excel
Run: Manually from Actions Menu
act on: All documents in View
Run: Lotus Script
–> Export works in any View/Folder of that database
Updates:
================================================================================
%ENDREM
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim tmpCount As Integer
Dim nmore, nc, nchar
Sub Initialize
'Main Code
'SET THE AUTOFORMAT
Dim selList(0 To 20) As String
SelList(0) = „Simple“
SelList(1) = „Classic1“
SelList(2) = „Classic2“
SelList(3) = „Classic3“
SelList(4) = „Accounting1“
SelList(5) = „Accounting2“
SelList(6) = „Accounting3“
SelList(7) = „Accounting4“
SelList(8) = „Color1“
SelList(9) = „Color2“
SelList(10) = „Color3“
SelList(11) = „List1“
SelList(12) = „List2“
SelList(13) = „List3“
SelList(14) = „D3Effects1“
SelList(15) = „D3Effects2“
SelList(16) = „Format1“
SelList(17) = „Format2“
SelList(18) = „Format3“
SelList(19) = „Format4“
SelList(20) = „None“
Dim session As New NotesSession
Dim workspace As New NotesUIWorkspace
Dim UIview As NotesUIView
Set UIview = workspace.CurrentView
Set db = session.CurrentDatabase
UIViewname = UIView.ViewName
UIViewAlias = UIView.Viewalias
Set view = db.GetView( UIViewName )
doformat = Messagebox(„Format the Excel-Sheet?“, 36)
If doFormat = 6 Then
SelForm = workspace.Prompt(PROMPT_OKCANCELLIST, „AutoFormat-Form“,„Select the Autoformat-Form“, „Test“ , SelList)
TitleBar = Cint(Inputbox ( „How many degrees shall the Title-Line be turned“, „Title-Turn“, „0“))
If Titlebar > 90 Then
TitleBar = 90
Elseif TitleBar 0 Then
nchar=Cstr(Chr(nmore+64))+Cstr(Chr(nc))
Else
nchar = Cstr(Chr(nc))
End If
countcol = nchar
End Function
Function getAutoForm( selForm) As Integer
Select Case SelForm
Case „Simple“
SelAutoForm = -4154
Case „Classic1“
SelAutoForm =1
Case „Classic2“
SelAutoForm =2
Case „Classic3“
SelAutoForm =3
Case „Accounting1“
SelAutoForm =4
Case „Accounting2“
SelAutoForm =5
Case „Accounting3“
SelAutoForm =6
Case „Color1“
SelAutoForm =7
Case „Color2“
SelAutoForm =8
Case „Color3“
SelAutoForm =9
Case „List1“
SelAutoForm =10
Case „List2“
SelAutoForm =11
Case „List3“
SelAutoForm =12
Case „D3Effects1“
SelAutoForm =13
Case „D3Effects2“
SelAutoForm =14
Case „Format1“
SelAutoForm =15
Case „Format2“
SelAutoForm =16
Case „Accounting4“
SelAutoForm =17
Case „Format3“
SelAutoForm =19
Case „Format4“
SelAutoForm =20
Case Else
SelAutoForm =-4142
End Select
GetAutoForm = SelAutoForm
End Function