how to set expiration date of permission object using C#?

  • Thread starter Thread starter Rock
  • Start date Start date
R

Rock

Hi,all:

I have find a example to set expiration date of word permission
object, but it was using VBA code.


Dim objUserPerm As Office.UserPermission
Set objUserPerm = ActiveWorkbook.Permission.Add( _
"(e-mail address removed)", _
msoPermissionRead + msoPermissionEdit, #12/31/2005#) ------>set
expiration date in vba code
And I want using C# to do that, but I don't know how to set
expiration date format in C#. because the expiration date of
permission object is a object type ( object ExpirationDate). I write
some code like : object expirdate = "#12/31/2005#";
and call oPermission.add("rockemail",wordpermission,expirdate);
it's always throw argement error. How to I change my code ??
Please Help... Thank you..
Rock.
 
Back
Top