都这么晚了,你也还在工作啊,
看看我的贴好吗我也遇到了问题
(一个在vba,一个在数据库)?明天我要向老总交代,要不帮帮我想想怎么打发老总,真的好想睡觉,我都20多个小时没有合眼了

解决方案 »

  1.   

    好办啊,在MSDN当中搜索WORD,就有办法啦。
    MSDN 对 EXCEL 和 WORD 支持最强。
      

  2.   

    HAPPY NEW YEAR!!!
    up      up         up         upupupup   upupupup   up        up
    up      up        upup        up     up  up     up   up      up
    up      up       up  up       up      up up      up   up    up
    up      up      up    up      up      up up      up    up  up
    upupupupup     upupupupup     up     up  up     up      upup
    up      up    up        up    upupupup   upupupup        up
    up      up   up          up   up         up              up
    up      up  up            up  up         up              up
    up      up up              up up         up              up
      

  3.   

    这个很简单嘛,
    VB中不是有一个OLE控件吗?用它就可以了啊
      

  4.   

    我用过ole了,可是它包含的word文档的编辑区大小怎么控制?还有不能显示滚动条。
      

  5.   

    用word提供的对象库,可以完成很多功能!VBAWD10.CHM帮助说明了很多!
      

  6.   

    还是我给你们吧;试试  好用
      通过ole控件
      现在是给ole加滚动条:
      
      先插入一个picturebox,在picturebox中放一个ole 控件,在sizemode中设为
    2-autosize。
    然后写入下列代码:
       Private Sub HScroll1_Change()
        OLE1.Left = -HScroll1.Value
        End Sub
         
        Private Sub VScroll1_Change()
        OLE1.Top = -VScroll1.Value
        End Sub
         
        Private Sub Command1_Click()
        HScroll1.Value = 0
        VScroll1.Value = 0
        With OLE1
         .CreateLink ("c:\My Documents\111.dot") 
         HScroll1.Max = .Width - Picture1.Width + 20
         HScroll1.LargeChange = .Width / 10
         HScroll1.SmallChange = .Width / 20
         VScroll1.Max = .Height - Picture1.Height + 20
         VScroll1.LargeChange = .Height / 10
         VScroll1.SmallChange = .Height / 20
        End With
        End Sub
    下面是插入word :
      Private Sub Command1_Click()     Set appWord = CreateObject("Word.Application")
            appWord.Visible = False
       Set docWord = appWord.Documents.Open("D:111.dot")
       Set tblWord = docWord.Tables.Item(1)
          
        tblWord.Cell(12, 1).Range.Text = Form1.Text34.TextdocWord.Save
    docWord.Close
    appWord.Quit
    Set docWord = Nothing
    Set appWord = Nothing
    end sub
    Private Sub Form_Load()
     Dim wordobj As Object
      HScroll1.Value = 0
        VScroll1.Value = 0
        With OLE1
         .CreateLink ("D:\111.dot") 'Text1.Text内容可设为c:\myexcel.xls等
         .DoVerb
         .Action = 7
         .object.Application.Visible = False
         HScroll1.Max = .Width - Picture1.Width + 20
         HScroll1.LargeChange = .Width / 10
         HScroll1.SmallChange = .Width / 20
         VScroll1.Max = .Height - Picture1.Height + 20
         VScroll1.LargeChange = .Height / 10
         VScroll1.SmallChange = .Height / 20
        End With
      
       
          
       
    End SubPrivate Sub Form_Unload(Cancel As Integer)
       OLE1.object.Application.Quit
       
    End Sub
    Private Sub HScroll1_Change()
        OLE1.Left = -HScroll1.Value
        End Sub
         
        Private Sub VScroll1_Change()
        OLE1.Top = -VScroll1.Value
        End Sub
      

  7.   

    在word中如何利用vba自动填表格
    用vb 先建一个c:\temp.doc  
    Dim myword As New Word.Application
    Dim mydocument As Document
    Const Maxlines = 100000   '定义最大行数Private Sub Command1_Click()
    Set mydocument = myword.Documents.Open("c:\temp.doc")With myword
        .Selection.MoveDown Unit:=wdLine, Count:=Maxlines
        .Selection.InsertRows
        .Selection.TypeText Text:=Text1
        .Selection.MoveRight Unit:=wdCharacter, Count:=1
        .Selection.TypeText Text:=Text2
        .Selection.MoveLeft Unit:=wdCharacter, Count:=1
    End Withmydocument.Save
    mydocument.Close
    Set mydocument = Nothing
    myword.Quit
    Set myword = Nothing
    End SubPrivate Sub Command2_Click()
    Unload Me
    End SubPrivate Sub Command3_Click()
    Form1.Show vbModal
    End Sub再第二各窗体中应用ole插入word文档  ,别望了引用word 9.0
    第二窗体输入
    Private Sub Command1_Click()
    Unload Me
    End SubPrivate Sub Form_Load()
    OLE1.CreateLink ("c:\temp.doc")OLE1.DoVerb
    OLE1.Action = 7
    OLE1.object.Application.Visible = False
    End SubPrivate Sub Form_Unload(Cancel As Integer)
    OLE1.object.Application.QuitEnd Sub
      

  8.   

    to 980()
    效果还是不理想,我想要的效果和http://www.dbstep.com的一样
      

  9.   

    不用ole,通过webbrowser控件
    WebBrowser1.Navigate "c:\1.doc" 即可