Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 01-27-2022, 02:55 PM
Guessed's Avatar
Guessed Guessed is online now Copying two similar listed reference tables in the same document Windows 10 Copying two similar listed reference tables in the same document Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
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

Cross references of any kind actually do use hidden bookmarks which can only occur once in a document. But the basic setup for having language-specific content is not that complicated. Attached is a file showing how I set up a sample with content controls tagged with a language-specific code along with a macro that allows the user to select which language should be shown.
Code:
Sub LocaliseMe()
  Dim aCC As ContentControl, sLang As String
  sLang = InputBox("What language should be displayed? Your choices are: EN, DE, All", _
          "Choose Language Code", "All")
  
  For Each aCC In ActiveDocument.ContentControls
    Select Case sLang
      Case aCC.Tag
        aCC.Range.Font.Hidden = False
      Case "All"
        aCC.Range.Font.Hidden = False
      Case Else
        aCC.Range.Font.Hidden = True
    End Select
  Next aCC
  
  'set options to make ensure hidden text is not displayed on screen
  ActiveWindow.View.ShowAll = False
  ActiveWindow.View.ShowHiddenText = False
End Sub
Attached Files
File Type: docm SingleSource_LanguageExample.docm (33.6 KB, 7 views)
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to redact words listed in one document from the current document AlanofBayCourt Word VBA 0 10-31-2019 03:00 AM
Revise tables in a word document based on a reference table in excel modiria50989 Word VBA 1 08-29-2017 03:07 PM
Copying two similar listed reference tables in the same document Copying Multiple tables from excel into a single word document dineshtgs Word Tables 1 04-07-2011 01:27 AM
Copying tables to MS Word 123 Word Tables 1 03-02-2011 11:25 AM
Copying format between tables. daeron Word Tables 0 06-11-2010 12:09 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:29 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft