How to use the Find Object in Word VBA

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 ธ.ค. 2024

ความคิดเห็น • 20

  • @wernerd1432
    @wernerd1432 ปีที่แล้ว

    Great Video,
    12:09 into the video and I got exactly what I wanted help me so much and saved so much time.
    after spending a week searching online for something similar.
    Great explanation as well.

  • @NatalieLawrence
    @NatalieLawrence 4 ปีที่แล้ว

    Thank you for this video! VBA Find has been driving me crazy, so I'm glad to have found this :)

  • @michalroesler
    @michalroesler 4 ปีที่แล้ว +2

    In the "simple" example in the line " 'Define the Find Object based on the range " Set wrdFind = wrdRng.Find ;
    I get Compile Error, Argument not optional.
    What does it mean?

  • @sulthanas4267
    @sulthanas4267 3 ปีที่แล้ว

    really nice tutorial and thank you so much

  • @tayloratkins6269
    @tayloratkins6269 3 ปีที่แล้ว

    Nicely explained - thank you!

  • @arquivoxjk
    @arquivoxjk 4 ปีที่แล้ว

    Congratulations. I really enjoyed your video. !!!

  • @maxine2798
    @maxine2798 3 ปีที่แล้ว

    Great video and a good presenting style. In the complex example you declare - Dim wordSearhcList as variant and the script still worked. I dont mind how but why if it has a spelling mistake that isn't replicated in the rest of the code?

  • @freda.g.3104
    @freda.g.3104 4 ปีที่แล้ว +1

    I have been playing around with the find object but somehow when looking up all instances of a specific style (for example heading 7) in a document the loob gets stuck when the style is placed in a content control. What is going on there ? Text searches seem to work flawlessly in that case. Nice content

    • @SigmaCoding
      @SigmaCoding  4 ปีที่แล้ว

      I'd have to look at the code specifically to see what's going on. My guess is that content control is causing it to error out, my suggestion is to skip over those objects in your loop.

  • @franckmongo3783
    @franckmongo3783 4 ปีที่แล้ว

    Thanks so much. I enjoyed the video.

    • @SigmaCoding
      @SigmaCoding  4 ปีที่แล้ว

      Glad you enjoyed it!

  • @aqdef2371
    @aqdef2371 4 ปีที่แล้ว

    First of all, thanks a lot, It really helped.
    Secondly, I have a request. Would you mind telling me How can I select all the parapraphs in a document containing a given word?
    For example, How can I select all the paragraph containing the word "References" ?

  • @kcvinu
    @kcvinu 3 ปีที่แล้ว

    ‌Thanks for the video. How to use regular expressions on a find object ?

  • @mahtisham9418
    @mahtisham9418 4 ปีที่แล้ว

    Can you please tell how we can find all the headings 1 from the document and edit them.?

  • @rafaelrivera9291
    @rafaelrivera9291 2 ปีที่แล้ว

    Im trying to use the find methods to search in a word the values in one table in excel for the values in another table in excel. But is not going inside a table that is in the word. How can I fix this?

  • @srideviv8335
    @srideviv8335 3 ปีที่แล้ว

    Can you please tell, How to find the particular section and delete that section?

  • @muthuperumalkonar4874
    @muthuperumalkonar4874 3 ปีที่แล้ว

    Hi,
    I have 1000 pages in word document
    In that 1st page has two highlighted word in two different places
    And I want to highlight rest 999 page at exact the same location ...
    Can you please share the VBA code for that

  • @JohnnyDowntheTubes
    @JohnnyDowntheTubes 3 ปีที่แล้ว

    I ran your code in word 365 enterprise and the simple one worked but then I went to the intermediate one and it won't change the color

  • @hanksgavin
    @hanksgavin ปีที่แล้ว

    I think it's funny you ignored the one thing I wanted to know. Moving the range to the next word instead of resetting it. But still interesting.

    • @hanksgavin
      @hanksgavin ปีที่แล้ว

      So if you want your next search to pick up where the last one left off don't set a user defined range. Use the find property of the document instead and reference the parent object. The example code below will find the next result in the document every time it is run.
      With ActiveDocument.Content.Find
      .Text = "blue"
      .Forward = True
      .Execute
      If .Found = True Then .Parent.Bold = True
      End With