Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-20-2018, 05:42 PM
Gilvv Gilvv is offline Windows 7 64bit Office 2010 64bit
Advanced Beginner
 
Join Date: Oct 2016
Posts: 30
Gilvv is on a distinguished road
Default Any efficient way to lock text that’s always written in a certain format?

I have hundreds of RTFs in which regular text is embedded within programing instructions. The programming texts are consistently written in gray font. These files are being sent for translation and we need to lock all of those programming texts.

I would greatly appreciate any advice on the best way to proceed.

Thank you!
Reply With Quote
  #2  
Old 11-20-2018, 07:15 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
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

Locking content methods in Word are only relevant if the translators are using Microsoft Word as the tool to do the translation.

If they are translation professionals, they are more likely to be using some other tool which is better suited to the task. The fact that you are asking about RTF files also implies that they aren't using Microsoft Word.

Perhaps you need to do some investigation on the tool they are using and find out what they suggest as a way to avoid requesting translations of specific styles.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 11-20-2018, 07:33 PM
Gilvv Gilvv is offline Windows 7 64bit Office 2010 64bit
Advanced Beginner
 
Join Date: Oct 2016
Posts: 30
Gilvv is on a distinguished road
Default

Thank you for your reply.

The files to be translated will be finally saved as, and handled in, Word format. Because of the translation memory that will be used, to get any matches with previous translations it is necessary to have those programming texts locked. That's essentially the problem, otherwise we could simply, for instance, change the gray programming text to hidden format but then we would loose essentially all of the otherwise 100% matches in the translation memory.
Reply With Quote
  #4  
Old 11-20-2018, 10:13 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
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

As I said, the files need to be in Word format and stay in Word format if you want to protect anything.

You can do some experiments with grouping content you want to lock by going to Developer>Group>Group. However I don't know whether that is supported if the file is saved in RTF. You might also put the content into a content control and change the properties of that CC to lock it. Again, i dont know whether this is preserved in RTF.

I suspect neither option is preserved in the Translation tool but it is worth a try.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #5  
Old 11-21-2018, 09:10 AM
Charles Kenyon Charles Kenyon is offline Windows 10 Office 2016
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,083
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Quote:
Originally Posted by Gilvv View Post
Thank you for your reply.

The files to be translated will be finally saved as, and handled in, Word format. Because of the translation memory that will be used, to get any matches with previous translations it is necessary to have those programming texts locked. That's essentially the problem, otherwise we could simply, for instance, change the gray programming text to hidden format but then we would loose essentially all of the otherwise 100% matches in the translation memory.

Does the programming text need to be editable text?
If not, replace it with screenshots of that text. That way, you have an image rather than text. If necessary, save a backup with the actual text.
Reply With Quote
  #6  
Old 11-21-2018, 10:09 AM
Gilvv Gilvv is offline Windows 7 64bit Office 2010 64bit
Advanced Beginner
 
Join Date: Oct 2016
Posts: 30
Gilvv is on a distinguished road
Default

Thank you for the replies.

We can forget about the RTF issues. All of the files will be ultimately in Word format. Thank you, Guessed; I'll try the Grouping suggestion. Charles, the programming text must be locked, read-only. I don’t think Images would work because, as I mentioned before, the Translation Memory being used requires that the programming text must be Locked.
Reply With Quote
  #7  
Old 11-21-2018, 10:48 AM
Gilvv Gilvv is offline Windows 7 64bit Office 2010 64bit
Advanced Beginner
 
Join Date: Oct 2016
Posts: 30
Gilvv is on a distinguished road
Default

Hi again.

I can see that, in the Developer tab, by selecting a string of that programming text, selecting “Text Content Control” and then Properties, I have the option to select “Contents cannot be edited”. That seems to do it. The problem is that the gray font programming text appears all over each file and I have about 2000 files like those.

I was thinking about a Macro that would allow me to select all that gray font text in each file and then lock it in the way I described. Would that be feasible?
Reply With Quote
  #8  
Old 11-21-2018, 02:16 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
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

Before the effort to code this is done, you need to test whether a locked CC actually does what your translators need. As I said, locking stuff in Word is easy but that doesn't mean it will round-trip to your translators and come back the way you want.

Assuming the CC or group is a valid method, the next problem is how does the macro determine what is grey. In some places it might be RGB(150, 150,150), in others it might be RGB(149,150,150) etc. The macro would have to be told exactly what RGB numbers it is looking for.

If the 'grey' text has been applied by something consistent eg a paragraph or character style then it would be a piece of cake to code.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #9  
Old 11-21-2018, 03:23 PM
Charles Kenyon Charles Kenyon is offline Windows 10 Office 2016
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,083
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Quote:
Originally Posted by Gilvv View Post
Thank you for the replies.

We can forget about the RTF issues. All of the files will be ultimately in Word format. Thank you, Guessed; I'll try the Grouping suggestion. Charles, the programming text must be locked, read-only. I don’t think Images would work because, as I mentioned before, the Translation Memory being used requires that the programming text must be Locked.

The only way you need locked text is if someone is going to copy it as text and paste elsewhere. I am not arguing, just pointing this out. I do not know your translation protocol. Personally, I would hate a bunch of images.


Even if you do not have a reliable macro to find all of your text that you want locked, you would be able to have a macro that would do the placement in a locked content control easily. That could be attached to a keyboard shortcut. Not as easy as something you just run once, but still an improvement.


Again, make sure that the locked content control will meet your needs before you spend time on macros to create them. If this works, it would be a lot less labor intensive than making and importing image files.
Reply With Quote
  #10  
Old 11-21-2018, 07:19 PM
Gilvv Gilvv is offline Windows 7 64bit Office 2010 64bit
Advanced Beginner
 
Join Date: Oct 2016
Posts: 30
Gilvv is on a distinguished road
Default

Hi again.

I really appreciate the feedback from both of you. Thank you!

I did a little testing. To show what I have, I'm attaching 2 files.

“Old file” is one of the files that were submitted to us last year with the programming text already locked.

“New file” is one of the new files provided without any locking. Using “Rich Text Content Control” and then “Properties” and “Contents cannot be edited”, I manually locked the programming text to do a little testing with the translation application (Trados Studio) being used.

As expected, Trados Studio showed the locked segments as tags (with the tag ID “<contentcontrol type=”Text” locked=”True”/>”).

However, even though the translation memory (populated with files like “Old file”) shows the same tag ID, those “old” tags don't exactly coincide with the “new” tags and hence the needed matching with the translation memory doesn't occur.

I notice that the locked segments in the “New file” appear boxed, which doesn't happen in the “Old file”. I don’t know if that's part of the explanation for the tag's discrepancy.

I believe that this is the right route but cannot figure out this last “tag” issue.

Thank you in advance for any advice you may give me.
Attached Files
File Type: docx Old file.docx (22.5 KB, 7 views)
File Type: docx New file.docx (26.1 KB, 7 views)
Reply With Quote
  #11  
Old 11-21-2018, 10:47 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
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

The old file appears to be using the Grouping method of creating a Content Control whereas your new file is adding a different CC type. Both are content controls but the different type may be relevant. You can hide the box around the regular CCs by changing the Show As setting in the CC property dialog but you really should be using the Group command to tag the areas since that matches the Old file's method.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #12  
Old 11-21-2018, 10:54 PM
Gilvv Gilvv is offline Windows 7 64bit Office 2010 64bit
Advanced Beginner
 
Join Date: Oct 2016
Posts: 30
Gilvv is on a distinguished road
Default

Thank you, Guess!
I truly appreciate it. As you surely may have guessed. I'm a novice. I'll try to do what you mention. I'll let you know.
Thanks again!
Reply With Quote
  #13  
Old 11-21-2018, 11:36 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
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

You don't need to be a novice to be confused by what you are trying to achieve. This is pretty advanced stuff and less than 5% of Word users would have any idea on what we are talking about.

I've been working in a vacuum somewhat because I have no knowledge of how Trados interfaces with the Word documents but now I've seen the old file I can make much better assumptions about how you might game the system and code a solution to lock those parts of the file.

If you used the New file but removed each of the CCs that you added in your testing (right click and remove CC) then the following macro would group all the grey areas
Code:
Sub GroupTags()
  Dim aRng As Range
  Set aRng = ActiveDocument.Range(0, 0)
  With aRng.Find
    .ClearFormatting
    .Font.Color = wdColorGray50
    .Replacement.ClearFormatting
    .Text = ""
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindStop
    .Format = True
    .MatchCase = False
    .MatchWholeWord = False
    .MatchWildcards = False
    .MatchSoundsLike = False
    .MatchAllWordForms = False
    Do While .Execute
      aRng.ContentControls.Add (wdContentControlGroup)
    Loop
  End With
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #14  
Old 11-22-2018, 09:20 AM
Gilvv Gilvv is offline Windows 7 64bit Office 2010 64bit
Advanced Beginner
 
Join Date: Oct 2016
Posts: 30
Gilvv is on a distinguished road
Default

Andrew, thank you so very much!
You are too kind.
I'm away today because of the Thanksgiving Holiday here at the US.
Looking forward (immensely) to try it.
I'll let you know.
Thanks again!
Reply With Quote
  #15  
Old 11-22-2018, 02:43 PM
Gilvv Gilvv is offline Windows 7 64bit Office 2010 64bit
Advanced Beginner
 
Join Date: Oct 2016
Posts: 30
Gilvv is on a distinguished road
Default

Hi, Andrew.
I have a question: I'm not quite sure about what am I supposed to do on the file after running the Macro. Could you please let me know? (Just trying to be proactive before my return tomorrow morning).

Thank you in advance!
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Save as .docx without content controls (just the text that was written in them) vitesse Word VBA 6 08-12-2022 02:01 AM
How do I lock an editable text box header and stop it moving with the rest of the main body text? thegaffa Word 6 09-28-2018 09:21 AM
Most efficient way to store numerous charts? RAB PowerPoint 0 07-13-2015 07:17 AM
Lock Text In a Document la_gillespie25 Word 4 05-15-2013 07:09 AM
Animation: text appears as if written by pen ionas.iona PowerPoint 0 03-31-2011 05:23 PM

Other Forums: Access Forums

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