Word Office Add in: Best way to handle editable ranges inside a non editable portion of a Word document?

Lauro Colasanti 101 Reputation points
2024-01-08T18:08:31.7933333+00:00

Hi,

I have an old Word template project written in VBA that was used to insert in the rows of a table in a Word document

  1. new blocks of document.
  2. old blocks of document saved on a database (Access)

Each block has some parts that are editable and some that are not. The table in non editable.

I used to solve the problem using Content Controls.

I had:

  • the whole table was wrapped by a wdContentControlGroup, with properties:
    • LockContentControl = true
      • LockContents = true
  • each block had one or more wdContentControlRichText, with properties:
    • LockContentControl = true
      • LockContents = false

Every time the user decided to insert a new block the wdContentControlGroup property LockContents was first changed to false and then to true again.

Can I do the same with an Office Word Add-In? There are better way to accomplish the work? There is a way to render non editable ranges of a document?

I used to save each edited block in its own Word file. When the user wanted to insert a specific block, I retrieved the file, the I copied the range and inserted it in the desidered row of the document.

There is another, better way to accomplish this? Can I save only the range block? In which code? How to handle it?

(I'll probably abandon Access because I want the back end of the DB to be both local or on line.)

Thanks for you advice, I'm completely new with the Office Add-Ins technology.

Lauro

Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,989 questions
Word Management
Word Management
Word: A family of Microsoft word processing software products for creating web, email, and print documents.Management: The act or process of organizing, handling, directing or controlling something.
932 questions
Microsoft 365 Publishing
Microsoft 365 Publishing
Microsoft 365: Formerly Office 365, is a line of subscription services offered by Microsoft which adds to and includes the Microsoft Office product line. Publishing: The process of preparing, producing, and releasing content for distribution or sale.
623 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.