Share via

How can I add if logic to building blocks?

Anonymous
2015-10-28T18:16:56+00:00

I would like to provide a choice of paragraphs at different stages for users within a Word document.  I have created building blocks and assigned them to a category accessed via a building block control to limit users to the relevant building blocks. However I would like to be able to add logic so that if a users chooses a particular building block,  other paragraphs in the document are changed accordingly and automatically.    Would anyone be able to provide some guidance as to the best way to tackle this automatically?  I am not a VBA expert and wonder if this is the only way forward?

Many thanks indeed. Laura

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

8 answers

Sort by: Most helpful
  1. Charles Kenyon 166.8K Reputation points Volunteer Moderator
    2015-10-28T22:15:03+00:00

    Many thanks Charles.  Appreciate the quick response. The document(s) I'm referring to include SLA's and other legal documents rather than a form as such and actually I'm researching this on behalf of someone else.  I will have a read of your links.  I've also been trying to bookmark the Building Block Control field then use it with an IF field to apply logic - if paragraph x is selected, print one thing, otherwise print another thing.....haven't got it quite working and I think it might work better anyway with much shorter paragraphs.....hope you don't mind if I get back to you with further question if necessary?

    Regards - Laura

    There is a limit to the length of the TrueText in an IF field.

    For some purposes a legacy form works better. At least the fields have automatic bookmarks that you can use. I wouldn't switch to them for only that reason, though.

    Here is an unfinished page that has a number of good links...

    Making Forms with Microsoft Word

    Greg Maxey has quite a bit on Word Content Controls.

    2 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2015-10-28T19:48:52+00:00

    Hi Jay. Many thanks also for your reply.  I think I need to gather more information - but am I right in assuming VBA would definitely be required to implement logic that says - if I select building block A here, insert or delete building block X in another location?

    Regards - Laura

    0 comments No comments
  3. Anonymous
    2015-10-28T19:45:30+00:00

    Many thanks Charles.  Appreciate the quick response. The document(s) I'm referring to include SLA's and other legal documents rather than a form as such and actually I'm researching this on behalf of someone else.  I will have a read of your links.  I've also been trying to bookmark the Building Block Control field then use it with an IF field to apply logic - if paragraph x is selected, print one thing, otherwise print another thing.....haven't got it quite working and I think it might work better anyway with much shorter paragraphs.....hope you don't mind if I get back to you with further question if necessary?

    Regards - Laura

    0 comments No comments
  4. Jay Freedman 207.6K Reputation points Volunteer Moderator
    2015-10-28T19:27:32+00:00

    I agree with Charles.

    A further consideration is exactly how the other paragraphs are meant to change when a building block is chosen. If the changes are repetitions of the building block, the code can be reasonably simple. In other cases, the code for making alterations can become quite complex, or it may be necessary to create additional building blocks to insert at the other locations.

    0 comments No comments
  5. Charles Kenyon 166.8K Reputation points Volunteer Moderator
    2015-10-28T19:17:27+00:00

    What you are requesting is not simple.

    You may need to use vba, although not at the "expert" level.

    Consider using a UserForm for the choices and letting it build your document.

    Create a Simple Userform

    You may also want to look into the AutoTextList field.

    AutoTextList field - How to add pop-up lists to any Word document, so you can click your way through changes in seconds

    0 comments No comments