Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with Shell and nconvert

Status
Not open for further replies.

Blackshark

Programmer
May 7, 2002
48
GB
Hi,

First - I have tried to do a few searches regarding Shell and ShellWait etc... so apologies if this is simple and I have missed something.

The problem - I am using a dos program called nconvert to convert tif images to gifs, so Access 2003 can display them within a picture object. Within my VBA code I want to call it when ever an image is required.

I can run the following in a command line and it works fine:

C:\Documents and Settings\All Users\Application Data\XP RTM TIP Database>nconver
t -quiet -out gif -o "H:\Quality Assurance\TIP Databases\test.gif" "C:\Documents
and Settings\All Users\Application Data\XP RTM TIP Database\Form_Store\blank.ti
f"

If the H:\.... is called str_output and the C:\doc.... is called str_input - how do I write a line in VBA to call the program?

I have tried:

ShellWait str_ConvertAppLocation & " -quiet -out gif -o """ & str_output & """ """ & str_input & """, 1"

str_ConvertAppLocation is set to "C:\Documents and Settings\All Users\Application Data\XP RTM TIP Database\nconvert.exe"


No joy. A black window appears for 0.1s and thats it.

Help gratefuly received.

Regards Tim
 
Sorted it!!! nearly lost all my hair though.

Regards Tim

Function GetAnImage(str_FormTypeName As String, lint_IDNo As Long)
'Get a forms images from the network (if available)
'ShellWait str_ConvertAppLocation & " -out gif -o """ & str_LocalImageName & """ """ & str_NetworkImageName & "", 0

Dim str_ImageLocation As String
Dim str_LocalLocation As String
Dim str_NetworkImageName As String
Dim str_LocalImageName As String
Dim str_ConvertAppLocation As String

str_ImageLocation = DBProperty("NetImageDir_" & str_FormTypeName)
str_LocalLocation = DBProperty("LocalImageDir_" & str_FormTypeName)
str_ConvertAppLocation = DBProperty("NConvertAppLocation")

If ImageRequired(str_LocalLocation, lint_IDNo) = True Then
If ImageAvailable(str_ImageLocation, lint_IDNo) = True Then
If FolderNeeded(str_LocalLocation, lint_IDNo) Then
MkDir str_LocalLocation & ImageFolder(lint_IDNo)
End If
StatusBarUpdate "Images for " & str_FormTypeName & " form : record " & lint_IDNo & " : Downloading Front Image"
str_NetworkImageName = str_ImageLocation & ImageFolder(lint_IDNo) & "\" & ImageName(lint_IDNo) & "_f.tif"
str_LocalImageName = str_LocalLocation & ImageFolder(lint_IDNo) & "\" & ImageName(lint_IDNo) & "_f.gif"
ShellWait str_ConvertAppLocation & " -out gif -o """ & str_LocalImageName & """ """ & str_NetworkImageName & "", 0

StatusBarUpdate "Images for " & str_FormTypeName & " form : record " & lint_IDNo & " : Downloading Back Image"
str_NetworkImageName = str_ImageLocation & ImageFolder(lint_IDNo) & "\" & ImageName(lint_IDNo) & "_b.tif"
str_LocalImageName = str_LocalLocation & ImageFolder(lint_IDNo) & "\" & ImageName(lint_IDNo) & "_b.gif"
ShellWait str_ConvertAppLocation & " -out gif -o """ & str_LocalImageName & """ """ & str_NetworkImageName & "", 0
StatusBarUpdate "Images for " & str_FormTypeName & " form : record " & lint_IDNo & " : Downloaded"
Else
StatusBarUpdate "Images for " & str_FormTypeName & " form : record " & lint_IDNo & " is unavailable"
End If
Else
StatusBarUpdate "Images for " & str_FormTypeName & " form : record " & lint_IDNo & " already downloaded"
End If
End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top