Is there a way to preserve/protect the bookmark brackets [] in MS Word? (1 Viewer)

kilroyscarnival

Registered User.
Local time
Today, 21:47
Joined
Mar 6, 2002
Messages
76
I'm using Word 2010, though I'm pretty sure there are others in my office using a newer version of Office.

I'm trying to streamline some old document templates to eliminate mistakes, formatting issues, etc. One thing is that some items get placed several places within the document: 1) title page; 2) header of cover letter; 3) footer of main document. They are the report type, the project name, the location of the project, and our internal project number (and sometimes the client project number.)

I created these items as bookmarks on the front cover, and used "Cross references" to get them to recur in those other places. I think I finally got it to where it's all UPPERCASE where needed and Title Case where required.

I'd like to know if there's a way to set a specific document to always display the bookmark brackets, and also whether it's possible to protect them? It seems very easy to type or backspace the brackets, and thus the bookmark, out of existence.

Thanks!

Ann
 

strive4peace

AWF VIP
Local time
Today, 16:47
Joined
Apr 3, 2020
Messages
1,003
hi Ann,

> " always display the bookmark brackets "

yes, in Word Options, you can Show Bookmarks

word_Options_365_Advanced_Display.png


> " whether it's possible to protect them? "

You could make that page, or area, a section that you protect. You'll find that in the Protect group on the Review ribbon
 

kilroyscarnival

Registered User.
Local time
Today, 21:47
Joined
Mar 6, 2002
Messages
76
Thank you, Crystal! Yes, I have "show bookmarks" selected in my Options. I was looking for a way to force that option onto all users of this particular document. Since it's a user setting and not a document setting, I'm not sure that's possible.

And I'm not sure whether I can protect the brackets around the bookmark while still allowing the user to update the text within the bookmark? I'll have to play around with that, but I'm thinking I just need to make everyone be very careful. It's very easy within the brackets to backspace or delete once too often and wipe out the bookmark itself. I suppose an alternative would be setting up a User Form that pops up when the document is first opened. That way the input would be done there and placed into the document. I was hoping the bookmarks by themselves would be easier. This guy's video was what walked me through using the form for the first time.

I like your moniker, Strive4Peace. Wish we taught the striving part a little more widely. 🕊🌎
 

strive4peace

AWF VIP
Local time
Today, 16:47
Joined
Apr 3, 2020
Messages
1,003
thank you, Ann

He is a very good teacher, but that's not the way I would do it. Also his video doesn't show renaming the controls but the code would need to have that done to work. He also didn't compile the code (it would have had errors because names didn't match). Still good to see a novice perspective -- duct tape gets the job done ~

I would use a different method ... I'll work up an example and come back ~

meanwhile, would you please post a sample cover page with information that gets dispersed to the rest of the document? thanks
 

kilroyscarnival

Registered User.
Local time
Today, 21:47
Joined
Mar 6, 2002
Messages
76
Crystal, thank you so much for your thoughts. The YT guy's method actually does work for simple purposes, but agreed, I did rename the controls the one other time I used it. Word is something that I only used for the most basic purposes until a change in jobs (I've used Excel more frequently.) And though I took some online courses, most of my work is doing revisions on existing reports, either made from old templates or from re-edits of old reports. So a lot of bad habits and pesky errors persist.

I took what I have so far of the report template, took off our company references, and grabbed the first several pages. The zipped file is a .dotm. The key info that repeats throughout the document:

Project Title (also report title): Bold all caps on cover page, bold all caps in introductory letter, bold italics title case in the footer throughout the document from page ii of a letter (if applicable) through end of report (not appendix.)
Project Number (our internal number): on cover, in header of letter, and in footer throughout, same as above.
Report Type: These will generally be Report of Engineering Investigation, or a specific report category - also in all three places with the previous items.
Location: This will be typically "X County" or "Y City", Florida and appears on the cover and in the header of the letter only.
Client Project No (here noted as FPID No): for some projects this will also go into the footer, but most commonly, like location, cover and letter header only.

The other way I would think to do this is using Mail Merge to create then fill in the fields. But I made something that uses merge to fill out a series of complex tables in Word, and so far only one of the engineers is using it. It also makes more sense in doing a batch of work, rather than one report at a time.

Also thought about using the general fields within the document (Client, Document Number, Project, Purpose, Reference) but if I could link those to a user form that would make it feasible. I'm not sure my coworkers would remember to change them under File, Properties, Advanced Properties.

I know this looks pretty rough at this stage but compared to where it was (sections, tables, and appendix manually numbered, manually double spaced between paragraphs), it's incrementally better.
 

Attachments

  • ALC Report Template - .zip
    741.9 KB · Views: 475

strive4peace

AWF VIP
Local time
Today, 16:47
Joined
Apr 3, 2020
Messages
1,003
hi Ann,

Using the document properties is a good idea -- especially since they're exposed by Windows and you can show them as columns in a listing of files. You can also define your own custom properties in the template, that don't show in a file list -- and those will propagate. A userform can read what they are and change them if they're different.

So, using this approach, and looking at what you sent, what would you call things? Here is my attempt:

ReportTypePurpose
ProjTitleProject
ProjLocationClient
GECNoDocument Number
FPIDNoReference

if you had something else in mind, what is it?

I also like content controls since they can be protected ... or maybe both ;) ~
 

kilroyscarnival

Registered User.
Local time
Today, 21:47
Joined
Mar 6, 2002
Messages
76
Crystal, those field associations sound about right - except I would maybe leave CLIENT for a possible future client name field... and use DESTINATION for the Location field. (I think that’s the field I was thinking of... Saturday brain and I’m not in front of Word.)

Another goal is to get most of the main client names and addresses into either Word as building blocks or Excel as a mail merge situation, so they don’t have to be typed.
 

strive4peace

AWF VIP
Local time
Today, 16:47
Joined
Apr 3, 2020
Messages
1,003
great, thanks Ann -- important to pick the best words ~ that's half the battle ;)

Aside from the red text, what else gets modified? I see several sections that seems like they'd be dependent on the type of project as to whether to include them or not. How do you currently manage that?

> " mail merge situation "

do you have Access in your Microsoft Office suite? Do others? That seems like a more logical choice to initiate a merge since it gives you tools to store data efficiently, and down the road, get statistics on what's been generated.
 

strive4peace

AWF VIP
Local time
Today, 16:47
Joined
Apr 3, 2020
Messages
1,003
Ann, I see, for instance, in the Location and Description section, there are other variables such as Land Uses, Adjacent Properties (how do you currently determine that? Do you have a list with Latitude and Longitude where you could automate it?), #acres, Constructed Features, Vegetation, Site Features, etc ...

Would it be beneficial to store more information and generate more of the Word document from stored data?

Do you have different templates that you use? If so, how many do you have?

Do you keep track of information such as this in another place?
 

kilroyscarnival

Registered User.
Local time
Today, 21:47
Joined
Mar 6, 2002
Messages
76
Ann, I see, for instance, in the Location and Description section, there are other variables such as Land Uses, Adjacent Properties (how do you currently determine that? Do you have a list with Latitude and Longitude where you could automate it?), #acres, Constructed Features, Vegetation, Site Features, etc ...

Would it be beneficial to store more information and generate more of the Word document from stored data?

Do you have different templates that you use? If so, how many do you have?

Do you keep track of information such as this in another place?

I appreciate all these ideas. But these details in each report would be collected by the engineers and manually input, because every project and site will vary as to all those descriptors. I think those are just suggestions as to what info goes where, but not verbatim. These reports aren't meant to be automated. I was just hoping to address some of the areas where there are a lot of clumsy formatting issues, inconsistency, etc.

do you have Access in your Microsoft Office suite? Do others? That seems like a more logical choice to initiate a merge since it gives you tools to store data efficiently, and down the road, get statistics on what's been generated.

No one in the company has Access. I miss it, since I used Access and Excel a lot in my former career. Over the years this site has been most helpful in troubleshooting my little efforts.

I'm just an assistant in the company I currently work for, and not there very long, so any change I can implement will likely be slow and by polite suggestion. That's why I thought to do this small change to part of the reports. I haven't shown anyone what I'm working on yet, so they may say it's not worth the fuss. I really didn't mean to give you or anyone else a whole project to think through, especially given the situation I'm in. I was just hoping to figure out the simplest way to get these few bits of information into several spaces for a bunch of users with varying skill levels.
 

strive4peace

AWF VIP
Local time
Today, 16:47
Joined
Apr 3, 2020
Messages
1,003
hi Ann,

thank you! You're great at giving a perspective -- so helpful!

Mostly these documents will be filled by the technical experts? -- but then checked over by someone else?

With that asked, would it be helpful, whenever the Word document is opened, for it to show the cover page information and allow the user to easily modify it? -- no big deal if you want that -- the userform can just also be opened from another place in the code. ... if yes, would that privilege be dependent on anything? Sorry -- can't help myself but to dig deeper.

~~~
However,
I see where you're at. Give me a little more time to work up a better example than what I was going to show you ..

... and you're never "just" anything -- you are always who you are, even if those around you don't fuel the fire
 

kilroyscarnival

Registered User.
Local time
Today, 21:47
Joined
Mar 6, 2002
Messages
76
Yes, reports go back and forth in a review process where a senior engineer edits (and usually gives me the markups to change). Usually the main title page details I wanted to cross-reference don’t change, though. But if an older report were being used as a template, it would be useful to be able to change from the user form and affect three or four places simultaneously.

One thing I’ll need to check also is whether the title entry needs to be typed in title-case and then a macro changes it to all-caps where needed, or typed in all-caps and then where title-case the macro converts that. Or whether it doesn’t matter how it’s input, in which case each iteration needs to be formatted. I think all-caps is a simple font characteristic while there is no true title case in new Word, only Capitalize Every Word Of The Title which just scans wrong.
 

strive4peace

AWF VIP
Local time
Today, 16:47
Joined
Apr 3, 2020
Messages
1,003
hi Ann,

attached is:
ALC Report Template_200607.zip than unzips to a DOTM file

I removed the bookmarks, which means you'll need to change the cross-references. Instead use Built-in document properties. This video shows you how to do that:

Repeat text in MS Word Using Document Property content controls

it isn't the best, and I would definitely recommend checking the box that says this control can't be deleted!

Turn on the Styles pane -- click the little launcher button
word_Styles launcher.png


I made a character style called aAllCaps.

1. Select text for new style
2. click the New Style button
word_NewStyle.png


3. choose a Name -- I like to start all styles I make with "a" so they're grouped together
4. choose Style type = character
word_NewStyleCharacter.png


5. To make uppercase, choose Font from the format dropdown
word_NewStyleCharacter_Format_Font.png


6. and then check the All caps box. I also set color to be Red, and font style to be Bold
word_NewStyleCharacter_Font_AllCaps_Red_Bold.png


I called this style aAllCaps, but you might want to make style names that are specific to the contents instead of using generic names, as you can also insert text from a style like this:
1. Insert
2. Quick Parts
3. Field...
4. StyleRef
5. pick which style reference you want to use
word_Field_StyleRef.png


You would insert text from a StyleRef INSTEAD of a bookmark cross-reference or a copy of the document property content control

so if you're going to insert text from styles, you probably want to name them specifically. Define other styles that you might want like aProjectTitle, aProjectNumber, etc.

that way, in other places, they won't be changeable -- so it just depends on what you want.

You'll need to turn the Developer ribbon on to set Properties for the controls. When you insert a built-in Document property, it becomes a content control.

I changed the Name property of the controls on your userform. The database property I used is in parentheses.

TextBox1 --> ProjectTitle (Title) --> character style = aAllCaps
TextBox2 --> ProjectNumber (Subject)
TextBox3 --> ClientNumber (Company)
TextBox4 --> Location (Comments)
TextBox5 --> ReportType (Category)

I didn't find the other properties you mentioned -- am using Word 2007 for this to be sure you can open it with 2010, and these are the built-in document properties to pick from:
word_2007_built-in document properties.png


Some of those properties you mentioned are custom properties, not built-in ones

Then I looked to see which of those properties could show in a file list -- which is why I used the ones I did ... you might want to change them though!
File list showing properties.png


I added code to popup the userform anytime a document is opened so stuff can be edited that way. and then there is still the code you have to show the userform for a new document:

Rich (BB code):
Private Sub Document_New() 
    ReportForm1.Show 
End Sub 

Private Sub Document_Open() 
'200607 strive4peace
   Dim sProjectTitle As String _ 
      ,sProjectNumber As String _ 
      ,sLocation As String _ 
      ,sClientNumber As String _ 
      ,sReportType As String 
   
   With ActiveDocument 
      sProjectTitle = .BuiltInDocumentProperties( "Title") 
      sProjectNumber = .BuiltInDocumentProperties( "Subject") 
      sReportType = .BuiltInDocumentProperties( "Category") 
      sClientNumber = .BuiltInDocumentProperties( "Company") 
      sLocation = .BuiltInDocumentProperties( "Comments") 
   End With 
   
   With ReportForm1 
      .ProjectTitle = sProjectTitle 
      .ProjectNumber = sProjectNumber 
      .Location = sLocation 
      .ClientNumber = sClientNumber 
      .ReportType = sReportType 
      .Show 
   End With 

End Sub

I also changed report type to a combo box. Something can be chosen from the list or the user can type whatever they want. the list is populated in the code behind the userform

Rich (BB code):
Private Sub UserForm_Initialize() 
'200607 strive4peace
'populate the combo box list

   With ReportForm1.ReportType 
      .AddItem  "Report of Geotechnical Engineering Exploration"
      .AddItem  "Some other report type"
   End With 
End Sub

The list can come from somewhere else such as Excel too! You mentioned you wanted to pick clients ...

here is the code that runs when the OK button is clicked:

Rich (BB code):
Private Sub OKButton_Click() 
'200607 strive4peace
   Dim sProjectTitle As String _ 
      ,sProjectNumber As String _ 
      ,sLocation As String _ 
      ,sClientNumber As String _ 
      ,sReportType As String 
   
   'read whats in the controls and assign to variables
   With Me 
      sProjectTitle = .ProjectTitle 
      sProjectNumber = .ProjectNumber 
      sLocation = .Location 
      sClientNumber = .ClientNumber 
      sReportType = .ReportType 
   End With 
   
   'set document properties
   With ActiveDocument 
      .BuiltInDocumentProperties( "Title") = sProjectTitle 
      .BuiltInDocumentProperties( "Subject") = sProjectNumber 
      .BuiltInDocumentProperties( "Category") = sReportType 
      .BuiltInDocumentProperties( "Company") = sClientNumber 
      .BuiltInDocumentProperties( "Comments") = sLocation 
   End With 
    
   'repaint document to show new values
    Me.Repaint 
    
   'hide userform
   ReportForm1.Hide 
    
End Sub

The document is still messy, but hopefully I've done enough that you can add more controls and fix the references.

I would use content controls for the engineering stuff they fill out too! those wouldn't be document properties too -- just, for instance, plain text content controls (and maybe you'll use a character style for the text)

Ask questions if anything isn't clear ~
 

Attachments

  • ALC Report Template_200607.zip
    744.8 KB · Views: 579

strive4peace

AWF VIP
Local time
Today, 16:47
Joined
Apr 3, 2020
Messages
1,003
ps, Ann,

here is a screenshot of the content control properties:
Content Control Properties.png


You'll find Properties on the Developer ribbon. title can be whatever you want -- and you can also change the text displayed -- it defaults to [Propertyname]
 

kilroyscarnival

Registered User.
Local time
Today, 21:47
Joined
Mar 6, 2002
Messages
76
(Mon afternoon) Wow, a lot to take in here. Thank you for all this work. I'm trying to find time to work/play with it a bit.

The use of content controls definitely solves my don't-accidentally-delete-it issue. First off, I had to figure out why the document properties was grayed out in my Quick Parts main menu. It's because this was always saved in compatibility mode so I had to change that.

I'm going to try to re-do what you've done piece by piece, whenever I find time to work on it, so my response may be slow and scattered. So far I'm wondering whether I even need the user form if I'm using the content controls.

--

(Tue lunchtime)

Okay, so I've gone back to the full template, or at least my Bowdlerized version of theirs, and I've managed to insert the controls and StyleRef that you created but omitted the UserForm. And it works, nicely. It also seems that they could change the title in any one place (cover page, letter, footer), which is better than having to do it all up-front from the form, I think.

I've used fields and quick-parts, and I've made some forms, but I hadn't made the connection of using these controls on the page like this. I thought they would not look like seamless text in the print version (or PDF).

The ReportType might be nice in a combo box, but for now I need to figure out how and when those report descriptions get changed. The preliminary goal, for me at least, was to stop having to change from "...Engineering Evaluation" to "...Engineering Investigation" in several places, if the senior on the project decides to change the description. And I'd forgotten to add that not every report will have a client ID number, so that was the one control I left as deletable. On some reports, the client ID will go in the place of the internal report number in the footer, and in some cases both go on the left side. So there'll be some tinkering along the way. Not to mention that manyof the report I get aren't drawn up whole-cloth from the template but from previous reports of the same nature. Sometimes I get them marked up like MadLibs. At least getting them autonumbering the sections and using fixed styles will be a start. (By the way, the red text doesn't stay red, it's just an internal marker to watch for the variables and cues. So I took the red out of the control formatting.)

I definitely need to go through everything you laid out about three or four more times to process it all in a way that I can possibly use it again if needed. This is the way I love to learn, one obstacle at a time. My first real foray into Access was to help a then-coworker figure out an easier way to process the inch-thick printed phone bill which had to be broken out by division and department *manually* (made my head spin that it took her most of a day to do this.) We found out we could get the bill electronically, and then it was a matter of building a database, figuring out how split the billing of personnel who worked for more than one division, and how to divvy up the flat charges at the end of the itemized bill. It was the best starter project imaginable in that it was driven by the wish to help someone else, and it fed into my idea of "applied laziness" - that is, spending the spare hours learning how to save minutes off every day, or hours off every month. :)

Thanks again. I'll report back when I've had the chance to get going with this with my supervisor. -- A
 

strive4peace

AWF VIP
Local time
Today, 16:47
Joined
Apr 3, 2020
Messages
1,003
ps, Ann ... you might want to give good consideration to defining styles that uniquely identify information you want to echo in other places. I was generic about that, mostly to make a point about styles -- they can be powerful. In fact, I usually use the built-in styles for Heading 1, Heading 2, etc (even though I style them differently)-- and use them to generate TOC, as well as include StyleRef in page headings. It isn't necessary to use the built-in names, but makes it easier when you do.

In Excel, I often use cell 'styles' to determine how a cell value should be validated -- and it doesn't really style the text so much as identify it to run the proper validation code ~
 

strive4peace

AWF VIP
Local time
Today, 16:47
Joined
Apr 3, 2020
Messages
1,003
pps, Ann -- oh, and on letting user delete ... another Field you can specify is IF ... so you could test to see if client reference if filled for printing, Do you reference that anywhere else?

re: "MadLibs"
lol

re: "I love to learn"
I gathered that -- and therefore, helped (and will help) you more ...

re: "Access"
good you've used it and gotten a glimpse into its power ... Access is a great controller! ... and can store data in an easily retrievable way -- so if you used Access to drive the creation of a new document based on the template, it could also easily record the variable information, which would be invaluable down the road ...
 

kilroyscarnival

Registered User.
Local time
Today, 21:47
Joined
Mar 6, 2002
Messages
76
ps, Ann ... you might want to give good consideration to defining styles that uniquely identify information you want to echo in other places. I was generic about that, mostly to make a point about styles -- they can be powerful. In fact, I usually use the built-in styles for Heading 1, Heading 2, etc (even though I style them differently)-- and use them to generate TOC, as well as include StyleRef in page headings. It isn't necessary to use the built-in names, but makes it easier when you do.

Yes, that's one of the things I've been working on in building a new version of that template. In a lot of cases, the users haven't been using the styles at all, and thus the TOC ends up being a mess I end up sorting out. When Styles are consistently applied to the headings, it works fine. In some reports, I see *obviously* different formats applied to the Level 2 headings, such as some italic and some not italic. It's a real time waster.

Between projects yesterday, I started working on ways to make entering the signature and title easier, especially when there are generally two (in some cases three) signatures plus a seal applied to the cover letter. I came up with creating individual text boxes, saved via QuickParts as saved text boxes, and then inserting them in a 1 x 2 table whose borders won't show. The hitch is, the individual signatures are different sizes and I have to work further on creating image files that are consistent in their actual size - otherwise the text doesn't line up beneath them. But, it's an idea.

In Excel, I often use cell 'styles' to determine how a cell value should be validated -- and it doesn't really style the text so much as identify it to run the proper validation code ~

Nice! I keep thinking I know Excel until I start researching a better way to do something and realize most of my self-taught skills are from the much older versions.
 

Users who are viewing this thread

Top Bottom