![]() |
|
|
|
#1
|
||||
|
||||
|
OK, I see your sample has lots of section breaks and it appears that consistently your right column is content in a section that follows a column break. This pattern could break in a real document if a section continues to a new page but based on your sample, this code works to assign a different language to anything following a column break.
Code:
Sub SetLanguages()
Dim aSect As Section, aRng As Range, lngPos As Long
ActiveDocument.Range.LanguageID = wdGerman 'language for first column
For Each aSect In ActiveDocument.Sections
Set aRng = aSect.Range
lngPos = InStr(aRng.Text, Chr(14))
If lngPos > 0 Then
aRng.MoveStart Unit:=wdCharacter, Count:=lngPos
aRng.LanguageID = wdEnglishAUS 'language for second column
End If
Next aSect
End Sub
aRng.LanguageID = wdEnglishAUS to aRng.Style= "Normal"
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
#2
|
|||
|
|||
|
This is great, indeed! Thanks a lot!
I can now set the proofing for the majority of the paragraphs(those without section breaks) and use a quick find&replace to highlight&hide. For the rest of the parts(where proofing1 overlapped proofing2), will have to do some repair and a manual hide/unhide. |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to text heading1 text heading1 text? How to collapse or hide text in the middle of a line. | TImer | Word | 7 | 08-10-2020 12:52 AM |
Conditionally Color Formatting Text selected from a dropdown list in Word 2010
|
pgammag | Word | 9 | 08-20-2019 04:17 PM |
| Conditionally hide parts of a document | elaineAda | Word VBA | 0 | 04-01-2019 10:00 PM |
| Insert a text conditionally | deboer | Word | 1 | 05-04-2014 03:35 PM |
| Header must toggle text & color + show count of conditionally formatted cells below | Franktoon | Excel | 3 | 02-18-2014 02:10 PM |