Cannot access portions of this document because it is encrypted and was not intended for you, or you not have the decryption key

when user click the email link the document will open after that he click approve button Lotus notes asking SAP login username and password when he put username and password the error will be thrown.

Error message:

Notes error: You cannot access portions of this document because it is encrypted and was not intended for you, or you not have the decryption key.

Kindly help me to fix.

script:

aTmp(0) = docTmp.SAPID(0)

	aTmp(1) = docTmp.SAPPassword(0)

	

	prodoc.sapid = docTmp.SAPID(0)

	prodoc.password = docTmp.SAPPassword(0)

	Set item = prodoc.GetFirstItem( "password" )

	item.IsEncrypted = True

	Call prodoc.Encrypt		

	Call prodoc.save( True, True )

	

Else

	aTmp(0) = prodoc.SAPID(0)

	aTmp(1) = prodoc.Password(0)		

End If



InputSAPIDPassword = aTmp

End Function