Word needlessly asking for license credentials when using office interop API.

Copper Contributor

If there is a better place to ask help for this problem, please let me know.

 

I have an app, c#, that uses Office.Interop API to run word.  The app works fine when run under an admin account.  The app searches through a word docx for certain phrases and displays the locations.

 

When running under a non-admin account, the search works fine, but cannot display the results.  Instead, the app asks for the user to log into their Microsoft account or to enter the product key for word. The user is licensed for word 365 and has no problem running word.   I do not know enough about the licensing to figure out why the app is not working.   The user has only been able to obtain the last 5 letters of the word 365 product key using:

 

 

cscript “C:\Program Files\Microsoft Office\Office16\OSPP.vbs” /dstatus

 

 

Is there some function in the office interopt API that can obtain the existing credentials and use them when opening word?  The arguments to

 

 

oWord.Application.Documents.Open(

 

 

do not include any credential information.  Just guessing, I asked the user to contact their IT specialist and see if the app can be allowed to run as admin, but I do not understand why that is necessary.  If the user can run word, why cannot the C# app access word as well?

 

Thank you for looking!

0 Replies