Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-27-2024, 08:49 AM
gmaxey gmaxey is offline How to determine the end of a block of text Windows 10 How to determine the end of a block of text Office 2019
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,601
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Demo below is Microsoft example of the "Found" property. DemoII below is my code which to me proves that "Found" is utterly useless:




Code:
Sub Demo()
  With Selection.Find
   .ClearFormatting
   .Font.Bold = True
   .Execute FindText:="Hello", Format:=True, Forward:=True
   If .Found = True Then
    .Parent.Expand Unit:=wdParagraph
    .Parent.Copy
   End If
End With
End Sub
Sub DemoII()
  With Selection.Find
    .ClearFormatting
    .Font.Bold = True
    If .Execute(FindText:="Hello", Format:=True, Forward:=True) Then
      .Parent.Expand Unit:=wdParagraph
      .Parent.Copy
    End If
  End With
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Building Block Text into a variable tonse Word VBA 1 11-16-2023 06:10 AM
how to create a block text and when click on the title of block hide and unhide the block labasritas@free.fr Word 4 09-17-2017 01:17 PM
What is this block of text? nyempire Word 5 05-26-2016 06:08 AM
how to make building block content control determine bb to display elsewhere jamles12 Word VBA 5 11-16-2013 11:38 AM
Anyway to determine time/date of text creation? pureride Word 1 01-05-2010 02:09 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:48 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft