我想问一下,vba调用word搜索的方法怎么写
比如,我向搜索"value"在word中的位置.
另外怎么用JS去调用它呢

解决方案 »

  1.   

    这东西,我没有一点基础,现在是要写程序,用js操作word了.
      

  2.   

    宏录制,查看word里的宏代码,照着写
      

  3.   


      Selection.Find.ClearFormatting
        With Selection.Find
            .Text = "df"
            .Replacement.Text = ""
            .Forward = True
            .Wrap = wdFindContinue
            .Format = False
            .MatchCase = False
            .MatchWholeWord = False
            .MatchByte = True
            .MatchWildcards = False
            .MatchSoundsLike = False
            .MatchAllWordForms = False
        End With
        Selection.Find.Execute
        Selection.Find.Execute
        Selection.Find.Execute
    End Sub
    以上代码,怎么用javascript调用呢
    Application.Selection.Range.Find这个已经有了
      

  4.   

    Dim wordd
    Private Sub Command1_Click()
    Set wordd = CreateObject("Word.Application")
      wordd.Documents.open "c:\muoban.doc"
      wordd.Visible = True
      wordd.Activate
     '查找内容并替换内容
     With wordd.Selection.Find
             .Text = "查找内容"
            .Replacement.Text = "替换内容"
            .Forward = True
            .Wrap = 1
            .Format = False
            .MatchCase = False
            .MatchWholeWord = False
            .MatchByte = True
            .MatchWildcards = False
            .MatchSoundsLike = False
            .MatchAllWordForms = False
     End With
     wordd.Selection.Find.Execute Replace:=2
     wordd.ActiveDocument.Save
     wordd.Application.Quit
     
    End Sub
      

  5.   

    真没听说过用js调用宏命令的.也没听说c++或者c#调用宏命令的,这是为什么呢??!