Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / February 2005

Tip: Looking for answers? Try searching our database.

Opening Paint From Within Acces

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Neil - 14 Feb 2005 16:35 GMT
I have a database that stores the pathname pictures in certain fields, and on
my form I have  small thumbnails of those pictures.
My users want to be able to print out the full size pictures if necessary.
My idea is to use code to open up MSPaint and pass the name of the file to
paint so that they can print the picture, but I'm not sure how to achieve
this.
Alternatively, is there any way I can print them directly from Access at
their original size?

Thanks

Neil
John Nurick - 14 Feb 2005 22:36 GMT
Hi Neil,

Try something like

Dim strPaint As String
Dim strPicture As String

strPaint = Environ("SYSTEMROOT") & "\System32\mspaint.exe"
strPicture = "C:\folder\file.bmp"

Shell """" & strPaint & """ """ & strPicture & """", _
 vbNormalFocus

If you add /p before the final quotation mark, e.g.
    ... strPicture & """ /p",
Paint will send the picture straight to the default printer.

That's for using Paint regardless of the user's preferences. If instead
you use something like this:

Dim strPicture As String

strPicture = "C:\folder\file.bmp"
Application.FollowHyperlink strPicture

it will open the picture in whatever is the user's default program for
files of that type.

hell("""C:\Windows\System32\mspaint.exe""  ""C:\Documents and
Settings\John Nurick\My Documents\My Pictures\People.gif""")

>I have a database that stores the pathname pictures in certain fields, and on
>my form I have  small thumbnails of those pictures.
[quoted text clipped - 8 lines]
>
>Neil

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
Neil - 15 Feb 2005 08:09 GMT
Thanks John,

Tried the second option and it worked a treat.

Neil

> Hi Neil,
>
[quoted text clipped - 44 lines]
>
> Please respond in the newgroup and not by email.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.