Create button to detach file?

Hi,

I want to create an button in the mail message, when user click on it, it will detach/save the attached file to specific folder.

Do I have to use script to do it? thanks!

Also, would like the email is generate from vb6 application. I already knew how to create an mail message / file attachment from vb6, but just wonder I can create button or not through vb6.

Thanks!

Subject: create button to detach file?

Below is LotusScript button code for save attachment in your mail document


On Error Resume Next



Const bDirectoriesOnly = True

Const sBodyField = "Body"

Const sMsgTitle = "Select target directory to save attachment"



Dim Workspace As New NotesUIWorkspace

Dim Doc As NotesDocument

Dim RTItem As NotesRichTextItem

Dim sTargetDir As Variant



Set Doc = Workspace.CurrentDocument.Document



If Doc.HasItem(sBodyField) Then		' if has body

	Set RTItem = Doc.GetFirstItem(sBodyField)

	If RTItem.Type = RICHTEXT Then		' if RichText field

		sTargetDir = Workspace.SaveFileDialog(bDirectoriesOnly, sMsgTitle)

		If Not Isempty(sTargetDir) Then		' if user click OK button

			Forall oAttach In RTItem.EmbeddedObjects		' forall attachment file

				If oAttach.Type = EMBED_ATTACHMENT Then oAttach.ExtractFile sTargetDir(0) & "\" & oAttach.Source

			End Forall		' end forall attachment file

		End If		' end if user click OK button

	End If		' end if RichText field

End If		' end if has body