Printing an Autocad drawing from Access using viewer

Posted on 2012-08-16
Medium Priority
Last Modified: 2012-09-30
I would like to print a copy of a drawing for a job with the job sheet. I do this with PDF's by storing the address of the file.

Is there a way to do this with Autocad and ideally solidworks viewers.

i.e. if the viewers are installed on the PC is there any way I store a reference to a drawing file  and automatically print the drawing to save them creating PDFs for each drawing.
Question by:donhannam
LVL 74

Accepted Solution

Jeffrey Coachman earned 2000 total points
ID: 38303531
A bit confused about exactly what you have here and what you want...

In any event,  you can print just about any exiting file from VBA using code like this in a module:

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

Then, if you have the full path to the file in a field on a form (here my name for this field is called "FileData"), you can use code like this to print the file from the form:

Dim result As Long
result = ShellExecute(0&, "print", Me.FileData, vbNullString, vbNullString, vbHidden)

Code from here:


Author Closing Comment

ID: 38449460
Thanks Jeff,

I am waiting for more info from client but think what you are saying will work - need to close so I can ask another question

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

807 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