open a password protected document using AppleScript


I am a newbie in using AppleScript. I want to open a document which is password protected.

Here’s my code:
tell application “MoneyWorks Gold” to ¬
open file "Macintosh HD:Applications:contacts v5.mwd5"with
passwords “xxxx”
tell application “MoneyWorks Gold” to ¬
export “Name.Code-#[Code] [Phone]”

It runs well but prompts for password again. I want to open the document without dialog box asking for password.

Could you please suggest me how to accomplish it. Please reply.