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

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top