Skip to main content

Notifications

Power Automate - Building Flows
Unanswered

Hiding Sections of a Word Document

(1) ShareShare
ReportReport
Posted on by
Is it possible to hide sections of a word document using data from a SQL stored procedure.
 
So simply hide section when Field01 = TRUE
  • trice602 Profile Picture
    trice602 11,848 on at
    Hiding Sections of a Word Document
    Hi,
     
    I haven't tried this yet but from what I have found, this should work.
     
    CREATE PROCEDURE GetSectionVisibility
    AS
    BEGIN
    SELECT Field01 = CAST(1 AS BIT) -- Example: 1 (TRUE) means section should be hidden
    END
     

    1. Prepare the Word Document with Content Controls

    1. Open your Word document.
    2. Add content controls to the sections you want to conditionally hide.
      • Go to the Developer Tab in Word (enable it via Word Options if not already visible).
      • Insert Rich Text Content Controls or Plain Text Content Controls around the sections to hide.
      • Assign unique titles or tags to these controls (e.g., Section1, Section2).

    2. Create a SQL Stored Procedure

    • Write a stored procedure that returns a result set with the field you want to check (e.g., Field01).

    ------------------------------------------------

     

     

    ⭐ If this was helpful, please like and mark as a verified answer to help others find this too!

     

     

    Always glad to help! 💯💯💯💯💯

     

    Tom

     

    Follow me on LinkedIn - Thomas Rice, PMP | LinkedIn

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,580

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,909

Leaderboard