PermissionV11方法.docx
《PermissionV11方法.docx》由会员分享,可在线阅读,更多相关《PermissionV11方法.docx(44页珍藏版)》请在冰豆网上搜索。
PermissionV11方法
PermissionInterface
Usethe Permission objecttorestrictpermissionstotheactivedocumentandtoreturnorsetspecificpermissionssettings.
Namespace:
Microsoft.Office.Core
Assembly:
office(inoffice.dll)
Usage
VB
用法
PublicClassermissionImplementation
ImplementsPermission
EndClass
DimermissionImplementation1AsNewermissionImplementation()
Syntax
VB
声明
PublicInterfacePermission
Inherits_IMsoDispObj,IEnumerable
J#
publicinterfacePermissionimplements_IMsoDispObj,IEnumerable
JScript
publicinterfacePermissionimplements_IMsoDispObj,,IEnumerable
Remarks
The Permission propertyoftheMicrosoftOfficeWord2003 Document object,theMicrosoftOfficeExcel2003 Workbook object,andtheMicrosoftOfficePowerPoint2003 Presentation objectreturnsa Permission object.
Usethe Enabled propertytodeterminewhetherpermissionsarerestrictedontheactivedocument.Usethe Count propertytoreturnthenumberofuserswithpermissionsandthe RemoveAll methodtoresetallexistingpermissions.
The DocumentAuthor, EnableTrustedBrowser, RequestPermissionURL,and StoreLicenses propertiesprovideadditionalinformationaboutpermissionssettings.
The Permission objectgivesaccesstoacollectionof UserPermission objects.Usethe UserPermission objecttoassociatespecificsetsofrightswithindividualusers.Whilesomepermissionsgrantedthroughtheuserinterface(suchas msoPermissionPrint)applytoallusers,youcanusethe UserPermission objecttoassignthemonaper-userbasiswithper-userexpirationdates.
MicrosoftOfficeInformationRightsManagementsupportstheuseofadministrativepermissionpolicieswhichlistusersandgroupsandtheirdocumentpermissions.Usethe ApplyPolicy methodtoapplyapermissionpolicyandthe PermissionFromPolicy, PolicyName,and PolicyDescription propertiestoreturnpolicyinformation.
The Permission objectmodelisavailableregardlessofwhetherpermissionsarerestrictedontheactivedocument.The Permission propertyofthe Document,Workbook,and Presentation objectsdoesnotreturn Nothing whentheactivedocumentdoesnothaverestrictedpermissions.Usethe Enabled propertytodeterminewhetheradocumenthasrestrictedpermissions.
Useofthe Permission objectraisesanerrorwhentheWindowsRightsManagementclientisnotinstalled.
Platforms
DevelopmentPlatforms
WindowsXPHomeEdition,WindowsXPProfessional,WindowsServer2003,andWindows2000
TargetPlatforms
PermissionMembers
此主题尚未评级 - 评价此主题
Usethe Permission objecttorestrictpermissionstotheactivedocumentandtoreturnorsetspecificpermissionssettings.
Thefollowingtableslistthemembersexposedbythe Permission type.
PublicProperties
Name
Description
Application
Returnsan Application objectthatrepresentsthecontainerapplicationfortheobject.
Count
Returnsan Integer indicatingthenumberofitemsinthespecifiedcollection.
Creator
Returnsa32-bitintegerthatindicatestheapplicationinwhichthespecifiedobjectwascreated.
DocumentAuthor
Returnsorsetsthenameinemailformoftheauthoroftheactivedocument.
Enabled
Returnsorsetsa Boolean valuethatindicateswhetherpermissionsareenabledontheactivedocument.
EnableTrustedBrowser
Returnsorsetstheoptionthatallowsausertoviewadocumentwithrestrictedpermissionsinawebbrowseriftheuserdoesnothavetheappropriateclientapplicationinstalled.
Item
Returnsa UserPermission objectthatisamemberofthe Permission collection.
Parent
Returnsthe Parent objectforthespecifiedobject.
PermissionFromPolicy
Returnsa Boolean valuethatindicateswhetherapermissionpolicyhasbeenappliedtotheactivedocument.
PolicyDescription
Returnsthedescriptionofthepermissionspolicyappliedtotheactivedocument.
PolicyName
Returnsthenameofthepermissionspolicyappliedtotheactivedocument.
RequestPermissionURL
ReturnsorsetsthefileorwebsiteURLtovisitortheemailaddresstocontactforuserswhoneedadditionalpermissionsontheactivedocument.
StoreLicenses
Returnsa Boolean valuethatindicateswhethertheuser'slicensetoviewtheactivedocumentshouldbecachedtoallowofflineviewingwhentheusercannotconnecttoarightsmanagementserver.
Top
PublicMethods
Name
Description
Add
Createsanewsetofpermissionsontheactivedocumentforthespecifieduser.
ApplyPolicy
Appliesthespecifiedpermissionpolicytotheactivedocument.
GetEnumerator
Returnsanenumeratortosupportiteratingthroughthecollection.
RemoveAll
Removesall UserPermission objectsfromthe Permission collectionoftheactivedocumentanddisablesrestrictionsontheactivedocument.
Permission.ApplicationProperty
此主题尚未评级 - 评价此主题
Returnsan Application objectthatrepresentsthecontainerapplicationfortheobject.
Namespace:
Microsoft.Office.Core
Assembly:
office(inoffice.dll)
Usage
VB
用法
Dimpermission1AsPermission
DimreturnValueAsObject
returnValue=permission1.Application
Syntax
C#
C++
VB
声明
ReadOnlyPropertyApplication()AsObject
J#
publicSystem.Objectget_Application();
JScript
functiongetApplication():
Object;
ThreadSafety
Anypublicstatic(SharedinVisualBasic)membersofthistypearethreadsafe.Anyinstancemembersarenotguaranteedtobethreadsafe.
Platforms
DevelopmentPlatforms
WindowsXPHomeEdition,WindowsXPProfessional,WindowsServer2003,andWindows2000
TargetPlatforms
Permission.CountProperty
此主题尚未评级 - 评价此主题
Returnsan Integer indicatingthenumberofitemsinthespecifiedcollection.
Namespace:
Microsoft.Office.Core
Assembly:
office(inoffice.dll)
Usage
VB
用法
Dimpermission1AsPermission
DimreturnValueAsInteger
returnValue=permission1.Count
Syntax
C#
C++
VB
声明
ReadOnlyPropertyCount()AsInteger
J#
publicintget_Count();
JScript
functiongetCount():
int;
Remarks
Returns0(zero)ifpermissionsarenotenabledontheactivedocument.Whenpermissionsareenabled,the Count propertyalwaysreturnsatleast1,representingthepermissionsofthedocumentauthor.
ThreadSafety
Anypublicstatic(SharedinVisualBasic)membersofthistypearethreadsafe.Anyinstancemembersarenotguaranteedtobethreadsafe.
Platforms
DevelopmentPlatforms
WindowsXPHomeEdition,WindowsXPProfessional,WindowsServer2003,andWindows2000
TargetPlatforms
Permission.CreatorProperty
此主题尚未评级 - 评价此主题
Returnsa32-bitintegerthatindicatestheapplicationinwhichthespecifiedobjectwascreated.
Namespace:
Microsoft.Office.Core
Assembly:
office(inoffice.dll)
Usage
VB
用法
Dimpermission1AsPermission
DimreturnValueAsInteger
returnValue=permission1.Creator
Syntax
C#
C++
VB
声明
ReadOnlyPropertyCreator()AsInteger
J#
publicintget_Creator();
JScript
functiongetCreator():
int;
Remarks
IfthespecifiedobjectwascreatedinMicrosoftWord,thispropertyreturns1297307460,whichrepresentsthestringMSWD;ifcreatedinMicrosoftExcel,thispropertyreturns1480803660.Thisvaluecanalsoberepresentedbytheconstant wdCreatorCode inWord,or xlCreatorCode inExcel.
The Creator propertywasprimarilydesignedtobeusedontheMacintosh,whereeachapplicationhasafour-charactercreatorcode.Forexample,MicrosoftWordhasthecreatorcodeMSWD.Foradditionalinformationaboutthisproperty,consultthelanguagereferenceHelpincludedwithMicrosoftOfficeMacintoshEdition.
The Creator propertyalwaysreturnsthenumericidentifierfortheactiveapplication,justasthe Application propertyalwaysreturnsthenameoftheactiveapplicationinstringform.Usethe CreatedBy propertyofthe SharedWorkspaceFile, SharedWorkspaceFolder, SharedWorkspaceLink,and SharedWorkspaceTaskobjectstoreturnthenameoftheindividualwhocreatedthoseobjects.UsedocumentpropertiestoreturninformationabouttheauthorsofOfficedocuments.
ThreadSafety
Anypublicstatic(SharedinVisualBasic)membersofthistypearethreadsafe.Anyinstancemembersarenotguaranteedtobethreadsafe.
Platforms
DevelopmentPlatforms
WindowsXPHomeEdition,WindowsXPProfessional,WindowsServer2003,andWindows2000
TargetPlatforms
Permission.DocumentAuthorProperty
此主题尚未评级 - 评价此主题
Returnsorsetsthenameinemailformoftheauthoroftheactivedocument.
Namespace:
Microsoft.Office.Core
Assembly:
office(inoffice.dll)
Usage
VB
用法
Dimpermission1AsPermission
DimreturnValueAsString
returnValue=permission1.DocumentAuthor
DimsampleValueAsString
permission1.DocumentAuthor=sampleValue
Syntax
C#
C++
VB
声明
PropertyDocumentAuthor()AsString
J#
publicSystem.Stringget_DocumentAuthor();
publicvoidset_DocumentAuthor(System.String);
JScript
functiongetDocumentAuthor():
String;
functionsetDocumentAuthor(String);
Remarks
The DocumentAuthor propertyreturnsorsetstheauthoroftheactivedocument.Theauthoralwayshasnon-expiringownerrightstothedocument,whetherownerpermissionisgrantedexplicitly(througha UserPermission object)ornot.
The DocumentAuthor propertycanonlybechangedtoadifferentaccountthathasbeencertifiedthroughthepermissionsuserinterfacetoopenrestrictedcontentonthelocalmachine.Inmostcases,userswhohaveasingleWindowsaccountcanonlychoosebetweentheirWindowsandtheirPassportidentities.
Iftheuser'sMicrosoftWindowsandPassportidentitiesusethesameemailaddress,usetheformat passport:
someone@ tospecifythePassportidentityasthe DocumentAuthor property.
ThreadSafety
Anypublicstatic(SharedinVisualBasic)membersofthistypearethreadsafe.Anyinstancemembersarenotguaranteedtobethreadsafe.
Platforms
DevelopmentPlatforms
Window