I was wondering about a way (in Access) to accomplish the same thing as what
gets done when clicking the Print command from the right-click dropdown.
I am aware of ways to print reports from within access, but the files I am
looking to print are not reports. I am also aware of the ShellExecute API
(which is the current method that I use), but am trying to devise a way to
print these various files without having the user open the file and then
click the print button.
As the OS can apparently print a file without opening it (or open the file
and call the print dialog without user intervention, and close the file
after), I was hoping maybe there was a way to access that particular OS
procedure via Access (perhaps an API?).
I think though, that if this were possible, there would be a lot more people
doing it.
I suppose I can move to the Windows newsgroup and see about a possible
script that can be called from vba, but I was hoping to find something
directly in access.
Thanks for the suggestions.
--
Jack Leach
www.tristatemachine.com
- "First, get your information. Then, you can distort it at your leisure."
- Mark Twain
"Allen Browne" wrote:
> You might try asking this question in one of the Windows newsgroups. This
> group discusses Microsoft Access, the desktop database.
>
> If you are trying to print an Access report, you can drag it from the
> Database Window (or Nav Pane in A2007) to the Windows desktop to open it
> directly. Or, you can create a macro to print the report directly, and
> create a shortcut to the macro.
>
> If VBA code, you can FollowHyperlink to start the registered file type, or
> you can ShellExecute:
> http://www.mvps.org/access/api/api0018.htm
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "dymondjack" <dymondjack at hot mail dot com> wrote in message
> news:57E452E6-0FEC-41F8-9B67-(E-Mail Removed)...
> > Hello all, TIA for any input
> >
> > Is it possible to access the Print command that can be found when
> > right-clicking a printable file?
> >
> > I've got a document system that contains various different filetypes
> > (mostly
> > xls, doc, pdf, dwg and edwg files), and I would like to be able to have
> > the
> > users open the Print Dialog without having to open the file to print it.
> >
> > Any ideas? I haven't been able to come up with much online, just examples
> > of how to print specific filetypes.
> >
> > In a worst case scenario I can evalute the filetype via code and run the
> > appropriate function for that type, but if it's possible to somehow read
> > the
> > registry for the filetype (see if it has an associated 'Print' command)
> > and
> > execute that command, that would be great.
> >
> > Thanks again!
> >
> > --
> > Jack Leach
> > www.tristatemachine.com
> >
> > - "First, get your information. Then, you can distort it at your
> > leisure."
> > - Mark Twain
>
>