Detach attachment

hi all,

i m using following code to detach attachment from lotus notes client…

Set item= doc.GetFirstItem(“attach”)

Forall att In item.EmbeddedObjects

	Redim Preserve attacharr(cnt)

	If att.Type = EMBED_ATTACHMENT Then

		filepath$ = "C:\" & att.Source

		Call att.ExtractFile(filepath$)

		attacharr(cnt)=filepath$	

	End If

End Forall

when i compose new document and add attachments to “attach” field and run this code i get error msg as “object variable not set” at this line “Forall att In item.EmbeddedObjects”.

pls help me out…

Subject: Use the debugger

Use the debugger - Tools, debug lotusscript - and you will find out what object isn’t set or declared.