怎样把Find类的实例和当前文档关联?
Find类的Execute方法有15个参数,怎么搞定?我想做的就是自动实现/查找替换/功能。
请指教! 
谢谢!!

解决方案 »

  1.   

    替换:
    Set myRange = ActiveDocument.Content
    myRange.Find.Execute FindText:="hi", ReplaceWith:="hello", _
        Replace:=wdReplaceAll
    查找:
    Set myRange = ActiveDocument.Content
    myRange.Find.Execute FindText:="blue", Forward:=True
    If myRange.Find.Found = True Then myRange.Bold = True
      

  2.   

    大哥我用的是VC啊,这些VBA代码我已经研究多次了。 );
      

  3.   

    有什么不同吗?你需要用以下语句定义一个变量
    用作option的参数
    COleVariant varOpt ((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
      

  4.   

    //sigh...Selection oSel = oApp.GetSelection();
    Range RG;
    RG=oSel.GetRange();
    Find find;
    find=RG.GetFind();
    find.Execute(COleVariant("DDS"),vTrue,vTrue,vFalse,
     vFalse,vTrue,vTrue,vTrue,
     vFalse,COleVariant("AAA"),vTrue,vTrue,
     vFalse,vFalse,vOpt);