Log in

View Full Version : [SLEEPER:] Font properties



Fonsi
03-29-2019, 04:05 AM
Hi All,

I´m looking for a macro to change all content in Latin text to Complex script.


This is very time consuming if we change it from the Font options. So basically, fonts and formats such as bold, italic or font size should remains as is. Just need the whole content is changed to Complex script.


Is this feasible?

Thanks!

macropod
03-31-2019, 11:58 PM
Cross-posted at: http://www.msofficeforums.com/word-vba/42110-macro-change-latin-text-complex-script.html
Please read VBA Express' policy on Cross-Posting in Rule 3: http://www.vbaexpress.com/forum/faq.php?faq=new_faq_item#faq_new_faq_item3

Wylsacom
04-20-2021, 02:47 AM
Have you googled this? There are many free online platforms that do this.

macropod
04-20-2021, 02:54 AM
There are many free online platforms that do this.
Be that as it may, the OP clearly said:

I´m looking for a macro to change all content in Latin text to Complex script.
Kindly don't resurrect old threads (this one was last active more than two years ago) just to post advice that doesn't address the OP's needs.

Aussiebear
02-22-2025, 02:32 AM
Perhaps try this:



Sub ConvertLatinToComplex()
Dim rng As Range
Dim i As Long
Dim charCode As Integer
Set rng = ActiveDocument.Content
' Loop through each character in the document
For i = rng.Characters.Count To 1 Step -1
' Loop backwards to avoid index issues after changes
charCode = AscW(rng.Characters(i).Text)
' Check if the character is within the Latin Unicode range (Basic Latin and Latin-1 Supplement)
If (charCode >= 32 And charCode <= 255) Then
' Basic Latin and Latin-1 Supplement
' Check if the character is not a control character.
If (charCode >= 32) Then
' Convert character to complex script. This forces Word to re-evaluate the character
' and treat it as complex if applicable.
rng.Characters(i).Text = ChrW(charCode) & ChrW(8206)
' Add Left-to-Right Mark
rng.Characters(i).Characters(1).Delete
' Delete the added Left-to-Right Mark
End If
End If
Next i
Set rng = Nothing
End Sub