Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-26-2018, 01:48 PM
NicB NicB is offline Repeating part of a Content Control Windows 10 Repeating part of a Content Control Office 2016
Novice
Repeating part of a Content Control
 
Join Date: Apr 2018
Posts: 17
NicB is on a distinguished road
Default Repeating part of a Content Control

Hi



I'm creating report templates, which need to have an address repeated at various points in the document. For greater flexibility I have created mapped content controls on the cover page for 'Property Name', 'Address Line 1', 'Address Line 2', 'Town', 'County' and 'Postcode', each of which are placed on a separate line in a table. I have grouped these controls together and styled them using the Subtitle style.

I've done it like this as in the header I only want to show the property name, town and postcode, so have duplicated these mapped controls into the header - is this the best way to do it? I've tried the StyleRef to pull the info into the header, but as I need to insert multiple fields that are styled with Subtitle, my testing didn't work. I've also tried Ref field but it didn't seem to want to automatically update.

Throughout the rest of the report the address is repeated in full. However, there are times when not every control is populated with data and I'm left with unfilled fields which my colleagues and I have to manually delete. As my colleagues aren't as confident with Word as I am, I would like to make this easier and remove the blank address fields automatically (without the use of VBA). Conversely, there are times when the address is quite long and we need extra address fields added on the fly (which again, can be repeated throughout the document).

I should add that there are a number of other content controls in the document - some mapped, some not.

I'm sure that there will be a much easier way to do what I want to do, I just need pointing in the right direction. I'm the only person who has access to the Developer tab and whilst some colleagues and I are using Word 2016, there is one person who is using Word 2010.

I hope I've managed to explain my query and hope that someone will be able to assist.
Reply With Quote
  #2  
Old 07-26-2018, 03:16 PM
macropod's Avatar
macropod macropod is offline Repeating part of a Content Control Windows 7 64bit Repeating part of a Content Control Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

What you need to do is to apply a different Style to each element you want to replicate in the header, then insert StyleRef fields for each of those Styles.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 07-27-2018, 12:01 AM
NicB NicB is offline Repeating part of a Content Control Windows 10 Repeating part of a Content Control Office 2016
Novice
Repeating part of a Content Control
 
Join Date: Apr 2018
Posts: 17
NicB is on a distinguished road
Default

Thanks for coming back to me macropod.

That's what I'd suspected I would have to do, to get StyleRef to work. However, as I wanted to make the template as easy as possible for those that are not confident with Word, I wanted to make it as simple as possible. Whilst StyleRef would pull the required information into the header, having to create a different style (up to 7 styles) with exactly the same settings, for each element of an address, could make it more complicated, especially if they are trying to diagnose why an element isn't repeating in the report.

Can you think of another way that I can lay out an address on the cover sheet and then, repeat part of it in the header and the whole address at various points within the body of the text. If the only answer is to use mapped content controls, then is there a way to delete any unused ones?
Reply With Quote
  #4  
Old 07-27-2018, 12:13 AM
macropod's Avatar
macropod macropod is offline Repeating part of a Content Control Windows 7 64bit Repeating part of a Content Control Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

If you're using a template, doing the set-up for this should be a once-off exercise, so the only reason an element wouldn't appear in the header as it should would be due to its omission or its insertion into the wrong content control. Other than that, the process should be seamless for your users.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 07-27-2018, 01:21 AM
Guessed's Avatar
Guessed Guessed is offline Repeating part of a Content Control Windows 10 Repeating part of a Content Control Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
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

I think there are real benefits to using linked Content Controls and some drawbacks with a StyleRef.

StyleRef needs a master (the style), which has to either once only in the document or prior to the first instance of the slaves (the field). If the style gets used on something else then there will be variability in the slave field result depending on where the nearest master is located. A linked content control can be edited in any instance to change all the other instances.

StyleRef requires fields to be updated after changing the master. CCs change as the cursor leaves the CC.

On the other hand, StyleRef does have the advantage of working in Doc format which is one thing that CCs can't do.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #6  
Old 07-27-2018, 01:48 AM
gmayor's Avatar
gmayor gmayor is offline Repeating part of a Content Control Windows 10 Repeating part of a Content Control Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,106
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Mapped controls will work fine for any fields that you want to duplicate. Uncompleted fields will however be a problem if there are to be no macros, and if you are going to use macros to address the missing field data, you don't need to map the fields, you can instead use entry and exit macros and write the required values to a single text control.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #7  
Old 07-27-2018, 04:33 AM
macropod's Avatar
macropod macropod is offline Repeating part of a Content Control Windows 7 64bit Repeating part of a Content Control Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by Guessed View Post
StyleRef requires fields to be updated after changing the master.
Not when they're in the header or footer; they update dynamically as you change the Style's content.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #8  
Old 07-27-2018, 06:28 AM
Charles Kenyon Charles Kenyon is online now Repeating part of a Content Control Windows 10 Repeating part of a Content Control Office 2013
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,140
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 gmayor View Post
Mapped controls will work fine for any fields that you want to duplicate. Uncompleted fields will however be a problem if there are to be no macros, and if you are going to use macros to address the missing field data, you don't need to map the fields, you can instead use entry and exit macros and write the required values to a single text control.

Graham,



I know that you have a much deeper understanding of mapped controls (mine is superficial and depends on your Add-In or Greg's). That said, I have mapped controls which have no content and they do not seem to cause any problems (other than being blank). That may be because the utilities fix any problems that might otherwise occur.
Reply With Quote
  #9  
Old 07-27-2018, 07:38 AM
Guessed's Avatar
Guessed Guessed is offline Repeating part of a Content Control Windows 10 Repeating part of a Content Control Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
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

Blank CCs are never completely empty - if you clear the text they revert to showing the placeholder text which can be a pain when the user wants to print it and fill it out with a pen.

The usual workaround is to add a space
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #10  
Old 07-29-2018, 09:46 AM
NicB NicB is offline Repeating part of a Content Control Windows 10 Repeating part of a Content Control Office 2016
Novice
Repeating part of a Content Control
 
Join Date: Apr 2018
Posts: 17
NicB is on a distinguished road
Default

Thank you all for your inputs - I'm slightly star-struck by everyone who has responded, as I've read a lot of your websites at length and learnt so much from you, which I thank you for. Without you all graciously divulging your knowledge, I would still only be using 20% of Word.

It is good to know that my thought processes, in terms of the pros and cons of CC vs StyleRef were on the right track. I've gone back to the drawing board for the headers and have tested assigning custom Document Properties to the Content Controls on the cover sheet, which pull the relevant info into the header. This has worked okay so far and it has the second benefit of recording those pertinent details in the Properties.

I will test how well this would work with pulling the details into the body of the document, along with testing out the Ref field (as I can use switches to change the case, where needed). Failing that, I think I will stick to using mapped CCs in the body. If I add an additional CC in (to account for long addresses), then group all address lines and set the group to 'cannot be deleted'. I could then enable individual CCs in that group to be deleted, to give the user some control. As I've changed the placeholder text to a bright colour, any extra controls that need to be deleted before printing would be pretty obvious.


Quote:
Originally Posted by gmayor View Post
Mapped controls will work fine for any fields that you want to duplicate. Uncompleted fields will however be a problem if there are to be no macros, and if you are going to use macros to address the missing field data, you don't need to map the fields, you can instead use entry and exit macros and write the required values to a single text control.
Graham my knowledge of macros isn't great (next thing to learn on the long wish list). I assume this is similar to the entry/exit feature for legacy fields, except that the document has to be saved as a macro-enabled document?


Thank you all once again - you've all really helped me to get a better understanding.
Reply With Quote
Reply

Tags
content controls, repeated content



Similar Threads
Thread Thread Starter Forum Replies Last Post
Content Control content deleted when re-uploading to SharePoint Peterson Word 5 06-27-2018 08:13 PM
insert the 2 content controls into a Repeating Section in a table smaccharoli Word VBA 2 02-27-2018 08:49 AM
Repeating part of a Content Control Alternatives to Repeating Section Content Controls ABC987 Word 2 07-03-2015 06:22 AM
Repeating part of a Content Control Clicking the selected Content Control checkbox returns wrong control in vba event DougsGraphics Word VBA 2 06-24-2015 07:31 AM
Repeating part of a Content Control Deleting a table from a content control -- preserving the content control BrainSlugs83 Word Tables 8 11-14-2013 03:06 AM

Other Forums: Access Forums

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