有点蓝老师,红袍老师给的代码隐藏了部分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编辑过]