Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. Bruce18W

    Advanced delete macro for Word

    Nice. [bigsmile] Thanks a lot. Bruce
  2. Bruce18W

    Advanced delete macro for Word

    Paul, I tried the macro and it works when there is a pattern match. When there is no pattern match, it seems to get stuck in the while loop. I suppose one could add a counter in the loop and exit it after a certain number of attempts. Do you know of an easier way to abort the process when there...
  3. Bruce18W

    Advanced delete macro for Word

    Thanks, Paul. I'll give it a try. Nice technique. Bruce
  4. Bruce18W

    Advanced delete macro for Word

    thanks, Skip. I tried the code icon, but it didn't change the text. Thanks for the telling me about code [bigsmile]Bruce
  5. Bruce18W

    Advanced delete macro for Word

    Thanks, MakeItSo. I worked on my own code (before seeing yours) and came up with this: Sub KillContent() Dim StartRan As Long, EndRan As Long, TargetStr As String TargetStr = InputBox("Text to find", "Content Killer") StartRan = Selection.End With Selection.Find .Forward = True...
  6. Bruce18W

    Advanced delete macro for Word

    thanks for the code tips. I'll work on it. As for my example, I'll try again: Original text: Systems Thinking provides a disciplined way Cursor location: beginning of line String I entered: di What should be deleted: "Systems Thinking provides a" Desired result: way What is deleted: "Systems...
  7. Bruce18W

    Advanced delete macro for Word

    Paul, thanks for the suggestion. It works, but it finds only a character, not a pattern. Original text: Systems Thinking provides a disciplined way String I entered: di Cursor location: beginning of text Desired result: Systems Thinking provides a way Actual result: inking provides a way...
  8. Bruce18W

    Advanced delete macro for Word

    Skip, I thought I included an example of text in my original query. In any case. here's another example. Original sentence: A boy walks down the road and falls. Cursor location: At the highlight, just after "boy" Search string: fa Text to be deleted: walks down the road and Final sentence: A...
  9. Bruce18W

    Advanced delete macro for Word

    Sorry if my request seemed presumptuous. This is what I have so far. Sub DeleteNWords() Dim WordsToDelete As String WordsToDelete = InputBox("How many words to cut?") Selection.MoveRight Unit:=wdWord, Count:=Val(WordsToDelete), Extend:=wdExtend Selection.Cut End Sub So the key is...
  10. Bruce18W

    Advanced delete macro for Word

    Hi, I'm looking for a macro that will delete (or cut/copy) text from the cursor location to the nearest match of a pattern that the macro requests. For example, if the cursor is just after the "r" in "for" in the previous sentence, and I entered "cu" as the pattern, the macro should change...
  11. Bruce18W

    Recorded macro won't run in Word 2010

    Thanks for the reminder! Bruce
  12. Bruce18W

    Recorded macro won't run in Word 2010

    Paul, Thanks for the suggestions. I rebooted computer (error still appeared) and repaired Office (error still appeared). I have a similar function that inserts heading references, and that works fine. I once again created a macro by recording the keystrokes that insert a figure cross reference...
  13. Bruce18W

    Recorded macro won't run in Word 2010

    Thanks for your post. In my original post, I stated that this is a recorded macro, that is, I used Word to record this macro while I inserted a reference to a figure. When I recorded this macro, Word did indeed insert a reference to a figure. I do not think the code is the problem. Rather...
  14. Bruce18W

    Recorded macro won't run in Word 2010

    Paul, Thanks for the tip. There is indeed a Figure 1 caption in the document. I recorded the macro as I was creating the cross reference to Figure 1. When I then tried to run the macro, I received the error. Do you have any other ideas? Bruce
  15. Bruce18W

    Recorded macro won't run in Word 2010

    Hi, I recorded this macro in Word 2010 (intending to later modify it). Note, when I recorded the macro, Word inserted a figure reference, which is what I wanted it to do. Sub Macro3() Selection.InsertCrossReference ReferenceType:="Figure", ReferenceKind:= _ wdOnlyLabelAndNumber...
  16. Bruce18W

    Histogram for words in a MS Word

    Thanks for the suggestion, combo. I'll keep it in mind for future needs. Bruce
  17. Bruce18W

    Histogram for words in a MS Word

    Paul, Could you possibly/please spend a few minutes adding some comments to the code? I think I'd learn a lot by understanding it better, and some comments along the way would help. I ran it on a short sentence, hoping that I'd understand it. I do, sort of. But some comments would, I'm sure...
  18. Bruce18W

    Histogram for words in a MS Word

    This is fantastic! Thanks so much. I just ran it on a manuscript and immediately got some insight into word usage, as in, "wow, did I really use that word 53 times?" Thanks again, Bruce
  19. Bruce18W

    Histogram for words in a MS Word

    Thanks, Skip. Good suggestion. Bruce
  20. Bruce18W

    Histogram for words in a MS Word

    Hi, Does anyone have code for counting the number of occurrences of each word in an MS Word document? Example: the code run on a very short document containing only "the boy ran to the home" would produce the 2 boy 1 ran 1 etc. thanks, Bruce

Part and Inventory Search

Back
Top