Foxtable(狐表)用户栏目专家坐堂 → [求助]打开Word 文件


  共有2966人关注过本帖树形打印复制链接

主题:[求助]打开Word 文件

帅哥哟,离线,有人找我吗?
有点蓝
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110592 积分:562856 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2016/9/5 9:15:00 [显示全部帖子]


 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110592 积分:562856 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2016/9/5 22:41:00 [显示全部帖子]

axWebBrowser = Nothing
Dim dr As Row = CurrentTable.Current
If dr IsNot Nothing Then
    Dim web As Object = e.Form.Controls("WebBrowser1").basecontrol
    web.Navigate(ProjectPath & "Attachments\" & 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
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)

 回到顶部