我想这样,就是再我在vb中打开一个doc文档的时候,我可以修改这个文档,并且可以把它保存到我的数据库中,这些操作,我都使用vb命令实现,不知道可以实现么具体的思路就是在vb中打开一个word文档,于此同时,打开一个命令控制条,
控制条上有,修改,保存,打印等命令
当我不点任何命令的时候,
是只读的,只能浏览,
但是,点修改的时候,
是可编辑状态的,
点保存的时候,将这个文件保存到我的数据库里面,并且关闭这个word文件!在我进行这些操作的时候,我想让word里面的一些菜单都是不可用的,只有我的那几个可以使用。不知道这个是否好实现,请大虾多多指教阿

解决方案 »

  1.   

    Private Sub btnPrint_Click()
        '添加Word的引用
        dim wrd As New Word.Application
        wrd.Visible = True    Dim doc As String
        
        doc = "c:\Test.Doc"
        Documents.Open FileName:=doc    '在Word中录制一些宏代码,然后粘贴到这即可直接运行
        End Sub
      

  2.   

    还有,我想让我的那个vb控制条,永远浮动在打开的那个word 文件的右上角,这个怎么实现呢,
    这里面需要几个问题,第一,确定控制条的位置,第二,永远在上面。
      

  3.   

    在这里我给你我写的控制Word格式的程序。不知能不能帮到你,我看你在下面留言了,所以过来发给你。
    Dim wd As New Word.Application
    wd.Documents.Add DocumentType:=wdNewBlankDocument
    wd.Selection.EndKey Unit:=wdStory '½«¹â±êÒƵ½×îºó
      wd.Visible = True
      With wd.Selection.ParagraphFormat
          .LeftIndent = CentimetersToPoints(0)
          .RightIndent = CentimetersToPoints(0)
          .SpaceBefore = 0
          .SpaceBeforeAuto = False
          .SpaceAfter = 0
          .SpaceAfterAuto = False
          .LineSpacingRule = wdLineSpace1pt5
          .Alignment = wdAlignParagraphJustify
          .WidowControl = False
          .KeepWithNext = False
          .KeepTogether = False
          .PageBreakBefore = False
          .NoLineNumber = False
          .Hyphenation = True
          .FirstLineIndent = CentimetersToPoints(0)
          .OutlineLevel = wdOutlineLevelBodyText
          .CharacterUnitLeftIndent = 0
          .CharacterUnitRightIndent = 0
          .CharacterUnitFirstLineIndent = 0
          .LineUnitBefore = 0
          .LineUnitAfter = 0
          .AutoAdjustRightIndent = True
          .DisableLineHeightGrid = False
          .FarEastLineBreakControl = True
          .WordWrap = True
          .HangingPunctuation = True
          .HalfWidthPunctuationOnTopOfLine = False
          .AddSpaceBetweenFarEastAndAlpha = True
          .AddSpaceBetweenFarEastAndDigit = True
          .BaseLineAlignment = wdBaselineAlignAuto
      End WithWith wd
        .Selection.Font.Size = 18
        .Selection.Font.Name = "宋体"
        .Selection.Font.Bold = wdToggle
        .Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
        .Selection.TypeText Text:="标题"
        .Selection.TypeParagraph
        .Selection.ParagraphFormat.Alignment = wdAlignParagraphRight
        .Selection.Font.Size = 12
        .Selection.Font.Bold = wdToggle
        .Selection.TypeText Text:="时间"   
        .Selection.TypeParagraph
        .Selection.ParagraphFormat.Alignment = wdAlignParagraphJustify
        .Selection.TypeText Text:="内容"
    End With
    wd.Visible = True
    wd.ShowMe
      

  4.   

    第三,保存的时候,怎么用命令把这个word文件保存到指定的位置呢。