This code will attach a file from the web.
dim fileName as string
Dim embedded As NotesEmbeddedObject
fileName = "InsertYourFileNameHere.txt"
Set embedded = doc.GetAttachment( fileName )
tempDir = Environ("TEMP")
extractPath = tempDir + "\" + fileName
Call embedded.ExtractFile( extractPath )
Call attachmentRTI.EmbedObject( EMBED_ATTACHMENT, "", extractPath )