UserPermission.UserId 属性
获取用户的电子邮件地址,该用户对当前表单的权限由指定的 UserPermission 对象确定。
命名空间: Microsoft.Office.Interop.InfoPath.SemiTrust
程序集: Microsoft.Office.Interop.InfoPath.SemiTrust(位于 Microsoft.Office.Interop.InfoPath.SemiTrust.dll 中)
语法
声明
ReadOnly Property UserId As String
Get
用法
Dim instance As UserPermission
Dim value As String
value = instance.UserId
string UserId { get; }
属性值
类型:System.String
用户的电子邮件地址。
备注
UserPermission 对象将当前表单的一组权限与单一用户和一个可选的到期日期关联。UserId 属性返回其权限由 UserPermission 对象确定的用户的电子邮件地址。
由于 Microsoft InfoPath 无法识别 UserPermission 对象及其成员,因此您必须将 thisXDocument 变量返回的对象强制转换成 _XDocument3 类型,才能访问此对象及其成员。有关详细信息,请参阅如何:使用与 InfoPath 2003 不兼容的 Microsoft.Office.Interop.InfoPath.SemiTrust 成员。
此成员只能由与当前打开的表单在相同域中运行的表单访问,或者由已授予跨域权限的表单访问。
示例
在以下示例中,将从当前表单的 Permission 集合中检索第二个 UserPermission 对象,然后使用 UserId 属性显示该用户的电子邮件地址。
_XDocument3 thisDoc = (_XDocument3)thisXDocument;
UserPermission thisUser =
thisDoc.Permission[1];
thisXDocument.UI.Alert(thisUser.UserId);
Dim thisDoc As _XDocument3 = DirectCast(thisXDocument, _XDocument3)
UserPermission thisUser =
Permission.UserPermissions(1)
thisXDocument.UI.Alert(thisUser.UserId)