79672139

Date: 2025-06-19 13:38:06
Score: 0.5
Natty:
Report link

As @jonsson pointed out on the comment, from VBA Application.Options.UseLocalUserInfo provides getters and setters for user info adjustments*. Link to the documentation.*

C# equivalent for this functionality is provided via Options.UseLocalUserInfo in Microsoft.Office.Interop.Word namespace. Link to the documentation.

In this specific situation following approach worked for me.

using Word = Microsoft.Office.Interop.Word;

public class MyClass {

    private Word.Application wordApp;

    public void MyFunction{
        if(this.wordApp == null){
            object word = System.Runtime.InteropServices.Marshal.GetActiveObject("Word.Application");
            this.wordApp = (Word.Application)word;
        }
        this.wordApp.Options.UseLocalUserInfo = true;
    }

}
Reasons:
  • Whitelisted phrase (-1): worked for me
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @jonsson
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Kasun Nimantha