Solved

Windows Picture/Fax Viewer-VBA solution & ?

Posted on 2004-08-10
8
1,240 Views
Last Modified: 2008-01-09
The following code accomplishes opening the Windows Picture & Fax Viewer, to a point. Hope part 1 helps someone else:

If UserForm1.OptionButton4.Value = True Then
For k = 0 To 8 Step 1
If ArrayList3(k).Value = True Then
Set fso = New FileSystemObject
Set objFile = fso.GetFile("" & drive & ":\ClientDocs\" & filename & _
"\" & filename & "" & ArrayList2(k) & "\" & filename & "" _
& ArrayList1(k) & ".jpg")
Shell "rundll32.exe C:\WINNT\System32\shimgvw.dll,ImageView_Fullscreen " & _
"" & objFile & "" '"c:\ClientDocs\AbelDanielle\AbelDanielleDDForm\AbelDanielleDD.jpg"
End If
Next k
End If

The routine loops through finding the auto "checked" .jpg images on file and lo and behold the Viewer opens and flahes through the 4 (in my test case) files...my question is this: after the 4th image appears, the "back" arrow does not bring up image 3,2 or 1...how do I get the viewer to remember the 1st three images? Would this be done via an array of some type? Hey, at least I got this far!

Thanks,
Ron
0
Comment
Question by:ronaldj
  • 4
  • 3
8 Comments
 
LVL 7

Accepted Solution

by:
jacobhoover earned 100 total points
Comment Utility
All teh images are located in a different directory.. So I belive you are out of luck with this approach.  I belive the viewer is just showing you the current objects in the folder it can understand.  I think you would have to copy the images to a temp directory for browsing, if you are required to use the MS Viewer.  You could also just use an Image or Picture control to display the pictures on your own form.  Then you could just have an array of file names w/ complete paths and an index to hold the current location with 2 command buttons for next and previous.
0
 

Author Comment

by:ronaldj
Comment Utility
Basically agree, maybe this is even simpler. Here's what I did: with OptionButton4=true, Delete files routine (& KillProperly) are run to empty the content of c:\DocView...

If UserForm1.OptionButton4.Value = True Then
Sub DeleteFiles()
' DeleteFiles Macro
' Macro recorded 8/10/2004 by ronald j. usauskas
'Loop through all the files in the directory by using Dir$ function
Dim MyDKFile As String
MyDKFile = Dir$("c:\DocView\*.*")
Do While MyDKFile <> ""
    KillProperly "c:\DocView\" & MyDKFile
    'need to specify full path again because a file was deleted 1
    MyDKFile = Dir$("c:\DocView\*.*")
Loop
End Sub

Public Sub KillProperly(Killfile As String)
    If Len(Dir$(Killfile)) > 0 Then
        SetAttr Killfile, vbNormal
        Kill Killfile
    End If
End Sub
'******************************************
now, with the CopyFile included and the reference to C:\DocView, works just great!

For k = 0 To 8 Step 1
If ArrayList3(k).Value = True Then
Set fso = New FileSystemObject
Set objFile = fso.GetFile("" & drive & ":\ClientDocs\" & filename & _
   "\" & filename & "" & ArrayList2(k) & "\" & filename & "" _
   & ArrayList1(k) & ".jpg")
fso.CopyFile "" & objFile & "", "c:\DocView\"
End If
Next k
UserForm1.Hide
Shell "rundll32.exe C:\WINNT\System32\shimgvw.dll,ImageView_Fullscreen " & _
"c:\DocView"
0
 
LVL 7

Expert Comment

by:jacobhoover
Comment Utility
Any further questions?
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:ronaldj
Comment Utility
Kinda think I answered my own question didn't I.
0
 
LVL 7

Expert Comment

by:jacobhoover
Comment Utility
Actually, I gave you two suggestions as you had not well defined what exactly the requirement was and then you made the decision as to which of the two choices you prefered and went with it.  No arguments, but you application is now working as I stated it would. =/
0
 

Author Comment

by:ronaldj
Comment Utility
I really do appreciate your input. The solution I came up with was about an hour after I posted my original query. Yes, you gave me 2 suggestions but the "deed" was already done. I think this is verified by your suggestion vs my response(in code) time. Heck, if could program that quick (or type for that matter) I wouldn't need to be on this board! I think you deserve something for your interest and response...I'm new to this, how do I give you "something" of the 250 points?
0
 
LVL 7

Expert Comment

by:jacobhoover
Comment Utility
I would agree to a reduced number of points.  The issue is is that I saw a question and I responded to it.  If in further instances you solve you own question, you have to come out here and cancel it or you are committed into responding.  As far as reducing the points, I am not sure but you could always post a request for the reduced value and let it sit untill it goes "stale"
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

RIA (Rich Internet Application) tools are interactive internet applications which have many of the characteristics of desktop applications. The RIA tools typically deliver output either by the way of a site-specific browser or via browser plug-in. T…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now