Das Notes Forum
Domino 9 und frühere Versionen => Entwicklung => Thema gestartet von: mh70220 am 27.08.04 - 12:42:33
-
Hallo alle zusammen,
zur Zeit lese ich die Felder des Profiledocument mit @GetProfileField() in meiner Maske aus. Somit habe ich fuer jedes Profilefeld ein weiteres Feld erstellt, wo ich den Inhalt reinlade. Das ist mir zu umstaendlich. Ich weis, das man das auch in LotusScript machen kann und dort moechte ich es auch hinhaben. Probiert habe ich es schon, doch bekomme ich immer einen Fehler "Typ mismatch".
Kann mal jemand ueber den Code schauen und mir sagen, was falsch ist
Sub Click(Source As Button)
Dim mysession As New notessession
Dim db As NotesDatabase
Dim uidoc As NotesUIDocument
Dim heute As New notesdatetime ("heute")
Dim word As Variant
Dim wordoc As Variant
Dim widoc As NotesItem
Dim wdoc As String
Dim pdoc As NotesDocument
Set db=mysession.currentdatabase
Set pdoc = db.getprofiledocument("Datei-Pfad")
Set widoc = pdoc.getprofilefield("PfadFreiesDoc")
'Aktualisiert das aktuelle Dokument noch einmal, Daten auf den aktuellen stand zu bringen!
Call uidoc.refresh
'Zuweisung der Dokumenten-Vorlage von Word
'wdoc = uidoc.FieldGetText("Doc4")
'Starten von Word und Auswahl von Dokumentenvorlage
Set word = CreateObject("Word.Application")
Call word.documents.add(widoc)
Set worddoc = word.activedocument
'Befuellen der Felder vom ausgewaehlten Dokument
worddoc.FormFields("TXTBEZEICHNUNG").result = uidoc.FieldGetText("PBA1")
worddoc.FormFields("TXTPBTEL").result = uidoc.FieldGetText("PBA5")
worddoc.FormFields("TXTPBFAX").result = uidoc.FieldGetText("PBA6")
worddoc.FormFields("TXTPBEMAIL").result = uidoc.FieldGetText("PBA7")
worddoc.FormFields("TXTZEICHNET").result = uidoc.FieldGetText("PBA8")
worddoc.FormFields("TXTPBNAME").result = uidoc.FieldGetText("PBA2")
worddoc.FormFields("TXTPBDIENSTGRAD").result = uidoc.FieldGetText("PBA4")
'Word sichtbar machen
word.visible = True
End Sub
Schon mal danke.
Matthias
-
... standardfrage: WO ???
-
Hallo,
Set NotesDocument = Notesdatabase.getProfileDocument( Maske[, User] )
Dann kannst Du ganz normal auf das Notesdocument zugreifen.
Steht in der NotesHilfe auch gut beschrieben.
Gruß von Ekki
-
@Ekki
das was du beschrieben hast, habe ich ja schon in meinem Quelltext drin:
Dim widoc As NotesItem
Dim db As NotesDatabase
Dim pdoc As NotesDocument
Set db=mysession.currentdatabase
Set pdoc = db.getprofiledocument("Datei-Pfad")
Set widoc = pdoc.getprofilefield("PfadFreiesDoc")
mein Problem nun ist, das ich das Feld nicht ausgelesen bekomme.
Schau nochmal ueber meinen Quellcode vom ersten Eintrag und vielleicht findest du den Fehler.
-
GetProfileField gibt es nicht.
Das sollte gehen:
Dim widoc As String
Dim wdoc As String
Dim pdoc As NotesDocument
Set db=mysession.currentdatabase
Set pdoc = db.getprofiledocument("Datei-Pfad")
widoc = pdoc.GetItemValue("PfadFreiesDoc")(0)
widoc muss also ein String sein!
Andreas
-
@Andreas
Wie immer hast du mir super geholfen. Alles arbeitet nun so, wie es soll.
Danke
Matthias