These are probably easy questions for the more experienced LotusScript developers, but since I’m not…
1/What instruction should I use to print out NEWDOC in below code?
2/ How can I only put the 5 most right digits of PFNumber into newdoc.PFNumber. (I always get a Type Mismatch).
doc.PFNumber is a “text” field , computed with following value:
“MC” + @Repeat(“0”;5 - @Length(@Trim(@Text(SeqNumber))))+ @Text(SeqNumber)
newdoc.PFNumber is also “text”, computed with value PFNumber.
Here’s the code:
Sub Click(Source As Button)
Dim ss As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim newdoc As NotesDocument
Dim wk As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim PFnum As String
Set db=ss.currentdatabase
Set uidoc=wk.currentdocument
Set doc=uidoc.document
Set newdoc=New notesdocument(db)
newdoc.form="PrintLabel"
newdoc.PFShipTo1=doc.PFShipTo1
newdoc.PFShipTo2=doc.PFShipTo2
newdoc.PFShipTo3=doc.PFShipTo3
newdoc.PFShipTo4=doc.PFShipTo4
newdoc.PFShipTo5=doc.PFShipTo5
newdoc.PFShipTo6=doc.PFShipTo6
newdoc.PFNumber=doc.PFNumber
newdoc.PFtype=doc.PFtype
Call newdoc.save(False, True)
Call wk.EditDocument(True,newdoc)
End Sub