WorkbookBase.ProtectWindows الخاصية
الحصول على القيمة تشير إلى ما إذا كان Windows مصنف محمي.
مساحة الاسم: Microsoft.Office.Tools.Excel
التجميع: Microsoft.Office.Tools.Excel.v4.0.Utilities (في Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)
بناء الجملة
'إقرار
Public ReadOnly Property ProtectWindows As Boolean
Get
public bool ProtectWindows { get; }
قيمة الخاصية
النوع: System.Boolean
trueإذا كانت إطارات مصنف المحمي؛ وإلا،false.
أمثلة
يلي تعليمات برمجية يستخدم المثال Protectأسلوب ليحمي بنية مصنف وإطارات المصنف، ولكن دون تعيين كلمة مرور يحمي. المثال ثم يتحقق من قيم ProtectStructureو ProtectWindowsالخصائص للتحقق من ذلك th هو حماية هو. التعيين
Th هو المثال هو لتخصيص المستوى مستند.
Private Sub ProtectWorkbook()
Me.Protect(Structure:=True, Windows:=True)
If Me.ProtectStructure Then
MsgBox("You cannot add, delete or change the location " & _
"of sheets in this workbook.")
End If
If Me.ProtectWindows Then
MsgBox("You cannot arrange windows in this workbook.")
End If
End Sub
private void ProtectWorkbook()
{
this.Protect(missing, true, true);
if (this.ProtectStructure)
{
MessageBox.Show("You cannot add, delete or change the location " +
"of sheets in this workbook.");
}
if (this.ProtectWindows)
{
MessageBox.Show("You cannot arrange windows in this workbook.");
}
}
أمن NET Framework.
- الثقة الكاملة للمتصل الفوري. يتعذر استخدام هذا العضو بواسطة التعليمات البرمجية الموثوق بها جزئيًا. لمزيد من المعلومات، راجع باستخدام مكتبات من تعليمات برمجية موثوق بها جزئي.