Für die meisten hier sicherlich lächerlich. Leider habe ich von Lotus Script keine Ahnung. Ich habe unten stehendes Script in der Sandbox gefunden um Daten nach Word zu exportieren. Ich habe dieses Script in eine Aktion in meiner Maske eingebunden und das Script läuft auch korrekt ab.
Was ich jetzt aber nicht hinbekomme ist die fest vorgegebenen Werte durch Felder aus meinem Dokument zu ersetzen. Ich habe mal im Abschnitt:
'Predefined values: (replace with field values from uidoc)
orderid = "2183763248"
folgendes versucht was aber nicht funktioniert
orderid = fd_anfragenr
Leider habe ich von uidoc etc keine Ahnung? Wäre superklasse wenn mir hier jemand helfen könnte...
-----------------------------
Here is the code for creating a new Word document with form fields and updating the form fields with predefined values.
If you are in a UIDcument it is very easy to substitue the predefined values with variables/fields from the UIDocument
Dim s As New notessession
'Dim todaydate As New notesdatetime("Today")
Dim word As Variant
Dim wordoc As Variant
Dim todaysdate As String
Dim orderid As String
Dim producedby As String
Dim storeid As String
Dim customername As String
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)
'todaysdate = todaydate.localtime
orderid = "2183763248"
producedby = s.username
storeid = "12345"
customername = "John Doe"
address = "Apartment 5c, 5 Test Avenue"
citytown = "Testtown"
postcode = "XX5 5XX"
daytimeno = "1234567890"
eveningno = "0987654321"
'Create the Word object:
Set word = CreateObject("Word.Application") 'Create Word object
Call word.documents.add("Return and Uplift.dot") 'Create a new document based on the template "Return and Uplift.Dot"
Set worddoc = word.activedocument 'Get a handle for the active document
'Assign the field values:
worddoc.FormFields(1).result = todaysdate
worddoc.FormFields(2).result = orderid
worddoc.FormFields(3).result = producedby
worddoc.FormFields(4).result = storeid
worddoc.FormFields(5).result = customername
worddoc.FormFields(6).result = address
worddoc.FormFields(7).result = citytown
worddoc.FormFields(
.result = postcode
worddoc.FormFields(9).result = daytimeno
worddoc.FormFields(10).result = eveningno
worddoc.saveas(customername) 'save the document with the filename of "John Doe.doc"
word.visible = True 'Comment this line if you don't want to show Word.
'word.quit 'remove comment if you want to close rather than show Word.