Foxtable(狐表)用户栏目专家坐堂 → 在窗口中打开文件


  共有5700人关注过本帖平板打印复制链接

主题:在窗口中打开文件

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


加好友 发短信
等级:一尾狐 帖子:452 积分:3015 威望:0 精华:0 注册:2014/4/23 17:12:00
  发帖心情 Post By:2014/10/13 16:02:00 [只看该作者]

外部数据源,不好发,我插入图片的代码是这样写吗:
axWebBrowser = Nothing
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 .quit()
oDocument .Close()
Dim app As New MSWord.Application
try
    Dim fileName = ProjectPath & "Attachments\方案申请.doc"
    app.Documents.Open(fileName)
    app.Documents(fileName).Range(Start:=20, End:=30).InlineShapes.AddPicture(FileName:= _
    "D:\123.jpg" _
    , LinkToFile:=False, SaveWithDocument:=True)
    app.Documents.save
    messagebox.show("您已成功插入图片!!")
catch ex As exception
    msgbox(ex.message)
finally
    app.Quit
End try
这样没有反应的...

 回到顶部
总数 55 1 2 3 4 5 6 下一页