Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-03-2018, 08:32 AM
Deferolles Deferolles is offline Find first character of a line Windows 10 Find first character of a line Office 2016
Novice
Find first character of a line
 
Join Date: Apr 2018
Location: France
Posts: 7
Deferolles is on a distinguished road
Default Find first character of a line


Hi,
Without a macro, is it possible to find if a given character stands at the beggining of a line and which line ?
Thanks
Reply With Quote
  #2  
Old 04-10-2018, 06:18 AM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline Find first character of a line Windows 10 Find first character of a line Office 2013
Moderator
 
Join Date: Aug 2011
Posts: 3,872
Stefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to all
Default

As far as I know, that is not possible.

I'm not even sure it can be done with a macro. If you had asked about the first character of a paragraph, that would be simple in VBA, though.
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional
Reply With Quote
  #3  
Old 04-10-2018, 03:53 PM
Guessed's Avatar
Guessed Guessed is offline Find first character of a line Windows 10 Find first character of a line Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

What is the purpose of such a requirement?

How would you use this information and how should it be presented to you if you didn't want it provided by a macro?
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #4  
Old 04-24-2018, 08:29 AM
Deferolles Deferolles is offline Find first character of a line Windows 10 Find first character of a line Office 2016
Novice
Find first character of a line
 
Join Date: Apr 2018
Location: France
Posts: 7
Deferolles is on a distinguished road
Default First character

Thanks for your responses.
The purpose of my question is to spot some characters wich stands at the begining
of lines. This lines come from a justified Word document and I want to correct them if
? : . " etc appears in first position.
I'll use any given macro but I did'nt find one.
Reply With Quote
  #5  
Old 04-24-2018, 11:23 AM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline Find first character of a line Windows 10 Find first character of a line Office 2013
Moderator
 
Join Date: Aug 2011
Posts: 3,872
Stefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to all
Default

If you are saying that punctuation marks may be preceded with a space, which would be required if they appear at the beginning of a text line, you could of course search for <space>? etc.
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional
Reply With Quote
  #6  
Old 04-24-2018, 04:12 PM
macropod's Avatar
macropod macropod is offline Find first character of a line Windows 7 64bit Find first character of a line Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by Deferolles View Post
The purpose of my question is to spot some characters which stands at the beginning of lines. This lines come from a justified Word document and I want to correct them if ? : . " etc appears in first position.
I'll use any given macro but I did'nt find one.
In a properly punctuated document, that won't happen. Such formatting indicates the presence of a space before the punctuation mark and, quite possibly, is associated with the lack of a space after it. This can all be cleaned up through Find/Replace; it really has nothing to do with line starts/ends.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 04-25-2018, 02:07 AM
Deferolles Deferolles is offline Find first character of a line Windows 10 Find first character of a line Office 2016
Novice
Find first character of a line
 
Join Date: Apr 2018
Location: France
Posts: 7
Deferolles is on a distinguished road
Default First character

Hello,
This is not due to punctuation, but to justification. The text is in French and here is an example of the justification result.
...hommage, nous n'en voulons pas et vous portons comme partie responsable de ce qui nous arrive
! C'est plus tôt qu'il fallait agir ...
The explamation point ! begins a new line the previous one begins with hommage and ends with arrive instead of arrive !.
Many thanks.
Reply With Quote
  #8  
Old 04-25-2018, 02:56 AM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline Find first character of a line Windows 10 Find first character of a line Office 2013
Moderator
 
Join Date: Aug 2011
Posts: 3,872
Stefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to all
Default

I understand that a space is sometimes (always?) required with punctuation in French, but the space should then be a nonbreaking space so that punctuation marks can't end up at the beginning of a text line by themselves.

Was the text perhaps originally created in a program that can't manage nonbreaking spaces (such as a plain text editor)?

What you can do is replace a space character and a following punctuation mark with a nonbreaking space and the same punctuation mark, for example: ^s?
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional
Reply With Quote
  #9  
Old 04-25-2018, 05:37 AM
Deferolles Deferolles is offline Find first character of a line Windows 10 Find first character of a line Office 2016
Novice
Find first character of a line
 
Join Date: Apr 2018
Location: France
Posts: 7
Deferolles is on a distinguished road
Default First character

Thank you Stefan,

You're probably true. The rules for space in french typography are a little bit complicated, with many exceptions.
My exemple comes from an old text in fact a quote.
Reply With Quote
  #10  
Old 04-25-2018, 07:32 AM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline Find first character of a line Windows 10 Find first character of a line Office 2013
Moderator
 
Join Date: Aug 2011
Posts: 3,872
Stefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to all
Default

Quote:
Thank you Stefan,

You're probably true. The rules for space in french typography are a little bit complicated, with many exceptions.
My exemple comes from an old text in fact a quote.
Just to be very clear: I don't pretend to know the rules for French typography. :-)

My experience is based on an observation of what happens when I apply French language formatting to text and then insert quotation marks. AutoCorrect will change the marks to guillemets and add nonbreaking spaces.
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional
Reply With Quote
  #11  
Old 04-25-2018, 02:28 PM
macropod's Avatar
macropod macropod is offline Find first character of a line Windows 7 64bit Find first character of a line Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Your document could be cleaned up with a sequence of wildcard Find/Replace operations:

Find = ([ ^s]{1,})([.,»\!\?\:\;\)\}\]\>]{1,})
Replace = \2\1

Find = ([«\(\{\[\<]{1,})([ ^s]{1,})
Replace = \2\1

Find = ([ ^s]){1,}
Replace = \1

Find = [ ^s]([^13^l])
Replace = \1

If you're using a system with non-English regional language settings, you will need to change the {,} expressions to {;}.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #12  
Old 04-26-2018, 12:18 AM
Deferolles Deferolles is offline Find first character of a line Windows 10 Find first character of a line Office 2016
Novice
Find first character of a line
 
Join Date: Apr 2018
Location: France
Posts: 7
Deferolles is on a distinguished road
Default

Thanks to Stefan and Paul. I'll try Paul's suggestion, if I'm able to understand the exact syntax of Find and Replace commands.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find first character of a line How to bold a whole line in Word based on a word or character on the line Yancx Word 6 03-21-2018 04:48 PM
Find first character of a line Delete Character on Single Line Only Tye30 Word VBA 8 04-20-2017 08:40 PM
Find first character of a line Every page indents first line one character glennhardy Word 6 02-05-2016 04:05 PM
Find first character of a line Use character instead of line for table border dlowrey Word Tables 6 03-09-2015 11:29 AM
Find first character of a line Find max number of same subsequent character NobodysPerfect Word VBA 9 05-25-2014 01:10 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:48 PM.


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