04. november 2002 - 14:02Der er
18 kommentarer og 1 løsning
Set uidoc
Hvorfor kan jeg ikke få lov at sætte uidoc med det her: Dim workspace As New NotesUIWorkspace Dim uidoc As NotesUIDocument Set uidoc = workspace.CurrentDocument
Teknologi, AI og forretning er i centrum på Computerworlds Cloud og AI Festival i København d. 18. og 19. september. Se hele programmet for den store konference om strategisk brug af Cloud og AI på: www.cloud-festival.dk
Jeg skal gerne have overført data fra valgte dokumneter i et view til nogle variabler i en action:
Sub Click(Source As Button)
Dim workspace As New NotesUIWorkspace Dim uidoc As NotesUIDocument Set uidoc = workspace.CurrentDocument
Dim s As New notessession Dim todaydate As New notesdatetime("Today") Dim word As Variant Dim wordoc As Variant Dim db As NotesDatabase Dim collection As NotesDocumentCollection Dim doc As NotesDocument Dim count As Integer
Set db = s.CurrentDatabase Set collection = db.AllDocuments Set doc = collection.GetFirstDocument
Dim test As String Dim todaysdate As String Dim orderid As String Dim producedby As String Dim storeid As String Dim customername As Integer Dim address As String Dim citytown As String Dim postcode As String Dim daytimeno As String Dim eveningno As String
'Predefined values: (replace with field values from uidoc) test = doc.FieldGetText("Form")
For i=0 To 1 'Create the Word object: Set word = CreateObject("Word.Application") 'Create Word object Call word.documents.add("c:\test.dot") 'Create a new document based on the template "Return and Uplift.Dot" Set worddoc = word.activedocument 'Get a handle for the active document
worddoc.saveas(Str$(customername)) 'save the document with the filename of "John Doe.doc" 'Worddoc.PrintOut word.visible = True 'Comment this line if you don't want to show Word.
Next 'word.quit 'remove comment if you want to close rather than show Word.
Du er med på at db.UnprocessedDocuments returnerer en collection ikke?
Set doccoll=db.UnprocessedDocuments If doccoll.count > 1 Then set doc=doccoll.getfirstdocument While Not doc Is Nothing .... Set doc=doccoll.getnextdocument(doc) wend end if
Hov vent - du bruger doc.fieldgettext - og doc er en instans af NotesDOcument - fieldgettext er en metode på NotesUIDOcument. Brug evt. GetItemValue istedet
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.