Solved

Windows Picture/Fax Viewer-VBA solution & ?

Posted on 2004-08-10
8
1,241 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
ID: 11768627
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
ID: 11768689
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
ID: 11768712
Any further questions?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

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

Expert Comment

by:jacobhoover
ID: 11768771
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
ID: 11768886
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
ID: 11777334
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Specific format 21 181
WMI, model #, retrieving information 10 114
topping2 challenge 13 82
what is the main difference between git clone and fetch ann pull and push commands 2 72
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

910 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

21 Experts available now in Live!

Get 1:1 Help Now