print a drawing from another application from access

  • Thread starter klp via AccessMonster.com
  • Start date
K

klp via AccessMonster.com

I have a form, where I want to be able to print a drawing that is used in the
application volvo view. I do not need it to open it but print directly from
my access form. Do I just specify the location in the print command or how
would I go about doing that?

Thanks in advance.
 
K

klp via AccessMonster.com

Great, I will give it a try. One more question though, do I place this in a
module by itself or behind the print button on the form I want to print the
drawing from?
 
D

Daniel Pineault

Create a new module and copy/paste the code there. Then you'd put something
like

ExecuteFile("c:\test.xls", "Print")
or
ExecuteFile(Me.Drawing, "Print")

Where Me.Drawing is the name of a control on your form with the file path
and name to be printed
--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.
 
K

klp via AccessMonster.com

Okay I had created a new module and I figured it would be a command of what
you had put. I put that logic in a macro, which I used the runcode command
and then put ExecuteFile("filename","Print") and call it from my form but I
get an error. What am I doing wrong?

Daniel said:
Create a new module and copy/paste the code there. Then you'd put something
like

ExecuteFile("c:\test.xls", "Print")
or
ExecuteFile(Me.Drawing, "Print")

Where Me.Drawing is the name of a control on your form with the file path
and name to be printed
Great, I will give it a try. One more question though, do I place this in a
module by itself or behind the print button on the form I want to print the
[quoted text clipped - 9 lines]
 
D

Douglas J. Steele

Daniel made a slight mistake.

The syntax is either

Call ExecuteFile("filename","Print")

or

ExecuteFile "filename", "Print"


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


klp via AccessMonster.com said:
Okay I had created a new module and I figured it would be a command of
what
you had put. I put that logic in a macro, which I used the runcode command
and then put ExecuteFile("filename","Print") and call it from my form but
I
get an error. What am I doing wrong?

Daniel said:
Create a new module and copy/paste the code there. Then you'd put
something
like

ExecuteFile("c:\test.xls", "Print")
or
ExecuteFile(Me.Drawing, "Print")

Where Me.Drawing is the name of a control on your form with the file path
and name to be printed
Great, I will give it a try. One more question though, do I place this
in a
module by itself or behind the print button on the form I want to print
the
[quoted text clipped - 9 lines]
Thanks in advance.
 
K

klp via AccessMonster.com

Ha ha, I thought about using the call, but I didn't. Great, I will try that
one.
Douglas said:
Daniel made a slight mistake.

The syntax is either

Call ExecuteFile("filename","Print")

or

ExecuteFile "filename", "Print"
Okay I had created a new module and I figured it would be a command of
what
[quoted text clipped - 20 lines]
 
A

Albert D. Kallal

does that application support right clicking on the file and then print????

(try it....just like if you right click on a word, or excel file, you can
choose print...and it goes to the printer).

IF THE ABOVE works for your particular volvo view application, then you can
use the following line of code to print it from ms-access:


CreateObject("Shell.Application").Namespace(0).ParseName("c:\mypdf\myDoc.pdf").InvokeVerb
("&Print")

Just replace the above pdf file name with whatever the name of the file is
to print....

As mentioned, the above ONLY works if you can right click on the file and
choosing print works....
 
K

klp via AccessMonster.com

Yes I can right click and print. But what about this, say my file name is
different each time. The files come from the same folder but the drawing is
different for every shop order that is created. How do I acknowledge that? I
have a statement that I used to automatically open volo view but it doesn't
print it. The statement is just this OpenDwgFile (Me!DwgFile). Can I use that
instead of going to that specific location?
 
A

Albert D. Kallal

klp via AccessMonster.com said:
Yes I can right click and print. But what about this, say my file name is
different each time. The files come from the same folder but the drawing
is
different for every shop order that is created. How do I acknowledge that?
I
have a statement that I used to automatically open volo view but it
doesn't
print it. The statement is just this OpenDwgFile (Me!DwgFile). Can I use
that
instead of going to that specific location?

Yes, of couse, my sample had the file hard coded, but you woul simply
replace the

"c:\mypdf\myDoc.pdf"

with your value...whatever that value may be (unfortunately, can't read your
mind!!!).
 
K

klp via AccessMonster.com

Well I did that and it only will preview, not automatically print. But I will
look at it again. I may be emailing you back with more questions. Thank you
so much you have been a great help.
Yes I can right click and print. But what about this, say my file name is
different each time. The files come from the same folder but the drawing
[quoted text clipped - 6 lines]
that
instead of going to that specific location?

Yes, of couse, my sample had the file hard coded, but you woul simply
replace the

"c:\mypdf\myDoc.pdf"

with your value...whatever that value may be (unfortunately, can't read your
mind!!!).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top