DsoFramer word,excel只读和ppt自动阅览功能(c#版)

c#版:
word:
Microsoft.Office.Interop.Word.Document wordDoc = (Microsoft.Office.Interop.Word.Document)axFramerControl1.ActiveDocument;
Microsoft.Office.Interop.Word.Application wordApp = wordDoc.Application;
wordDoc.Protect(Microsoft.Office.Interop.Word.WdProtectionType.wdAllowOnlyFormFields);

excel:
Microsoft.Office.Interop.Excel.Workbook excelDoc = (Microsoft.Office.Interop.Excel.Workbook)axFramerControl1.ActiveDocument;
Microsoft.Office.Interop.Excel.Application excelApp = excelDoc.Application;
excelDoc.Protect(“123″, Type.Missing, Type.Missing);
Worksheet sh = (Worksheet)excelDoc.ActiveSheet;

sh.Protect(“123″, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, true, Type.Missing, Type.Missing);

ppt自动预览:
Microsoft.Office.Interop.PowerPoint.Presentation pptDoc = (Microsoft.Office.Interop.PowerPoint.Presentation)axFramerControl1.ActiveDocument;
pptDoc.SlideShowSettings.RangeType = Microsoft.Office.Interop.PowerPoint.PpSlideShowRangeType.ppShowSlideRange;
pptDoc.SlideShowSettings.ShowType = PpSlideShowType.ppShowTypeWindow2;
Microsoft.Office.Interop.PowerPoint.Application pptApp = pptDoc.Application;
pptDoc.Slides.Range(Type.Missing);
this.axFramerControl1.set_EnableFileCommand(DSOFramer.dsoFileCommandType.dsoFileClose, false);
this.axFramerControl1.ProtectDoc(1, 1, “pwd”);
SendKeys.Send(“{F5}”);