+ Reply to Thread
Results 1 to 33 of 33

Find/Replace Macro to Word

Hybrid View

  1. #1
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Find/Replace Macro to Word

    Almost there...

     
    Sub snb_Replacing()
     with getobject("C:\Users\Admin\Desktop\Pack.doc")
       for j=1 to 6 
        .application.Selection.Find.execute choose(j,"Name1", "Name2","Addresline 1","Adressline 2"), , , , , , , , , cells(choose(j,2,3,8,9),3), 2
       next
      .close -1
     End With
    End Sub
    PS. If I were you I would save the result. In your code you don't.

    NB. the wordconstant 2 is equivalent to wdreplaceall.
    the argument 'forward' is redundant if using wdreplaceall.
    Last edited by snb; 09-30-2011 at 03:34 AM.



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1