zoukankan      html  css  js  c++  java
  • Notes常用事件整理

    ①      ボタンのクリック事件:

    Sub Click(Source As Button)

                    Dim ws As New NotesUIWorkspace

                    Dim uidoc As NotesUIDocument

                    Set uidoc =ws.CurrentDocument

                    content = uidoc.FieldGetText( "Body" ) /文書域の値を取得する

                    askme = ws.Prompt(PROMPT_OK, _   /プロンプトメッセージを出す、Workspaceのメソッド

                    "Reminder", content)

                    Print Strcompare("AB", "ab", 1)     /ストータスバーに出力

    End Sub

    ②      外部ファイルの読み込み:

                    Dim ws As New NotesUIWorkspace

                    Dim uidoc As NotesUIDocument

                    Dim exapp As Variant

                    Dim workbook As Variant

                    Dim worksheet As Variant

                    Dim myValue As String

                    Set uidoc =ws.CurrentDocument

                   

                    'Read the excel file

                    Set exapp = createobject("Excel.Application")   /エクセルアプリを指定する

                    filenp = "f:mail.xlsx"                   /ファイルのパスを指定する

                    exapp.visible=False

                    Set WorkBook = exapp.WorkBooks.Open(filenp)

                    Set WorkSheet = WorkBook.worksheets("Sheet1")

           myValue = Trim(WorkSheet.cells(1,1).value)    /エクセルシートの値を取得する

                    Call uidoc.FieldSetText("SendTo", myValue $)  /文書域の値を設定する

           exapp.Quit                        /エクセルアプリを閉鎖する

    ③、ノーツデータベースを開く:

    Dim session As New NotesSession
    Dim db As NotesDatabase
    Set db = session.CurrentDatabase
    Messagebox( db.ReplicaID )


        Dim db As New NotesDatabase( "", "" )
        If db.OpenByReplicaID( "D19DBR11/19/A/IBM", "49257C45002186AD" ) Then
            Print( db.Title & " was successfully opened" )
        Else
            Print( "Unable to open database" )
        End If

    ④、ccにアドレス追加:

    Sub Click(Source As Button)
        Dim ws As New NotesUIWorkspace
        Dim uidoc As NotesUIDocument
        Dim currentCc As String
        Set uidoc =ws.CurrentDocument
        currentCc = uidoc.FieldGetText( "EnterCopyTo" )
        
        content = uidoc.FieldGetText( "Body" )
        
        Dim  DefaultString As String
        Dim positionOfChar As Long
        DefaultString$ = "/Japan/IBM)"
        positionOfChar& = Instr(content, DefaultString$)
        
        Dim subString1 As String
        Dim subString2 As String
        subString1$ = Left$(content, positionOfChar&+9)
        subString2$=Right$(subString1,positionOfChar&-9)
        
        If ( currentCc ="") Then
            Call uidoc.FieldSetText( "EnterCopyTo", subString2 )
        Elseif ( Instr(currentCc, subString2)=0) Then
            Call uidoc.FieldAppendText("EnterCopyTo", "," & subString2)
        Else
            Exit Sub
        End If
    End Sub

  • 相关阅读:
    WPF Layout & Image异步加载
    WPF Binding Validation 数据验证
    推荐一个.NET 命令行参数Parser 库
    Windows 下 命令行增强工具
    Windbg 离线调试.Net 程序入门
    拼写检查算法 Golang 版
    新Blog
    WPF 实现Loading效果
    struct结构体的变长特性
    第2章 构造函数语意学
  • 原文地址:https://www.cnblogs.com/vonk/p/3896894.html
Copyright © 2011-2022 走看看