Procedures:

For Word or Excel 2019 or higher:

  • Open your file first.
  • From the ribbon menu, click "File" and then click "Save As"
  • Then click "Tools" -> "General Options"
    The image illustrate where is 'General Options' in WinWord
  • Enter your password on the "Password to open" box, and click "OK"
    The image illustrate how to set password in Word or Excel
  • Finally, "Save" your file.