以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助] 隐藏office 的所有栏目  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=93148)

--  作者:zcgmxf
--  发布时间:2016/11/21 20:45:00
--  [求助] 隐藏office 的所有栏目

有点蓝老师,红袍老师给的代码隐藏了部分office 栏目,但是上面还有一个,是否能全部隐藏?

Dim dr As Row = CurrentTable.Current
If dr IsNot Nothing Then
    If dr.IsNull("标题") = False Then
        Dim web1 As Windows.Forms.WebBrowser
        web1 = e.Form.Controls("WebBrowser1").baseControl
        AddHandler web1.DocumentCompleted,addressof WebBrowser1_DocumentCompleted
        axWebBrowser = Nothing
       
        Dim web As Object = e.Form.Controls("WebBrowser1").basecontrol
        web.Navigate("E:\\Publish\\Project\\RemoteFiles\\新闻图片内容\\" & dr("标题"))
       
        Do Until axWebBrowser IsNot Nothing
            Application.DoEvents
        Loop
        Dim oDocument As object = axWebBrowser.Gettype().InvokeMember("Document", System.Reflection.BindingFlags.GetProperty, Nothing, axWebBrowser, Nothing)
        Dim oApplication As object = axWebBrowser.Gettype().InvokeMember("Application", System.Reflection.BindingFlags.GetProperty, Nothing, oDocument, Nothing)
       
        oApplication.ActiveWindow.DocumentMap = False
        oDocument.Protect (Password:="123456", NoReset:=False, Type:= _
        MsWord.WdProtectionType.wdAllowOnlyReading, UseIRM:=False, EnforceStyleLock:=False)
        oDocument.saved = True
        vars("doc") = oDocument
    Else
        MessageBox.Show("没有相关文字内容!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
        Return
    End If
End If
 

Dim refmissing As [Object] = System.Reflection.Missing.Value
Dim args As Object() = New Object(3) {}
args(0) = 24
args(1) = 2
args(2) = refmissing
args(3) = refmissing
axWebBrowser.[Gettype]().InvokeMember("ExecWB", 256, Nothing, axWebBrowser, args)


图片点击可在新窗口打开查看此主题相关图片如下:qq图片20161121204144.png
图片点击可在新窗口打开查看
[此贴子已经被作者于2016/11/21 20:46:15编辑过]

--  作者:有点蓝
--  发布时间:2016/11/21 21:13:00
--  
office2013测试没有问题,暂时没有其它版本office测试