Option Explicit

Sub Main

'Method: docCheckinNew32  
'Desc: Checkin New Document
'Public Function docCheckInNew32(ByVal sWebDocsUserID As String, ByVal 
sIFSFile As String, ByVal sDocumentType As 'String, ByVal sDocFolder1 As 
String, ByVal sDocFolder2 As String, ByVal sDocFolder3 As String, ByVal 
sDocFolder4 As 'String, ByVal sDocFolder5 As String, ByVal sDocumentTitle 
As String, ByVal sDocKeyword1 As String, ByVal 'sDocKeyword2 As String, 
ByVal sDocKeyword3 As String, ByVal sDocKeyword4 As String, ByVal sDocKeyword5 
As String, 'ByVal sDocKeyword6 As String, ByVal sDocKeyword7 As String, 
ByVal sDocKeyword8 As String, ByVal sDocKeyword9 As 'String, ByVal 
sDocKeyword10 As String, ByVal sDeleteIFSFile As String, Optional ByVal 
sCompMessage As String = '"*COMP", Optional ByVal lPCFileSize As Int32 = 0, 
Optional ByVal sSkipCopy As String = "") As Int32

Dim objWD As Object
Dim rtnbool As Boolean
Dim rtnTempFile As String
Dim rtnDocID As String
Dim sSkipCopy As String
Dim rtn As Long
Dim results() As Variant
Dim resultsobj() As Variant

'Load WebDocs DotNet API

Set objWD= CreateObject("WebDocsAPILib.WebDocsAPI")

'Connect to iSeries

rtnbool = objWD.dociSeriesConnect("", "WDUSER", "WDPASSWORD")

'Bail if not connected
If rtnbool = false then
MsgBox("Unable to Connect to iSeries.")
Exit Sub
End If 

'Upload Local PC File to iSeries in Temp Folder (/RJSTEMP)
This API returns an IFS temp file name if successful

rtnTempFile = objWD.docUploadIFSFileTemp("c:\test.pdf")

'If temp file was uploaded, attempt to check it in.

If rtnTempFile  "" Then
'Check in New Document
rtn = objWD.docCheckInNew32("WDUSER", rtnTempFile, "DOCTYPE", "FOLDER1", 
"FOLDER2", "FOLDER3", "FOLDER4", "FOLDER5", "Document Title", "Key1", "Key2", 
"Key3", "Key4", "Key5", "Key6", "Key7", "Key8", "Key9", "Key10", "*YES", 
"*COMP", 0, "*NO")
If rtn  0 Then
 ' Display Last Error
MsgBox(rtn & " " & objWD.getLastErrorMessage)
' Successful checkin. Display Last Document ID
MsgBox("Checkin complete: " & objWD.getLastDociD)
End If
End If

'Return Last Document ID from WebDocs API after checkin.


'Release WebDocs API Object

Set objWD = Nothing

End Sub
Still have questions? We can help. Submit a case to technical support

Last Modified On:
You don't have the appropriate permissions.
No, open a new Support Case