Results 1 to 10 of 10
  1. #1
    New Lounger
    Join Date
    Dec 2010
    Location
    LA
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,

    Here is the strange problem that I face with Word 2010.

    I use a macro to find a standard text. The macro works fine in the main document as well as in the footnotes - but,

    when I perform a normal search (Ctrl+F) in the footnotes, and then go to any of the search results, and then run my macro, the Word finds and highlights the text that my macro searches for, it changes the size of the footnotes pane (!), and then it crashes!

    Any idea on why that happens? And why only after I perform a normal find (Ctrl+F)?

  2. #2
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    Do we get any hints by looking at the line of code which causes your machine to crash?
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  3. #3
    New Lounger
    Join Date
    Dec 2010
    Location
    LA
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It's a very simple macro, working as expected in all other cases, except after the regular Word Find in the footnotes.

    Selection.Find.ClearFormatting
    With Selection.Find
    .Text = "*******************"
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindContinue
    .Format = False
    .MatchCase = False
    .MatchWholeWord = False
    .MatchWildcards = False
    .MatchSoundsLike = False
    .MatchAllWordForms = False
    End With
    Selection.Find.Execute

  4. #4
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts
    When I try running this code as described, nothing happens (although I'm testing in Word 2007; not sure if that would make a difference).

    Another way to approach this would be as follows (although this will lose any direct formatting you may have applied to any footnote text):

    Code:
    Sub FixFNText()
       Dim FN As Footnote
       For Each FN In ActiveDocument.Footnotes
          FN.Range.Text = Replace(FN.Range.Text, "*******************", "")
       Next 'FN
    End Sub
    Gary

  5. #5
    New Lounger
    Join Date
    Dec 2010
    Location
    LA
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm not using this to replace anything, nor in the footnotes in particular. It is just a search for a bookmark, which I use at the main text or at the footnotes in order to go to a specific location in a document I was working before. Unfortunately, everything everywhere works fine, unless I use before the Ctrf+F command *and* I am in the footnotes.

  6. #6
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts
    Oh, OK.
    Still not sure why you're doing a manual Find and then following that with a macro that does a Find, but in any case I just tried your steps again, this time in Word 2010, and it works fine as far as finding and selecting the "*********" in the footnote. Nothing untowards happens with regard to the footnote pane nor with Word crashing.

    What if, instead of using a text string as a bookmark, you use an actual bookmark instead? That way, you could just GoTo the bookmark.

    Gary

  7. #7
    New Lounger
    Join Date
    Dec 2010
    Location
    LA
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Perhaps there is a problem with my installation of Word, but your suggestion was great, because the GoTo way works (for the moment...). Thanks a lot!

  8. #8
    New Lounger
    Join Date
    Dec 2010
    Location
    LA
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    May I ask one more question? The only way of repairing a problematical installation, would be to uninstall and reinstall Word?

  9. #9
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts
    I don't have much know-how with respect to repairing Word 2010, but as a starting point, are you seeing other problems with Word 2010 besides the one caused by the macro here? - if this is the only problem, it might not necessarily point to a serious problem that needs to be fixed.

    Gary

  10. #10
    New Lounger
    Join Date
    Dec 2010
    Location
    LA
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Everything works fine, except for this strange problem. I tried the Repair option in the Control Panel (selecting to "Change" instead of "Uninstall", and then "Repair"). This needed some time to complete, and after restarting the system I tried again Word and the problem above still remains!

Posting Permissions

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