DSO framer Control Object operation Word file

Source: Internet
Author: User
Tags password protection

<1>dso Framer Control Object implements non-editable loading of Word files

Axframercontrol1.open (OldPath);

This.axFramerControl1.set_EnableFileCommand (DSOFramer.dsoFileCommandType.dsoFileSave, false); Implement a non-editable this.axFramerControl1.set_EnableFileCommand embedded Word file (dsoframer.dsofilecomm Andtype.dsofilesaveas, false);

Microsoft.Office.Interop.Word.DocumentClass w = (Microsoft.Office.Interop.Word.DocumentClass) This.axFramerControl1.ActiveDocument;

Object missing = false;

Object obj = true;

Object obj2 = "1234";

W.protect (Microsoft.Office.Interop.Word.WdProtectionType.wdAllowOnlyReading, ref obj, ref obj2, ref missing, ref obj);

<2>dso framer Control Object implements saving Word files without overwriting source files This.axFramerControl1.set_EnableFileCommand (DSOFramer.dsoFileCommandType.dsoFileSaveAs, false);

Microsoft.Office.Interop.Word.DocumentClass w = (Microsoft.Office.Interop.Word.DocumentClass) This.axFramerControl1.ActiveDocument;

Object filepath = (object) filepath;

Object MIS = type.missing;

W.saveas (ref filepath,ref mis,ref mis,ref mis,ref mis, ref MIS, ref MIS, ref MIS, ref MIS, ref MIS, ref MIS, ref MIS, ref MIS, ref MIS, ref MIS, ref mis); Save As

Axframercontrol1.close (); Off, thus eliminating the need for w.close ()

<3>axframercontrol1 Save the current Word file

Axframercontrol1.save (FilePath + filename, true, Type.Missing, Type.Missing);

The Save method is defined as follows:

public virtual void Save (Object Saveasdocument, Object overwriteexisting, Object Webusername, Object WebPassword);

Saveasdocument the file name to save

overwriteexisting if the file already exists overwrite

Webusername password protection account set by word

WebPassword password protection password set by word

DSO framer Control Object operation Word file

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.