CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: OLE help...

  1. #1
    Join Date
    Nov 1999
    Posts
    9

    OLE help...

    OLE expect plz help.....

    How to use the looping for find & replace method in OLE by using WinWord program? And the most important thing is I need all the data are display in table.
    Thanks for helping!!


  2. #2
    Join Date
    Dec 1999
    Location
    Dublin, Ireland
    Posts
    1,173

    Re: OLE help...

    Try:

    public Sub ReplaceAndCount(sFind as string)

    Dim nCount as Long


    While ThisDocument.Content.Find.Execute(FindText:=sFind, Forward:=true, replacewith:="@@@@", replace:=wdReplaceOne)
    nCount = nCount + 1
    Wend

    ThisDocument.Content.Find.Execute FindText:="@@@@", Forward:=true, replacewith:=sFind, replace:=wdReplaceAll

    Debug.print nCount & " found and replaced"

    End Sub



    hth,
    Duncan

    '--8<-----------------------------------------
    NEW -The printer usage monitoring application
    '--8<------------------------------------------

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured