Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 01-11-2022, 05:46 AM
Bikram Bikram is offline Conditional_Replacing Windows 10 Conditional_Replacing Office 2007
Advanced Beginner
Conditional_Replacing
 
Join Date: Jul 2021
Location: Nepal
Posts: 97
Bikram is on a distinguished road
Default

Thanks for the reply sir. And also sorry if I had failed to make you understand my situation. I have to work on word documents where I encounter these types of conditions:
I use to select the words till ":" by looping through every paragraph and using following code
Code:
    With Selection
        .MoveLeft Unit:=wdWord, Count:=1
        .MoveRight Unit:=wdWord, Count:=3
        .StartIsActive = False
        .Extend Character:=":"
    If Selection.Range.Bold = True Then
        TrueTitleCase
    End If
        .Collapse
    End With
a. say's law in the barter economy: In barter economy, goods are produced either
b. it say's law in money economy: In the money economy, products are sold
c. if say's law in money economy: In the money economy, products are sold
d. the say's law in money economy: In the money economy, products are
e. on say's law in money economy: In the money economy, products are
f. a say's law in money economy: In the money economy, products are sold sold

This is just the sample text what happens here, the code changes all the selection word to wdtitle case. Everything is fine till here now I just want to ignore the first word of the selection (For example If ("The","If","On") etc. If Vfindtext(i) is in the first word of the sentence then ignore it. If it is in other places (except the first word of selection) Then replace it like:
a. Say's Law in the Barter Economy: In barter economy, goods are produced either
b. It Say's Law in Money Economy: In the money economy, products are sold
c. If Say's Law in Money Economy: In the money economy, products are sold
d. The Say's Law in Money Economy: In the money economy, products are
e. On Say's Law in Money Economy: In the money economy, products are
f. A Say's Law in Money Economy: In the money economy, products are sold
Thank you for your help.
Reply With Quote
 



Other Forums: Access Forums

All times are GMT -7. The time now is 04:25 PM.


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