#1
|
|||
|
|||
Why comma and percentage sign sticks out on the right
Hi everyone,
I have a silly question but really strange. Basically, the comma, and percentage sign % stick out on the right, without aligning properly. I cannot find a way to solve it. So I have to find some help here. Many thanks |
#2
|
||||
|
||||
That is an interesting question. My first thought is that it is due to the font metrics of the typeface you had chosen. Some fonts don't appear to have the same problem but some do.
A second possibility is the type of justification being applied. Using the GUI, you can have one type of text justification but if you play with the VBA code there are actually a whole range of justification commands that could be applied to the text. There must be a complex set of rules applied that look at the length of words in the line to determine wrapping points and this appears to impact the right border alignment. Some of these options do give you an aligned right justification of those characters but it may depend on the content of the line itself. You would need to do more testing though as we only have a single paragraph to test in that example you posted. Code:
Sub aTest() ActiveDocument.Range.ParagraphFormat.Alignment = wdAlignParagraphJustify ActiveDocument.Range.ParagraphFormat.Alignment = wdAlignParagraphJustifyHi ActiveDocument.Range.ParagraphFormat.Alignment = wdAlignParagraphJustifyMed ActiveDocument.Range.ParagraphFormat.Alignment = wdAlignParagraphJustifyLow ActiveDocument.Range.ParagraphFormat.Alignment = wdAlignParagraphDistribute ActiveDocument.Range.ParagraphFormat.Alignment = wdAlignParagraphThaiJustify End Sub You might want to do some google searching on these VBA alignment options. Perhaps it is documented somewhere what the different options actually do to your text.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#3
|
|||
|
|||
Many thanks, Andrew. The font is very basic: Times New Roman.
So is there any simple option to correct that? |
#4
|
|||
|
|||
Try the Justify High setting.
I cannot explain it. |
#5
|
||||
|
||||
Adding a new paragraph to the document (by pressing Enter) and then copying the content, except for the new paragraph, into a new, blank document works around the issue, so there is clearly something about the formatting in the original document.
__________________
Stefan Blom Microsoft Word MVP Microsoft 365 apps for business Windows 11 Professional |
#6
|
|||
|
|||
Hi, can you tell me how to find the 'Justify High' setting? It seems that this option is not available in Word. Only one single option 'Justify'
|
#7
|
|||
|
|||
Hi, if you try to copy this paragraph into a new document, the problem is still there. Even if you copy it to a notepad and then copy it again to Word, the problem is there.
|
#8
|
|||
|
|||
I managed to find the 'Justify Low', etc. buttons to give me extra options. Thank you everyone for the great advice. It is really helpful and solved my problem!
|
#9
|
|||
|
|||
In your original document, if I go into the custom Margins dialog and do not change anything but click on OK to exit, the anomaly disappears. (The line lengths change as well.)
Last edited by Charles Kenyon; 11-27-2020 at 07:33 AM. |
#10
|
||||
|
||||
I think there will be variable experiences with this issue. The line lengths will vary with printer drivers for instance. Then you can do things on the second last line such as delete 'the' or 'of' to get the 6.4% to fall at the end of the line. In one case it sits out and the other it aligns
I really have no idea how the justification is calculated but it appears to squeeze content that almost fits as well as stretching content that is a little short. Perhaps when it is squeezes a line these outriders happen but they don't if the line requires expansion. The Justify Low setting 'appears' to work in this paragraph but I would want to see a large number of instances and vary margin sizes, typefaces and font sizes before I would be fully confident in saying that is the solution.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#11
|
||||
|
||||
Quote:
That suggests that the problem exists in the Normal template as well. Have you ever had any settings for Asian languages enabled in Word/Office?
__________________
Stefan Blom Microsoft Word MVP Microsoft 365 apps for business Windows 11 Professional |
#12
|
||||
|
||||
Stefan
I think this is highly dependent on page setups and style definitions and if the new blank document is slightly different then the line wraps could be completely different and you might or might not see the same issue. I can confirm that on my machine, although I've never had Asian languages enabled, I do see different spacing and line wrapping by stepping through the justify options.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#13
|
||||
|
||||
Andrew,
I haven't experimented with the various justification options (yet). So far, I have only drawn the conclusion that if copying to a new, blank document (excluding the final paragraph mark of the source document) does not help, the undesired setting must be defined in the Normal template as well.
__________________
Stefan Blom Microsoft Word MVP Microsoft 365 apps for business Windows 11 Professional |
#14
|
|||
|
|||
Quote:
|
#15
|
|||
|
|||
One additional thought is that this document originated somewhere other than in Word.
|
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
usage of $ sign | msnarayanan | Excel | 1 | 12-14-2019 02:31 AM |
Word sticks on shutdown | kenrob | Word | 2 | 07-02-2018 09:59 PM |
Add a comma | mbesspiata | Excel | 7 | 06-09-2014 03:36 AM |
How to sign out from the outlook? | Jamal NUMAN | Outlook | 0 | 11-21-2010 07:28 PM |
thousands comma separator | taylormayd | Excel | 3 | 02-20-2009 03:46 AM |