web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Word COM objects and extends RunBaseBatch class RunOn Server

(0) ShareShare
ReportReport
Posted on by

 

Hi dear ... all!

I have an "extends RunBaseBatch" class, where are processed some data and "exported" in a Word document (template based). So when i ran this code on client (RunOn property : Client) all is well. But when i'm trying to run it on server (RunOn property : Server) it returns an error after line bmaks = document.bookmarks(); 

[...]

Error executing code: COM object not initialized.

(S)\Classes\COM\bookmarks

[...]

Someone had such experience?

I want to mention that I have the MS Office installed on server and Word object seems to be successfully initialized.

after some investigations  ...

documents   = word.documents(); 

document    = documents.add(template);

after this sequence : document  = null

document    = documents.add();

after this sequence : document  = _Document

WHY? if template exists ... template = "D:\AxProjects\TimeCards\TimeCard.dotx"

 

*This post is locked for comments

I have the same question (0)
  • Wim Van hoorde Profile Picture
    on at

    Victor,

    I come accross the same issue. What freigthens me a bit is that I re-coded everything to .NET assembly calling the MS.Word server side. I did what I needed to do (assembly signing and so on).

    Client-side this works fine, server-side nevertheless I receive a ClrObject error. Which brings me to the idea that it might not be the way of accessing Word which causes the issue, but rather the fact that Word is called server-side which might simply not be supported (hope not).

    Were you able to solve it?

    Regards,

    Wim.

  • HAMDAOUI Mohamed Amine Profile Picture
    110 on at

    Hello Vim, Victor,

    I'm facing the same problem. Have you found any solution for this problem? Thanks a lot for your reply

    Regards,

    Mohamed Amine

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans