Google Answers Logo
View Question
 
Q: Stopping at the last row in a table ( No Answer,   1 Comment )
Question  
Subject: Stopping at the last row in a table
Category: Computers > Software
Asked by: brianhh-ga
List Price: $5.00
Posted: 23 Apr 2005 12:56 PDT
Expires: 24 Apr 2005 12:42 PDT
Question ID: 513171
I'm trying to write a macro in Word 2000 that goes through every row
in a table and does a search for text, then edits the hyperlink
associated with that text.  The problem is that I can't stop at the
end of the table.  Anything I try, it either wraps, and starts all
over again, infinite-looping, or else it runs off the end of the table
and causes an error when it hits the text outside the table.

Request for Question Clarification by pafalafa-ga on 23 Apr 2005 13:42 PDT
Is it possible to copy just the table to a separate file and run the
macro there?  Sometimes, that's just easier than trying to figure out
how to finesse the macro code.

What do you think?


pafalafa-ga

Clarification of Question by brianhh-ga on 23 Apr 2005 15:18 PDT
Hi, Everyone.

The documents I'm working with have the tables at the top of the
document.  Cutting out the table and pasting it into a blank document
doesn't seem to help matters. It loops infinitely and I have to close
Word (2000) to get it to stop.

Any help you can give me would be well appreciated.  See code below:


======================================================

Sub AdisChange()
'
' AdisChange Macro
' Macro recorded 4/21/2005 by Brian Hartman
'
while CurrentRow < Selection.Information(wdMaximumNumberOfRows) 
'MsgBox (Selection.Information(wdMaximumNumberOfRows))
'MsgBox (Selection.Information(wdStartOfRangeRowNumber))
    Selection.Find.ClearFormatting
    With Selection.Find
        .Text = "Adis"
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = True
        .MatchWholeWord = True
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute
    Selection.Find.ClearFormatting
    With Selection.Find
        .Text = "Link"
        .Replacement.Text = ""
        .Forward = True
        .Format = False
        .MatchCase = True
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute
    Selection.Range.Hyperlinks(1).Range.Fields(1).Result.Select
    Selection.Range.Hyperlinks(1).Delete
    ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, Address:= _
        "http://bi.adisinsight.com/remoteDocumentView.asp?adisnumber=800002227&productid=RDI&mode=charting&PushValidation=95683"
_
        , SubAddress:="", ScreenTip:="", TextToDisplay:= _
        "Link to Full R&D Insight Record"
    Selection.Collapse Direction:=wdCollapseEnd
Wend
End Sub

===================================================
Answer  
There is no answer at this time.

Comments  
Subject: Re: Stopping at the last row in a table
From: pmmbala1976-ga on 23 Apr 2005 13:02 PDT
 
Hi

If possible post the code.

Thanks
Balakumar

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy