Solved

Printing PDF Document Programmatically

Posted on 2009-05-05
3
246 Views
Last Modified: 2012-05-06
Dear Experts,

I have a stream which contants the XML document and is transformed using XSL and now i want to send it(stream) directly for printing to my default printer.
I am using Microsoft dynamics NAV, which is very similar to VB 6 but not that much flexible.

Regards
Brij
0
Comment
Question by:brijbmishra
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 500 total points
ID: 24346958
brijbmishra,

See the info in this link:
http://www.experts-exchange.com/Microsoft/Development/MS_Access/Access_Coding-Macros/Q_24312909.html?cid=238#a24117642

Add the published code:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Public Sub PrintFile(byval sFile as String)
    Call ShellExecute(Application.hWndAccessApp, "print", sFile, "", "", 0)
End Sub

...To a Module then call the *SUB* (PrintFile) passing in full pathname.
Like so:
   
    Call PrintFile("C:\YourFolder\YourFile.abc")

This will print the file.

;-)

JeffCoachman
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 25273335
Also please remember that printing the document and printing the pdf will result in the exact same output.

So in may cases, unless you need to save the data as PDF, you print the report but save it as PDF as well.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to transfer Notes from Outlook 2010 to OneNote 2016 16 330
Sharepoint to FTP? 3 86
Microsoft Access Table name 3 68
SCOM logon account permissions? 1 37
Lync meeting or Lync conferencing is what many organizations would like to deploy to allow them save money. But companies are now giving up for various reasons, one of which is that they cannot join external meetings (non-federated company meetings)…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question