こんな式を入れました。超初心者の私でも分かるように作ってもらったのですが、応用ができません(>_<) DBの概要ですが、「SyoruiTanto 」のダイアログボックス形式のフォームで「謄本等請求書」に入力します。 日付をキーにしてレポート出力したいのですが、式以外にDBのほかのオブジェクトに問題があるのでしょうか?こんなつたない説明でもピンと来るプロの方ご指導宜しく御願い致します。 Sub Click(Source As Button) Dim session As New NotesSession Dim db As NotesDatabase Dim rtcollection As NotesDocumentCollection 'ProcessName = Labelの条件で抽出される文章 Dim doccollection As NotesDocumentCollection Dim dateTime As New NotesDateTime( "") Dim Syoruihasso As String Dim doc As NotesDocument Dim filenum As Integer 'CSV出力用 Dim out As String 'CSV出力元STRING Dim rtn As Variant '戻り値受け用 Set db = session.CurrentDatabase Set collection = db.UnprocessedDocuments Syoruihasso = "" Syoruihasso = Inputbox$("書類発送日を入力して下さい") If Syoruihasso = "" Then Exit Sub End If '対象文書を取得 searchFormula$ = "((Form = ""謄本等請求書"" | Form = "" SyoruiTanto "") & SyoruiHasso = """ & Syoruihasso & """)" Set doccollection = db.Search( searchFormula$, DateTime, 0 ) If Isnull(doccollection) Then Exit Sub End If If doccollection.Count > 0 Then 'ラベル出力用のCSVを出力 filenum = Freefile() '保存するファイル名の指定 'いじる場所@ '□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□ Open "C:\Windows\デスクトップ\発送レポート.csv" For Output As filenum '□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□ Set doc = doccollection.getfirstdocument '項目名を設定、ここで指定したものはCSVの一行目に出力されます。 'いじる場所A '□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□ out = "書類発送日,印鑑証明No.,店舗名,車名" '□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□ Print #filenum,out Do Until (doc Is Nothing) '出力項目1つにつき1行作成していきます。 'いじる場所B '□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□ out = _ doc.getitemvalue(" SyoruiHasso ")(0) & "," _ & doc.getitemvalue("印鑑証明No.")(0) & "," _ & doc.getitemvalue("店舗名")(0) & "," _ & doc.getitemvalue(" Syamei ")(0) '□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□ Print #filenum,out Set doc = doccollection.getnextdocument(doc) Loop Close filenum Set db = Nothing Set session = Nothing 'いじる場所B '□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□ Messagebox "デスクトップに発送レポート.csvとして作成されました" '□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□ End If End Sub