Word Managemant on ServiceTier
entwicklerdotnet
Member Posts: 4
Hi,
I have to use word management on jobqueue to create word documents and send by e-mail.
First of all I know this topic, but hope it's only up to word2003:
https://support.microsoft.com/en-us/kb/257757
I develop with Windows 10, NAV2016, Word 2016.
I created a copy of codeunit 5054 Word Management and set all dotnet variables to runonclient No.
Also I created a small codunit, which uses one existing segmenlt line with attachment to create one word document and send this by e-mail.
If I run this solution client side, all runs fine.
With my serverside word management codeunit I get the follwoing error:
The error happens after the second line below:
WordDocument := WordHelper.CallOpen(WordApplication,MainFileName,FALSE,FALSE);
WordDocument.MailMerge.MainDocumentType := 0;
These 2 lines are original out of codeunit 5054 function ExecuteMerge.
Maybe when running on server the nst does not the same casting C/AL to .net like the rtc?
Any ideas are welcome.
Thanks
Andreas
I have to use word management on jobqueue to create word documents and send by e-mail.
First of all I know this topic, but hope it's only up to word2003:
https://support.microsoft.com/en-us/kb/257757
I develop with Windows 10, NAV2016, Word 2016.
I created a copy of codeunit 5054 Word Management and set all dotnet variables to runonclient No.
Also I created a small codunit, which uses one existing segmenlt line with attachment to create one word document and send this by e-mail.
If I run this solution client side, all runs fine.
With my serverside word management codeunit I get the follwoing error:
A call to System._ComObject.set_MainDocumentType failed with
this message: The type of one or more arguments does not match
the method's parameter type.
All word objects are instantiated serverside, also the two documents (.DOC /.HTM) are created serverside.this message: The type of one or more arguments does not match
the method's parameter type.
The error happens after the second line below:
WordDocument := WordHelper.CallOpen(WordApplication,MainFileName,FALSE,FALSE);
WordDocument.MailMerge.MainDocumentType := 0;
These 2 lines are original out of codeunit 5054 function ExecuteMerge.
Maybe when running on server the nst does not the same casting C/AL to .net like the rtc?
Any ideas are welcome.
Thanks
Andreas
0
Answers
-
AFAIK MS Office continues to be supported as a client-side application only. You may get some things to work thru a service (I've had limited success with Excel automation on NAS) but you are basically on your own.
There are no bugs - only undocumented features.0 -
Did you start your client on the service tier server for testing? Could be that there are different versions of Office/Word installed.0
-
Client runs as long as the variable is runonclinet=yes, if set to no the same arror appers. only office2016 installed0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
