我想通过一个给定路径打开对应的WORD文档,并且根据用户不同打开分为三种情况:1.完全控制;2.只读,但是可以select all、copy、save as...等;3.只能读,其他均不能操作;
(注:这些文档是保密性技术文档)关于该类问题,哪位大哥能给点资料让小弟我学习学习!谢谢![email protected]

解决方案 »

  1.   

    可以在open命令中实现对"1.完全控制;2.只读"的控制,
    而"3.只能读,其他均不能操作"不容易实现,也没有什么意义.(拷贝或者重命名文件不就可以实现Save as一样的功能......)
    建议用密码(只读密码和打开密码)来限制各种用户打开和操作的权限.MSDN:
    Word 2000
    Open Method           Syntax 1: Opens the specified document and adds it to the Documents collection. Returns a Document object.Syntax 2: Opens the specified object. When applied to a Subdocument or RecentFile object, Syntax 2 returns a Document object.Syntax 1expression.Open(FileName, ConfirmConversions, ReadOnly, AddToRecentFiles, PasswordDocument, PasswordTemplate, Revert, WritePasswordDocument, WritePasswordTemplate, Format, Encoding, Visible)Syntax 2expression.Openexpression   Syntax 1: Required. An expression that returns a Documents object.Syntax 2: Required. An expression that returns an OLEFormat, RecentFile, Subdocument, or Version object.FileName   Required Variant. The name of the document (paths are accepted).ConfirmConversions   Optional Variant. True to display the Convert File dialog box if the file isn't in Microsoft Word format.ReadOnly   Optional Variant. True to open the document as read-only.AddToRecentFiles   Optional Variant. True to add the file name to the list of recently used files at the bottom of the File menu.PasswordDocument   Optional Variant. The password for opening the document.PasswordTemplate   Optional Variant. The password for opening the template.Revert   Optional Variant. Controls what happens if Name is the file name of an open document. True to discard any unsaved changes to the open document and reopen the file. False to activate the open document.WritePasswordDocument   Optional Variant. The password for saving changes to the document.WritePasswordTemplate   Optional Variant. The password for saving changes to the template.Format   Optional Variant. The file converter to be used to open the document. Can be one of the following WdOpenFormat constants: wdOpenFormatAllWord, wdOpenFormatAuto, wdOpenFormatDocument, wdOpenFormatEncodedText, wdOpenFormatRTF, wdOpenFormatTemplate, wdOpenFormatText, wdOpenFormatUnicodeText, or wdOpenFormatWebPages. The default value is wdOpenFormatAuto.To specify an external file format, apply the OpenFormat property to a FileConverter object to determine the value to use with this argument.Encoding   Optional Variant. The document encoding (code page or character set) to be used by Microsoft Word when you view the saved document. Can be any valid MsoEncoding constant. For the list of valid MsoEncoding constants, see the Object Browser in the Visual Basic Editor. The default is the system code page. Read/write Long.Visible   Optional Variant. True if the document is opened in a visible window. The default is True.