Printing notepad file using SHELL

nnohr
Member Posts: 18
Hi,
I would like to print a notepad file from NAV. I can print the file, but I do not want it displayed on the screen that notepad open and print the file.
My command:
param := 'C:\Program Files\NNIT\DKEXE 6.0 A Development\DKEXE.BON';
SHELL("C:\Windows\System32\notepad.exe",STRSUBSTNO('/p "%1"',param));
Can anyone help med?
Thank you in advance.
I would like to print a notepad file from NAV. I can print the file, but I do not want it displayed on the screen that notepad open and print the file.
My command:
param := 'C:\Program Files\NNIT\DKEXE 6.0 A Development\DKEXE.BON';
SHELL("C:\Windows\System32\notepad.exe",STRSUBSTNO('/p "%1"',param));
Can anyone help med?
Thank you in advance.
0
Comments
-
Or you can open the command promt and send below command
'notepad /p '+ '<your txt file path>'
0 -
You could use the Run-method of the 'Windows Script Host Object Model'.WshShell Automation type, but Notepad will show a message box where the user can abort the printing anyway.0
-
mohana_cse06 wrote:Or you can open the command promt and send below command
'notepad /p '+ '<your txt file path>'
Hi mohana_cse06,
I have tested with command prompt and it "works". The problem is, that it is after posting a sales order and after calling command prompt, I got an error, that the sales order cannot be found - probably because it has been posted.0 -
I guess you are writing in wrong place..
Where did you write the code?0 -
mohana_cse06 wrote:I guess you are writing in wrong place..
Where did you write the code?
I made a box solution where I need to print a file immediately after posting a in Navision. It must occur after posting, but if I do, then there are problems because another program is called to print the file.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