Step 1: List All Installed Office License Keys
Open Command Prompt as Administrator and run the command below. Note the "Last 5 characters of installed product key" for any trial, KMS, or Grace key you want to remove:
cd "C:\Program Files\Microsoft Office\Office16"
cscript ospp.vbs /dstatus
Step 2: Uninstall the Old Key & Activate Your Genuine Key
Replace XXXXX with the 5-character key shown in Step 1, then open Word and enter your genuine ANYSOFTHUB license key:
cscript ospp.vbs /unpkey:XXXXX