Print a linked word document

larsch
Member Posts: 19
Hi,
I would appreciate very much if anybody could help whith this one.
In the end of a report, my customer wants to print out certain word documents, wich is linked to the actual Items used in the report. We dont want to open the documents, just to print it. If it must be opened, it should be done in the background and after printing, the word instans should be closed again. I have the path to the wordfile and have succesfully opened the word documents using SHELL. After that it should be printed and word should be closed. But there I am stocked.
I have also tried to use the automation functionality for word. But I cant find any guidelines exept in the Developers guide, where the example shows how to create a new word document, but not how to open/print/close an existing.
If you could show me where to find guidelines for this, it would be fine - or perhaps you have a solution "out of the pocket"
Thank you in advance.
I would appreciate very much if anybody could help whith this one.
In the end of a report, my customer wants to print out certain word documents, wich is linked to the actual Items used in the report. We dont want to open the documents, just to print it. If it must be opened, it should be done in the background and after printing, the word instans should be closed again. I have the path to the wordfile and have succesfully opened the word documents using SHELL. After that it should be printed and word should be closed. But there I am stocked.
I have also tried to use the automation functionality for word. But I cant find any guidelines exept in the Developers guide, where the example shows how to create a new word document, but not how to open/print/close an existing.
If you could show me where to find guidelines for this, it would be fine - or perhaps you have a solution "out of the pocket"

Thank you in advance.
LARSCH
0
Comments
-
Did you search the forum for this? I know it has been discussed. Off hand I don't remember if a solution was ever found.0
-
Yes, I have searched mibuso, Navision guidelines, the internet in general, Microsoft partnersource etc. but none of the topics I found, solve exactly this problem. If I could find some developer guidelines for the Automation functionality for word, I guess I would be able to find a solution, because there is a print() command and a close command, so I guess there may be a way to open a specific word document too. But this is just a guess.LARSCH0
-
An alternative could be to use command line tool ClassExec, and then use NAV SHELL command with the following syntax:
classExec %1 --command "[FileOpen(\"%1\")][FilePrint 0][FileExit 2]"
All found here here after 3 min of googling around
SlawekSlawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-030 -
Hi Slawek,
There you got me!
You see, I am a simple NAV C/AL-programmer. Therefore I am searching for a solution I can use in C/AL, and have found none until now. (ClassExec-commands can’t be used in C/AL).
So if I understand you correctly, you suggest that I get a small executable programmed with the exec commands and then call this with a C/AL-SHELL command in my report. Right?
It should, though, be possible to pass the path to the document!LARSCH0 -
Hi Slawek,
I tried classexec and it works fine
I can sent the parameters with my SHELL command, so everything's OK.
Thank you very much for your help. \:D/LARSCH0 -
Dear Larsch,
Can you please post your code? Thanks.
I tried. but I still have no idea how do it.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K 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
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions