Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #16  
Old 02-19-2024, 08:34 PM
RRB's Avatar
RRB RRB is offline Last line of paragraph centered Windows 11 Last line of paragraph centered Office 2021
Susan Flamingo
Last line of paragraph centered
 
Join Date: May 2014
Location: The Holy City of Jerusalem
Posts: 263
RRB is on a distinguished road
Default

Seeing how successful you are, I am going to try my lucky string with another issue that is almost universal in Hebrew literature:

The first word of a paragraph is usually in larger font and bold. No problem: apply the appropriate char style. But here is the string attached: The second line of the paragraph has an indent that exactly corresponds to the beginning of the second word in the first line. Like a little "window" under the first word (of the first line). This was probably born out of a drop cap but we need it without the "drop", Manually is easy to do this but automating it and allowing future editing has been almost possible. So it looks like this: (justified to both sides)

hfdjkashfkfdffdfd djfdkljfklasjdf fjdkfjkdf jfd j jkd kfj jdf kfjdjj
[WINDOW HERE] dfhjfkdhf sj hfjdhf jdhfjdf hdjsfh djshf hj hjf
hfdjk fsdjkf dskhf fhdj fdjfh djsfh djsfh djfh djfhdjs fhd

Any creative ideas?

Thank you and have a good day!

Susan Flamingo
Reply With Quote
  #17  
Old 02-19-2024, 10:18 PM
Guessed's Avatar
Guessed Guessed is offline Last line of paragraph centered Windows 10 Last line of paragraph centered Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
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

I wouldn't go so far as to say it is an elegant solution but it is certainly more elegant than the dodgy soft return + shim method.

Two other things factors I will throw in to complete my contribution to this topic in case other people are interested.

A. The 'centering' of method 1 above is not EXACTLY centered since the width of the tab is included in the centering of that last line. In effect, the offset of the text from 'true centre' is half the size of the tab - likely only a true pedant will notice this offset. The size of that tab space depends on how close the last line length is to the next default tab stop. You can reduce the size of the default tab stops in your Word document to minimize this relatively minor offset. Note however that if your paragraph happens to ALSO have a tab stop assigned on the ruler then this alignment kludge method may be badly affected.

B. There are more than the 4 possible paragraph alignments (shown on ribbon) in my English version of VBA which is why I provided the VBA code to specify the alignment. It is entirely possible that other language versions of Word have a paragraph alignment which actually deal with your preferred Hebrew alignment. If you explore the VBA intellisense on your language-enabled machine, you may discover a paragraph alignment which does this without the kludge of requiring a tab at the end of the paragraph to see the effect you want.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #18  
Old 02-19-2024, 10:32 PM
RRB's Avatar
RRB RRB is offline Last line of paragraph centered Windows 11 Last line of paragraph centered Office 2021
Susan Flamingo
Last line of paragraph centered
 
Join Date: May 2014
Location: The Holy City of Jerusalem
Posts: 263
RRB is on a distinguished road
Default

>>You can reduce the size of the default tab stops in your Word document to minimize this relatively minor offset.
Reduced default tab stop to 0.01 cm and it is not dercernable to the naked eye.

>>It is entirely possible that other language versions of Word have a paragraph alignment which actually deal with your preferred Hebrew alignment.

Being that thousands of Word users in Hebrew have been struggling with this for close to 30 years I think it is safe to say that such a built-in function does not exist. But maybe it is being hidden somewhere?
Reply With Quote
  #19  
Old 02-19-2024, 10:53 PM
Guessed's Avatar
Guessed Guessed is offline Last line of paragraph centered Windows 10 Last line of paragraph centered Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
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

To address your drop cap question, I had a fiddle with a macro that might be able to lead to another kludge fix approach. Try this on some selected paragraphs and let us know what the result looks like.
Code:
Sub DropCapMeHebrew()
  Dim aFrame As Frame, aPara As Paragraph, aWord As Range
  For Each aPara In Selection.Range.Paragraphs
    If aPara.Range.Frames.Count = 0 Then
      Set aWord = aPara.Range.Words(1)
      Set aFrame = ActiveDocument.Frames.Add(Range:=aWord)
      aFrame.Borders.OutsideLineStyle = wdLineStyleNone
      aFrame.HorizontalDistanceFromText = 2
    End If
  Next aPara
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #20  
Old 02-19-2024, 11:06 PM
RRB's Avatar
RRB RRB is offline Last line of paragraph centered Windows 11 Last line of paragraph centered Office 2021
Susan Flamingo
Last line of paragraph centered
 
Join Date: May 2014
Location: The Holy City of Jerusalem
Posts: 263
RRB is on a distinguished road
Default

Why do I have this strange feeling that you really want to help? Maybe because you do Very appreciative

As you can see in the attached the size of the "window" is perfect. Bu the first word is a little sunken into the window. Why is that?
Attached Images
File Type: jpg Screenshot_217.jpg (296.2 KB, 5 views)
Reply With Quote
  #21  
Old 02-19-2024, 11:37 PM
Guessed's Avatar
Guessed Guessed is offline Last line of paragraph centered Windows 10 Last line of paragraph centered Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
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

On my machine I tested it with consistently sized text (first word same as rest of paragraph). Since your document has a differently sized first word you are getting an offset. Therefore the code would need to be adapted to position the frame higher and the size of this offset will vary depending on the relative size difference of first/rest of paragraph.

This is my attempt to show what might work. I've included a line so it is easier to see where the frame is. That line could be disabled/removed once you have it working correctly. You may need to fiddle with parameters to get the offset that works for your specific sizes and typefaces.
Code:
Sub DropCapMeHebrew()
  Dim aFrame As Frame, aPara As Paragraph, aWord As Range, iOffset As Integer
  For Each aPara In Selection.Range.Paragraphs
    If aPara.Range.Frames.Count = 0 Then
      Set aWord = aPara.Range.Words.First
      iOffset = aWord.Font.Size - aPara.Range.Words.Last.Font.Size
      Set aFrame = ActiveDocument.Frames.Add(Range:=aWord)
      With aFrame
        .Borders.OutsideLineStyle = wdLineStyleNone
        .HorizontalDistanceFromText = 2
        .Shading.ForegroundPatternColor = wdColorAqua
        .RelativeVerticalPosition = wdRelativeVerticalPositionParagraph
        .VerticalPosition = .VerticalPosition - iOffset
      End With
    End If
  Next aPara
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #22  
Old 02-20-2024, 12:11 AM
RRB's Avatar
RRB RRB is offline Last line of paragraph centered Windows 11 Last line of paragraph centered Office 2021
Susan Flamingo
Last line of paragraph centered
 
Join Date: May 2014
Location: The Holy City of Jerusalem
Posts: 263
RRB is on a distinguished road
Default

Yes, this made the frame higher (A little too high) I guess I will have to play around with it.
thank you
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Centered line before and after a word Miguel Word 6 02-05-2023 09:02 AM
Last line of paragraph centered Hard Paragraph after Every Line jcolleenb Word 2 06-08-2020 03:50 PM
syntax for inserting blank line before inserting table and after a line or paragraph SamDsouza Word VBA 8 08-04-2019 11:10 PM
Last line of paragraph centered line separator for paragraph creieru Word 1 06-07-2012 11:11 AM
Last line of paragraph centered How can I make this line look like a paragraph? steeleye Excel 1 07-15-2009 02:13 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:53 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