View Single Post
 
Old 05-30-2023, 05:01 AM
mordyas mordyas is offline Windows 10 Office 2016
Novice
 
Join Date: May 2023
Posts: 1
mordyas is on a distinguished road
Default

Hi
Try this. It worked for me' in Hebrew version.
===================
Sub A_A_OPEN_WORD()
'
' Sub A_A_OPEN_WORD
'
'
Selection.Collapse Direction:=wdCollapseEnd
Selection.MoveUp Unit:=wdParagraph, Count:=1, Extend:=wdExtend
Selection.HomeKey Unit:=wdLine
Selection.MoveRight Unit:=wdWord, Count:=1, Extend:=wdExtend
Selection.Copy
Selection.HomeKey Unit:=wdLine
With Selection.Paragraphs(1).dropCap
.position = wdDropNormal
.fontName = "Ezra SIL SR dec2"
.LinesToDrop = 2
.DistanceFromText = 12
'
End With
Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.PasteAndFormat (wdFormatOriginalFormatting)
Selection.font.SizeBi = 30
With Selection.font
.Spacing = 0
.Scaling = 100
.position = 6
.Kerning = 0
.SizeBi = 30
.NameBi = "Ezra SIL SR dec2"
.BoldBi = False
.ItalicBi = False
End With
With Selection
.Collapse Direction:=wdCollapseStart
.CopyFormat
.Next(Unit:=wdWord, Count:=-1).Select
.PasteFormat
End With
'
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.MoveUp Unit:=wdParagraph, Count:=1, Extend:=wdExtend
Selection.HomeKey Unit:=wdLine
Selection.MoveRight Unit:=wdWord, Count:=1, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1


End Sub
===================
I'm no "expert" at writing code, but somehow I managed to put this thing together - and it works together.
The code goes to the first word in the paragraph, copies it, and builds a "DropCap" from it.
Then he adds the design (DropCap design, paragraph and font) and finally adds the first word that has already been copied to DropCap.
Says again:
I'm not an expert. It works for me.
At your place - at your own risk...
Reply With Quote