BookmarkSubscribeRSS Feed
Santoshrk
Obsidian | Level 7

Hi,

How to set the editing restrictions for the Word document programmatically using SAS?

The aim is to enable the Read-Only mode but set the password to restrict the editing. 

 

I'm using the below code to set the read-only attributes but would like to protect them with a password.

x attrib -r ".\xyz.RTF" ; *Removes Read Only Attribute ;
%report;
x attrib +r ".\xyz.RTF" ; *Adds Read Only Attribute;

 

Any inputs are much appreciated.

 

Thanks and Regards,
Santhosh

4 REPLIES 4
Santoshrk
Obsidian | Level 7

Santoshrk_0-1613568830490.png

It is possible to Restrict Editing RTF files manually. Please provide some thoughts on doing it programmatically.
Generally, when we develop a report using the tool, it is obvious that we need to add some protection to the output file to restrict editing by others. I'm sure there will be a way to do it, but couldn't able to find anything online.
Thank you!

 

Kurt_Bremser
Super User

That is MS Word internal. As long as you save this as a RTF file, any other software will ignore the (MS-specific) tags and let you happily edit the file.

 

If you want to protect documents, save them as docx and use VBA to set the protection.

Santoshrk
Obsidian | Level 7

Thanks KurtBremser for your inputs on this. 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1505 views
  • 0 likes
  • 3 in conversation