Forum: สอบถามปัญหา Notes ทางด้านพัฒนาโปรแกรม (Note Client) |
Tags1: | Created on Sep 21, 2012, 3:15 PM by noynha/9Notes|Topic Responses: 1 |
&action=openDocument&documentId=2F36 |
เผื่อช่วยได้ค่ะ ...
Dim session As New NotesSession
Dim db As NotesDatabase
Dim Doc As NotesDocument
Dim file As String
Dim PolicyKey As String
Dim view As notesview
Set db = Session.currentdatabase
Set view= db.GetView("(Test)")
Set xlApp = CreateObject("Excel.application")
xlApp.Visible = False
file=Inputbox("Please enter path of the spreadsheet like" & " C:\spreadsheet.xls", "File Path Inquiry Box", " enter path here ....")
xlApp.Workbooks.Open file
ARangeValue = xlApp.Range("F1").Value
Print " Please Wait Importing Data .....WIP"
i = 0
Do Until ARangeValue = ""
i = i + 1
r = "F" & Trim(Str(i))
ARangeValue = xlApp.Range("F" & Trim(Str(i))).Value
txtCell=Trim( "F"&Trim(Str$(i)) )
PolicyKey=xlApp.Range(txtCell).Value
Set doc=view.GetDocumentByKey(PolicyKey, True)
If Not (doc Is Nothing) Then
Else
If ARangeValue <> "" Then
Set doc = db.CreateDocument
doc.Form = "Main"
doc.ExpiryDate = xlApp.Range(Trim("A" & Trim(Str(i)))).Value
doc.JobType = xlApp.Range(Trim("B" & Trim(Str(i)))).Value
doc.Package= xlApp.Range(Trim("C" & Trim(Str(i)))).Value
Call doc.save(True, False)
End If
End If
Loop
xlapp.activeworkbook.close
xlapp.Quit '// Close Excel
Set xlapp = Nothing
Messagebox( " Import Finished ") |
|