If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Open jpeg file with MS Picture Manager from db A2003
I am using the Common FileOpen Dialog together with Shell Execute to open a
jpeg file from the folder called “Images” in the directory containing the database. I have code to open MS Picture Manager from db. Please point me to how I can combine both sets of code to open the jpeg files with MS Picture Manager by browsing to the folder called “Images” in the directory containing the database. Folder “Images” contains subfolders for photos arranged according to track name and year. The reason for using MS Picture Manager is to see either thumbnails or the filmstrip view for easy navigation to all the photos for the selected folder. See code below Dim stAppName As String Dim strFilter As String Dim strInputFileName As String ' Open a file dialog box for jpeg and bmp files strFilter = ahtAddFilterItem _ (strFilter, "Jpeg Files (*.jpg)", "*.JPG") strFilter = ahtAddFilterItem _ (strFilter, "Windows Bitmap Files (*.bmp)", "*.BMP") 'set FileOpenSave to open at the folder called ‘Images in the database directory 'set the text for the title of the FileOpen dialog box 'set the initial directory to where the ‘database is located on user's computer 'Now actually call to get the file name. strInputFileName = ahtCommonFileOpenSave( _ Filter:=strFilter, _ OpenFile:=True, _ InitialDir:=CurrentProject.Path & "\Images", _ DialogTitle:="Select the picture to open..", _ Flags:=ahtOFN_HIDEREADONLY) Call fHandleFile(strInputFileName, WIN_MAX) ** The code below will start Picture manager from the database, but only opens to the last used folder. stAppName = "C:\Program Files\Microsoft Office\OFFICE11\OIS.EXE" Call Shell(stAppName, vbNormalFocus) ** How to combine with the code above to open the specified file? |
#2
|
|||
|
|||
You need to pass the name of the file when you shell out to Picture Manager.
In order to handle the possiblities of spaces in the file name, you need to enclose it in quotes. Try something like: If Len(strInputFileName) 0 Then stAppName = "C:\Program Files\Microsoft Office\OFFICE11\OIS.EXE " & _ Chr$(34) & strInputFileName & Chr$(34) Call Shell(stAppName, vbNormalFocus) End If I'm checking the length of strInputFileName to ensure that you actually selected a file in the dialog. Note the blank after .EXE when definining stAppName -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Liz James" wrote in message ... I am using the Common FileOpen Dialog together with Shell Execute to open a jpeg file from the folder called "Images" in the directory containing the database. I have code to open MS Picture Manager from db. Please point me to how I can combine both sets of code to open the jpeg files with MS Picture Manager by browsing to the folder called "Images" in the directory containing the database. Folder "Images" contains subfolders for photos arranged according to track name and year. The reason for using MS Picture Manager is to see either thumbnails or the filmstrip view for easy navigation to all the photos for the selected folder. See code below Dim stAppName As String Dim strFilter As String Dim strInputFileName As String ' Open a file dialog box for jpeg and bmp files strFilter = ahtAddFilterItem _ (strFilter, "Jpeg Files (*.jpg)", "*.JPG") strFilter = ahtAddFilterItem _ (strFilter, "Windows Bitmap Files (*.bmp)", "*.BMP") 'set FileOpenSave to open at the folder called 'Images in the database directory 'set the text for the title of the FileOpen dialog box 'set the initial directory to where the 'database is located on user's computer 'Now actually call to get the file name. strInputFileName = ahtCommonFileOpenSave( _ Filter:=strFilter, _ OpenFile:=True, _ InitialDir:=CurrentProject.Path & "\Images", _ DialogTitle:="Select the picture to open..", _ Flags:=ahtOFN_HIDEREADONLY) Call fHandleFile(strInputFileName, WIN_MAX) ** The code below will start Picture manager from the database, but only opens to the last used folder. stAppName = "C:\Program Files\Microsoft Office\OFFICE11\OIS.EXE" Call Shell(stAppName, vbNormalFocus) ** How to combine with the code above to open the specified file? |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ODBC | Wade | General Discussion | 1 | February 13th, 2005 07:46 AM |
Office 2003 uninstall/reinstall problems | Jerryn3 | Setup, Installing & Configuration | 2 | August 2nd, 2004 03:39 PM |
You do not have exclusive access... ERROR | Robin | General Discussion | 1 | July 6th, 2004 01:18 AM |
Product Key for Office XP | P.G.Indiana | Setup, Installing & Configuration | 1 | June 7th, 2004 03:22 AM |
Productkey problem when installing office 2003 on network | Stefan Schreurs | Setup, Installing & Configuration | 1 | June 1st, 2004 11:16 PM |