#1
|
|||
|
|||
Protecting only 1 section
Our company wants to be pretty specific on QC of documents. Because of this they have specific guidelines that they want followed. Because of this I have been tasked with creating some 'buttons' on a new ribbon.
long story short, they also want to track who does what QC role and when. I looked up protecting a section and that seemed to be the right direction, but when you initiate that protection level, I cannot do track changes... Basically, I am hoping to protect a specific section in the document from being edited, but still being able to work in the rest of the document. Is this possible? |
#2
|
|||
|
|||
while waiting on a reply for this, I have been looking at other ways to do this. One such way I came across is to use custom document properties. I think I may have set something up on these lines, but I seem to be finding that each property may have a limit to it (255 chars)? Can this be confirmed for word 2016 (office 365)? If so, another road block... unless I try and string together several properties...
|
#3
|
||||
|
||||
What you could do is to insert the protected content into a separate document to which you apply 'filling in forms' protection. Then, at the point where that content is to appear in your main document, insert a link to the protected document via Insert|Text from file>Insert as Link. That way, you can still use 'Track Changes' for the unprotected content. Although users can still edit in the linked area, it's impossible for them to preserve that content against the content reverting any time Word refreshes fields in the document (e.g. when a print preview is done or the document is printed). Provided the document containing the protected content is stored in a folder Word can access for all users, there shouldn't be any problems.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#4
|
||||
|
||||
I'm not exactly sure on your requirements especially with your mention of custom doc properties and how that could be used.
The subtle protection method I would explore is to group the text - which puts it into an invisible content control and stops accidental editing of it. You can then also set the properties of that CC so it also prevents deletion of that grouped text. You will need to show the Developer Tab to explore this option of protecting the text.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#5
|
||||
|
||||
Indeed, one could use an ordinary content control as a placeholder for the text and set it's properties to 'cannot be deleted' and 'cannot be edited'. Without some form of protection, though, it's easily circumvented.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#6
|
|||
|
|||
the idea is to not modify the document too much to track the QC process. This data does not have to be visible to those working on it, but should be easy to check/output if required. The problem is that with the section idea I thought of at first, if I don't protected, someone could accidentally change some of the info. If I protect it (form protection) then you cannot do comments, even if the other sections have the form protection turned off. The section idea was nice, since I put a stamp at the beginning to mark it, and therefore could track, output, and later delete it from the document without messing with the other text.
I would prefer to stay away from a separate file storing this info, or at least till they work out a more automated way to handle the files. I can see someone taking the file home to work on (off the network) then having a new QC tracking file created and lost. I might work out the custom property method. Each entry would be at most 50 chars (most likely less). If I can count the number of chars in the property, then when 200+ create a new one with incrementing names. Not idea, but I can make it work. |
#7
|
||||
|
||||
As I said, you could use a text content control and set it's properties to 'cannot be deleted' and 'cannot be edited'. Someone would have to be quite deliberate about messing with it to change anything. Another option would be to programmatically add the document to the document via a Document Variable. Such content is easily displayed by inserting a DOCVARIABLE field referencing the variable, but can only be changed programmatically. The downside is that you can't insert formatted content into a Document Variable.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#8
|
|||
|
|||
ok, I will look more into text content control.
The information I am looking to store would be entered programmatically anyway, and I think I have a good handle on incrementing custom properties (I'm hoping that is what you meant by DOCVARIABLE, but I will look that up). Thanks! |
#9
|
||||
|
||||
Document variables and custom document properties are quite different. For one thing, custom document properties can be edited via the GUI, document variables cannot.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#10
|
|||
|
|||
I use the following to make sure guys here aren't changing stuff they shouldn't. when they close the new document it adds their name and date/time to the footer. It then performs a comparison to the original template and saves it to a specified folder. Also, each time the new document is opened and closed it does the comparison again and captures who is doing it in the footer.
Code:
Private Sub Document_New() Dim oDoc As Document Application.FileDialog(msoFileDialogSaveAs).InitialFileName = "Pick a name for the save function" ' Mine is the same as the template Dim choice As Integer choice = Application.FileDialog(msoFileDialogSaveAs).Show If choice <> 0 Then FileName = Application.FileDialog(msoFileDialogSaveAs).SelectedItems(1) Application.FileDialog(msoFileDialogSaveAs).Execute Set oDoc = ActiveDocument End If End Sub Private Sub Document_Close() Dim strPath As String Dim lFmt As Long Dim strOriginal As String strPath = "Your chosen save folder" ' I created a folder on the company drive only I know where it is Application.ScreenUpdating = False ActiveDocument.Compare Name:= "C:\Users\yourname\Desktop\Personal\VBA test\Form XX-XX for project .docx", _ 'Your Template document name and location CompareTarget:=wdCompareTargetNew Set compareTargetNew = ActiveDocument With ActiveDocument strOriginal = .FullName End With With ActiveDocument.Sections(1) .Footers(wdHeaderFooterPrimary).Range.Select Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _ "USERNAME ", PreserveFormatting:=True Selection.TypeText Text:=vbTab Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _ "DATE \@ ""dddd, MMMM d, yyyy"" ", PreserveFormatting:=True Selection.TypeText Text:=vbTab Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _ "TIME \@ ""h:mm:ss am/pm"" ", PreserveFormatting:=True With ActiveDocument .SaveAs2 FileName:=strPath & "/" & .Name, _ FileFormat:=lFmt, _ AddToRecentFiles:=False .SaveAs2 FileName:=strOriginal, _ FileFormat:=lFmt, _ AddToRecentFiles:=False End With Application.ScreenUpdating = False ActiveDocument.Close End With End Sub Last edited by kilroy; 05-28-2019 at 10:58 AM. Reason: spelling |
#11
|
|||
|
|||
thanks for the example. It looks like this only tracks the last user (overwriting the previous footer?) I'm looking to track everyone that makes a change to the document, in a custom way. I also don't want to mess with footers that may exist in the document.
|
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Protecting Forms | Edward_Musheyev | Word | 2 | 07-18-2016 11:56 AM |
section page numbers reverting to following on from previous section after generating index | cloudtrapezer | Word | 1 | 06-25-2015 01:16 AM |
Anytime a section of TOC is updated, the picture stored in that section gets copied into my TOC. | brap367 | Word | 1 | 12-15-2014 12:49 PM |
Deleting section break and retaining section properties | New Daddy | Word | 6 | 02-03-2014 07:09 PM |
Protecting documents | jeljohns | Word | 3 | 09-06-2013 07:36 PM |