I also need help creating links in Notes documents. Currently, I have an agent that will detach embeddeded attachments and save them in newly created folders in a specified network directory.
The step I need help with is the creation of a link to the folder that the attachments were detached to. I'd like to put the link in the same field where the attachments used to reside. I don't need a link to each individual attachment, I only need one link to the folder that contains all the attachments
Below is my agent in its current state. If anyone knows some script that can take care of this, I'd really appreciate any help.
Sorry if my code is very amateur-ish, the only training I had was one VB class about 3 years ago.

I'm thinking the code I need should be placed just after the Forall loop.
**************************************************************
Sub Initialize
Dim s As New NotesSession
Dim DC As NotesDocumentCollection
Dim doc As NotesDocument
Dim rtitem As Variant
Dim flag As Integer
Dim path As String
Dim rev As Integer
Dim info As String
Set DC = s.CurrentDatabase.UnprocessedDocuments
Set Doc = DC.GetFirstDocument
Do Until Doc Is Nothing
Print "Current document: " + Cstr(doc.ProposalNumber(0))
If (doc.HasEmbedded) Then
'checks if doc has attachments
flag = 0
'working on FIRST attachment
path = "C:\PAS_ARCHIVE_ATTACHMENTS\" + Cstr(doc.ProposalNumber(0))
If (doc.HasItem("ProposalRevNum")) Then
'checks if doc has Revision Number field
Dim num As String
num = Cstr(doc.ProposalRevNum(0))
If (num = "") Then
'doc has Revision Number field, BUT is empty
rev = 1
Else
'doc has Revision Number
rev = 0
End If
Else
'doc does NOT have Revision Number
rev = 1
End If
Set rtitem = doc.GetFirstItem("ProposalAttachment")
If (rtitem.Type = RICHTEXT) Then
Forall o In rtitem.EmbeddedObjects
If (o.Type = EMBED_ATTACHMENT) Then
If flag = 0 Then
'working on FIRST attachment
If rev = 0 Then
'doc has Revision Number
path = Ucase(path)
info = Dir(path, 16)
info = Ucase(info)
If (info = "") Then
Mkdir(path)
'creates new folder based on Proposal Number
path = path + "\" + Cstr(doc.ProposalRevNum(0))
Mkdir(path)
'creates new subfolder based on Revision Number
Else
path = path + "\" + Cstr(doc.ProposalRevNum(0))
Mkdir(path)
End If
Else
'doc does NOT have Revision Number
path = Ucase(path)
info = Dir(path, 16)
'checks for existence of Proposal Number folder
info = Ucase(info)
If (info = "") Then
Mkdir(path)
'creates new folder based on Proposal Number
End If
End If
End If
flag = 1
End If
Call o.ExtractFile(path+"\"+o.Source)
Call o.Remove
Call doc.Save(True,True)
End Forall
End If
End If
Set Doc = DC.GetNextDocument(Doc)
Loop
End Sub
Greatness is best measured by one's willingness to be kind.
