Use Evaluate and @Name in Lotusscript to get email. How to do it?

Hi,

I tried to call the Evaluate and @Name to get the internet email address from mails’ From field, in a Lotusscript view action:

Set collection = db.UnprocessedDocuments

Set doc = collection.GetFirstDocument()

Dim TmpFrom As Variant

While Not(doc Is Nothing)

TmpFrom = Evaluate( “@Name( [ ADDRESS821 ] ; From )”, doc )

When this code is ran, Notes reports “Error in EVALUATE macro”.

Is it correct to use a formula in a loop for many documents? And how to get the email address?

Thanks in advanced~

Subject: Resolved?

I tried the code below and it seems work:

Dim TmpFrom As Variant

Const FormulaFrom = “@Name( [ADDRESS821] ; From )”

While Not(doc Is Nothing)

TmpFrom = Evaluate( FormulaFrom, doc )

Print TmpFrom(0)

Thanks :}

Subject: You solved your problem by removing the extra spaces around the constant.

This would work as well… TmpFrom = Evaluate(“@Name([ADDRESS821]; From)”, doc)