Hi everyone, I have an agent that is connecting to a file share and copying a TIF file. Somehow it is not making the connection to the share although the server does have admin rights to that share. Here is my code, can anyone tell me if the connection to the share is correct?
Option Public
Sub Initialize
Dim s As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim item1 As NotesItem
Dim tiffFileCtr As Long
tiffFileCtr = 0
Dim SearchStr As String
SearchStr = ".tif"
Dim subj As Variant
On Error GoTo ErrHdl
Dim tiffFile As Variant
Set db = s.CurrentDatabase
Set View = db.GetView("TIF Files") ' this will be the inbox view of the mailin DB
Set doc = view.GetFirstDocument
'note: imaging must be a mapped drive
Const TIFPATH = “x:\share\public\noname\directory”
While Not doc Is Nothing
If doc.Hasembedded = True Then
Set tiffFile = doc.GetFirstItem("Body")'you will need to use the body item of the mail document rather than addendum
If (tiffFile.Type = RICHTEXT) Then
ForAll o In tiffFile.EmbeddedObjects
If (o.Type = EMBED_ATTACHMENT) Then
If Not InStr(o.Source, SearchStr) = 0 Then
Call o.ExtractFile("TIFPATH" & o.Source) 'where they want the file stored on the directory, not sure how they want it saved (i.e. by name ? ")
' Call o.ExtractFile("e:\TIFFiles\" & o.Source) 'where they want the file stored on the directory, not sure how they want it saved (i.e. by name ? ")
tiffFileCtr = tiffFileCtr + 1
'Call o.Remove
subj = doc.Getitemvalue("Subject")
MsgBox subj
Set item1 = doc.AppendItemValue("ExcludeFromView", "A")
Call doc.Save(False, True)
Call Doc.PutInFolder("Processed")
Call doc.Removefromfolder("$Inbox")
End If
End If
End ForAll
End If
End If
Set doc = view.GetNextDocument(doc)
Wend
MsgBox "Total Number of Files Removed = " & tiffFileCtr
Errhdl :
Resume next
End Sub
Thanks