0

I am trying to create Word object and open existing word file in web based Domino application. I am able to create the word application and open document when I run the same script in Notes client on Domino server. However I am receiving "Type mismatch" error when I run it through web agent on server.

Version - MS word for MS office 365

HCL Domino server version 11

Following is the Lotusscript code present in the Agent. Agent has "Allow restricted operations with full administrative rights" selected.

Dim offApp as variant

Dim offDoc as variant

Set offApp = CreateObject("Word.Application") --- Word object is created successfully.

Set offDoc = offApp.documents.Open(tempDir & "Test.docx") ---- Error - Type mismatch

Keertika
  • 59
  • 6
  • 1
    Is Office installed on the Domino- Server? Without Office there is no "Word.Application"... – Tode Apr 19 '21 at 15:11
  • 1
    And is it for a background operation? When the agent ends, the object well disappear. AFAIK, the Word file will never be shown on the screen, since the agent runs on the server and not in a browser context. If you want to open a Word application, you'd have to save the file in an Office folder and then use the right URL to start Word. – D.Bugger Apr 19 '21 at 20:49
  • Word must be installed on the server, and IIRC it must be the same bit-ness as the Domino server. I think Domino on Windows is now 64-bit only, so you would need to have a 64-bit version of Word installed on the server. – Richard Schwartz Apr 20 '21 at 02:07
  • Office is installed on the windows server and its 64 bit. My requirement is, I have a link which points to the word template which has macros enabled. When I click on that link, word template should open, update the word document by running the macros available in the template. – Keertika Apr 20 '21 at 07:10
  • 1
    The code you've provided doesn't show how you set `tempDir`. Please show that. The error message suggests that `tempDir` hasn't been set to anything. – Scott Leis Apr 21 '21 at 02:17
  • @Keertika Looks like you have problem in expression `tempDir & "Test.docx"`. Both operands of the expression have to be correct string values. If tempDir is a variant type value and it is set to `Nothing`, then you'll get "Type mismatch" error upon trying to concatenate `Nothing` object type with string "Test.docx" – Rafael Jun 22 '23 at 09:20

0 Answers0