How to automatically open DOC and DOCM file after Download from Edge Browser

Zhu, Ligong 220 Reputation points
2024-07-18T10:50:03.1166667+00:00

User's image

User's image

Hi,

In IE or Edge in IE mode, our code can automatically open a Microsoft doc or docm file we wrote after it is downloaded from the browser. Now in pure Edge, after I added these following entries in windows registry at runtime, it can work intermittently:

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge\AutoOpenAllowedForURLs

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge\AutoOpenFileTypes

HKEY_CURRENT_USER\Software\Policies\Microsoft\Edge\AutoOpenFileTypes

HKEY_CURRENT_USER\Software\Policies\Microsoft\Edge\AutoOpenAllowedForURLs

Basically I added server url to "AutoOpenAllowedForURLs" and "doc" and "docm" to "AutoOpenFileTypes" to both local machine and current user Edge entries.

The problem is that it only works intermittently. Our doc/docm file can always be downloaded in "Downloaded" folder successfully but it won't automatically open 100% of time.

One day it can open automatically after download without any problem then next day we have to click "open" to run it after download. Sometimes after several manual opens, it starts to work again.

I use Edge Version 126.0.2592.68 (Official build) (64-bit), Windows 11 Enterprise version 23H2.

I appreciate if you can take a look.

Microsoft Edge
Microsoft Edge
A Microsoft cross-platform web browser that provides privacy, learning, and accessibility tools.
2,345 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
9,834 questions
0 comments No comments
{count} votes

Accepted answer
  1. Jinxin Wang (Shanghai Wicresoft Co Ltd) 2,180 Reputation points Microsoft Vendor
    2024-07-19T05:43:30.72+00:00

    Hi @Zhu, Ligong,

    Thank you for your reply. The command line code you use to add the policy to the registry is indeed correct. I used the command line code you provided to test before and after Edge started. I successfully reproduced the issue you described, that is, the policy will be successfully refreshed before Edge starts, but it will not be refreshed after Edge starts. So, for our discussion these days, I make the following summary for your reference:

    1. The reason why the "gpupdate /force" command line takes too long to respond is that there are too many policies that have been deployed, and it needs to be forced to update one by one, so it will take several minutes.
    2. Regarding the problem of inconsistent refresh effects before and after Edge starts, I searched for relevant resources and literature, but did not find any official documents to explain this problem. But according to my understanding, this may be related to Edge's policy cache or dynamic loading. Edge will load and cache the current policy when it starts. If the policy is modified after startup, Edge still uses the old policy loaded at startup, so it will not be refreshed (of course, this is for deploying policies on the registry). In addition, some policies may not be loaded dynamically and need to be forced to refresh before they are displayed.
    3. Therefore, no matter you deploy the policy before or after Edge is started, as long as the policy is successfully refreshed and can be correctly displayed at "edge://policy", these policies will work successfully. So, if you think that using "gpupdate /force" before will take a lot of time, you can click the "Reload Policies" button in the upper left corner of "edge://policy", so that the refresh will not take a lot of time (as shown below). Or, if it is convenient for you, you can migrate to the Group Policy Editor to deploy related policies, which can be refreshed dynamically using the Group Policy Editor.

    User's image


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best Regards,

    Jinxin Wang


0 additional answers

Sort by: Most helpful

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.