1

Тема: Кнопки Скопировать / Вставить на форме документа.

Нужно сделать две кнопки на форме, при нажатии "Скопировать", в буфе попадает значение последнего поля.
А при нажатии "Вставить" - вставляется значение с последнего поля.

Вот реализация данного функционала на лотус-скркрипте.

Кнопка "Скопировать"

Sub Click(Source As Button)
    Dim session As New NotesSession
    Dim ws As New notesuiworkspace
    Dim uidoc As NotesUIDocument
    Set uidoc = ws.CurrentDocument
    Dim st As String
    st=session.GetEnvironmentString( "FieldDoc")
    Print "Скопировано значение  " st
    
    Call uidoc.FieldSetText("empty",st)
    
    
End Sub

Поделиться

2

Re: Кнопки Скопировать / Вставить на форме документа.

Кнопка "Вставить".

Sub Click(Source As Button)
    Dim session As New NotesSession
    Dim ws As New notesuiworkspace
    Dim uidoc As NotesUIDocument
    Set uidoc = ws.CurrentDocument
    
    st=session.GetEnvironmentString( "FieldDoc")
    Print st
    mytext$ =  uidoc.FieldGetText("empty")
    Print  fieldName
    Call    uidoc.FieldSetText(fieldName,mytext$)
End Sub

На форме в декларации:

Public  fieldValue As String
Public  fieldName As String  
Public uidoc As NotesUIDocument 

Поделиться

3

Re: Кнопки Скопировать / Вставить на форме документа.

У каждого поля документа на форме  на событие:

Событие  Entering

Sub Entering(Source As Field)
    Dim session As New NotesSession
    Dim ws As New notesuiworkspace
    Set uidoc = ws.CurrentDocument
    fieldName  =  uidoc.CurrentField
End Sub

Событие Exiting

Sub Exiting(Source As Field)
    Dim session As New NotesSession
    Dim ws As New notesuiworkspace
    Set uidoc = ws.CurrentDocument
    Dim fieldValue As String  
    
    Print   "fieldName  "fieldName
    
    fieldValue = uidoc.FieldGetText(fieldName)
    Call session.SetEnvironmentVar( "FieldDoc", fieldValue)
    Call session.SetEnvironmentVar( "FieldName", fieldName)
End Sub

Поделиться