It's weird. At the New line when it tries to enter printview it gives me this error: "Runtime Error 5918: The property or method is not available on this system."

I searched for this and this seems to be a problem that happened elsewhere also, when the same line of code was written:

HTML Code:
https://social.msdn.microsoft.com/Forums/vstudio/en-US/3b5d4722-84f3-4e0d-b60b-d2d553b9ef46/code-works-in-testing-but-throws-error-in-production?forum=vsto
I tried changing the line a bit, but still the same error:
ActiveWindow.ActivePane.View.Type = WdViewType.wdPrintView
I also tried it on another computer where I work and it still gives me this. I am really confused about what this could be.