A family of Microsoft word processing software products for creating web, email, and print documents.
No, you cannot get out of Protected View by doing anything in macro code. The solution is to avoid opening in Protected View. There are two ways to do this, but the first one (although simpler) could be dangerous.
- Go to File > Options > Trust Center > Trust Center Settings > Protected View. Clear the check mark for "Enable Protected View for files originating from the Internet". As the text above that check box says, you could be exposing your computer to security threats.
- As a better solution, when you save each converted file on your computer, open its Properties dialog in File Explorer and check the box for "Unblock". That removes the bits that tell Windows and Word that the file came from another computer, so it will open without Protected View. Caveat: don't unblock documents whose origins are unknown or uncertain. There has recently been a sharp increase in the number of attacks, especially ransomware, that are delivered by malicious code in Office documents. These documents may arrive as attachments to emails that are spoofed to look like they came from someone you know, so be careful!