+ Reply to Thread
Results 1 to 3 of 3

Search and Replace Footer in word with excel macro?

  1. #1
    Registered User
    Join Date
    06-12-2013
    Location
    USA
    MS-Off Ver
    excel 2007
    Posts
    9

    Search and Replace Footer in word with excel macro?

    So I'm trying to do a search and replace that works in the footer of a word file, but my macro is in excel. wdDoc is the document passed to the function, SearchString is the string I'm looking for (also an argument of the function), and ReplaceString is the replacement text (again an argument to the function).

    With the below code, I get an error: "Type Mismatch". I get the same error if I replace wdDoc with ActiveDocument . The highlighted line is the For Each line.

    Please Login or Register  to view this content.
    Changing "With wdDoc.rStoryRange.Find" to "With rStoryRange.Find" gets me an "Argument Not Optional Error" whether I use wdDoc or ActiveDocument. The highlighted line is: Sub SandRFooter(SearchString As String, ReplaceString As String, wdDoc) in yellow, but the .Find is highlighted in blue.

    Thanks for any and all help.

  2. #2
    Registered User
    Join Date
    06-12-2013
    Location
    USA
    MS-Off Ver
    excel 2007
    Posts
    9

    Re: Search and Replace Footer in word with excel macro?

    The following code works to search and replace the body of the word file, but not the footer:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    06-12-2013
    Location
    USA
    MS-Off Ver
    excel 2007
    Posts
    9

    Re: Search and Replace Footer in word with excel macro?

    Is my problem too hard, or not interesting enough?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Excel macro- Find replace an itallic font word with a regular word?
    By thisisaboutwork in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-08-2013, 01:48 PM
  2. Need help with Excel-to-Word find and replace macro based on word filename
    By EnterTheSerpent in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-16-2013, 12:48 PM
  3. Macro to copy the Footer from a Word document into an Excel Sheet
    By junglist69 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-18-2012, 11:34 AM
  4. Search and Replace... from Excel to Word
    By Xx7 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-27-2011, 03:05 PM
  5. Replies: 5
    Last Post: 09-13-2005, 07:06 AM

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