Domino 9 und frühere Versionen > Entwicklung

1 Druckdokument aus Haupt- und Antwortdokumenten

<< < (2/3) > >>

m3:
Die Methode workspace.CurrentDocument liefert das gerade OFFENE Dokument zurück. Da Du keines offen hast, liefert er korrekterweise NOTHING zurück.

Wiesel:
Und was nutze ich stattdessen?
Ich hab Probleme dabei, auf ein markiertes Dokument zuzugreifen.
Habe bisher immer auf alle Dokumente aus der Ansicht zugegriffen und dann alle ausdrucken lassen, oder so.
Aber wie greife ich das markierte Dokument?

koehlerbv:
Auf das EINE (also durch den View-Cursor) markierte Dokument greifst Du
NotesSession.DocumentContext
zu.

Bernhard

Wiesel:
Dann war ich doch schon auf dem richtigen Wege und hab nur zuviel benutzt.

Danke für Deine Antwort.

Jetzt hab ich allerdings ein Problem, Werte aus den Antwortdokumenten zu ziehen. Mein Script sieht jetzt so aus:

Sub Click(Source As Button)
   Dim db As NotesDatabase
   Dim workspace As New NotesUIWorkspace     
   Dim session As New NotesSession
   Dim uidoc As NotesUIDocument
   Dim doc As NotesDocument
   Dim rdoc As NotesDocument
   Dim responsedoc As NotesDocument
   Dim collection As NotesDocumentCollection
   Dim strAntwortdoc As String
   
   Set doc = session.DocumentContext
   
   If doc.form(0) = "Protokoll" Then
      doc.form = "(DruckProtokoll)"
      
      Set collection = doc.Responses
      Set responsedoc = collection.GetFirstDocument
      
      strAntwortdoc = ""
      While Not (responsedoc Is Nothing)
         strAntwortdoc = strAntwortdoc  & " " &   responsedoc.numBeschluss & " " &   responsedoc.txtBeschlussvorlage
         Set responsedoc = collection.GetNextDocument(responsedoc)
      Wend
      
      'Antwortdokumente in Druck unterbringen
      doc.txtBeschlussvorlage = strAntwortdoc
      
      Set uidoc = workspace.EditDocument( False , doc)                   
      Call uidoc.print(1,1,1)
      
      doc.form = "Protokoll"      
   End If   
   
   Call doc.save(True,True)
   Call uidoc.Close   
End Sub

In der ersten Zeile der While Not- Schleife steigt er mir wieder aus. ?????

m3:
1) OnError Fehlerbehandlung einbauen
2) Debugger verwenden
3) Genaue Fehlermeldung posten

Navigation

[0] Themen-Index

[#] Nächste Seite

[*] Vorherige Sete

Zur normalen Ansicht wechseln