Shell into Photo Editor

M

Matthew

I have a form which displays a field containing
path/folder and filename in the form :

F:\My Documents\Aquatics-Pools Photos\C-K Aquatics
Photos\Y Pool.jpg

I want to shell into Photo Editor with the specific file
displayed in the form. So in my newbie way I had thought
of the on-click property of a command button like this -

Private Sub Command6_Click()

Shell "C:\Program Files\Common Files\Microsoft
Shared\PhotoEd\PHOTOED.exe Forms![File/Pathname]'field

End Sub

It shells fine of course but to a blank PEditor screen.

Is there a way ?

Many thanks

Matthew
 
E

Exponent

The path to the image file needs to be enclosed in quotes if it contains spaces, so use something like the
following (where 'Filename' is the field containing the full path and filename of the image):

Dim ShellCmd As String

ShellCmd = "E:\Program Files\Common Files\" & _
"Microsoft Shared\PhotoEd\PHOTOED.exe """ & _
Me!Filename & """"

Shell ShellCmd


It's often a good idea to only store the filename in the table and add the path in code. In this way the
database is better 'normalized' (less duplicated/redundant data) and it's easier to move the images to
a new location, eg a different drive or network share, without needing to update every record. One such
approach is to store the images in a path relative to the mdb file itself, then the images can be found
however the database is accessed and without any hard-coded paths. Examples of this are available on our
site.
 
J

John Nurick

Hi Matthew,

You may need to ensure that the long file and folder names in the
command are surrounded with quotes so the command can be parsed
correctly. Try something like

Dim strCmd As String

strCmd = """C:\Program Files\Common Files\Microsoft Shared" _
& "\PhotoEd\Photoed.exe"" "
strCmd = strCmd & """" & Me![File/Pathname] & """"

Shell strCmd

By the way, life is often much simpler if you don't use spaces or
special characters in the names of fields and other objects.


I have a form which displays a field containing
path/folder and filename in the form :

F:\My Documents\Aquatics-Pools Photos\C-K Aquatics
Photos\Y Pool.jpg

I want to shell into Photo Editor with the specific file
displayed in the form. So in my newbie way I had thought
of the on-click property of a command button like this -

Private Sub Command6_Click()

Shell "C:\Program Files\Common Files\Microsoft
Shared\PhotoEd\PHOTOED.exe Forms![File/Pathname]'field

End Sub

It shells fine of course but to a blank PEditor screen.

Is there a way ?

Many thanks

Matthew

John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
 
M

Matthew

Many thanks to Exponent and John for this help. Works
brilliantly !

Much appreciated


Matthew
-----Original Message-----
Hi Matthew,

You may need to ensure that the long file and folder names in the
command are surrounded with quotes so the command can be parsed
correctly. Try something like

Dim strCmd As String

strCmd = """C:\Program Files\Common Files\Microsoft Shared" _
& "\PhotoEd\Photoed.exe"" "
strCmd = strCmd & """" & Me![File/Pathname] & """"

Shell strCmd

By the way, life is often much simpler if you don't use spaces or
special characters in the names of fields and other objects.
I have a form which displays a field containing
path/folder and filename in the form :

F:\My Documents\Aquatics-Pools Photos\C-K Aquatics
Photos\Y Pool.jpg

I want to shell into Photo Editor with the specific file
displayed in the form. So in my newbie way I had thought
of the on-click property of a command button like this -

Private Sub Command6_Click()

Shell "C:\Program Files\Common Files\Microsoft
Shared\PhotoEd\PHOTOED.exe Forms![File/Pathname]'field

End Sub

It shells fine of course but to a blank PEditor screen.

Is there a way ?

Many thanks

Matthew

John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
.
 

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