I'm back after almost a year of not being a works member so if I missed something I apologize. I searched on UNC and runwin and other things and still can't find an obvious answer to my question.
I need to allow my users to reference documents outside OI. The usual stuff - MS-Excel, MS-Word, PDF, etc. So I put an edittable control bound to MV fields on the form and I plan to store the path to the document. I'd like to restrict the directories from which they can attach documents by setting their initial root - any subfolder under that is okay. I tried using flags in the Utility_FileDlg function to turn off the ability to move up from the initial directory I set. It didn't work.
So, two questions. One, are the VB Scripts linked to Utility_??? still the best way to interface with Win32 and allow a user to navigate to a file. Two, does anyone have an example of how to use flags? My reading of the MS-SDK says that if I set flags to 8 that should disable the button that allows navigating up from the initial directory. Obviously, I'm wrong. Anyone know what I should be doing?
Dave,
How exactly are you trying to represent the documents to your end users? Are you allowing the client apps (i.e. Word, Excel, etc.) to load as independent programs or did you want to display these documents natively within OI?
Dave,
For OI32 you should be using Utility( "CHOOSEFILE" … ) - the VB dialogs were really an OI16-]Win32 bridge …
I don't believe the OFN_NOCHANGEDIR flag (8) will do what you want. It doesn't restrict the user from navigating up the path - it simple stops the "current directory" from being changed when the user selects a file. (Utility CHOOSEFILE actually enforces this by default…)
World leaders in all things RevSoft
Mike showed us the other day that we can use the Shell.Explorer.1 control to embed such documents into an OI window. Unfortunately I can't remember that single line of code that loads the control. Any ideas?
Cheers, M@
[img]http://www.vernonsystems.com/images/logo_main_ani.gif[/img]
Don, I was planning to take the simple route. Just let the target application display the docs. I just saw the note from Matthew Crozier though and it presents interesting ideas. In some cases I'd be fine just displaying the docs.
I'm open to suggestions. I have the need for display-only and for open to update.
M@,
pre.code {
background-color: #E5E5E5;border: 1px solid #000000;width: 640px;padding: 5px;font-family: courier, verdana, arial, serif;margin: 0px 10px auto;}
docID=c:\somefolder\somedoc" call send_Message( @window : ".OLECONTROL_1". "OLE.Navigate2", docID )Will embed something like a word doc in a Shell.Explorer OLE control - is that the one you were thinking of?
You can just specify a folder path as well and you'll get a full listing - then you can double click on the folders to drill down, or simply open files…
World leaders in all things RevSoft
Ahh, ok! I thought that was just a web control. Turns out we've been using this all along, referencing it as 'about:blank' instead of 'Shell.Explorer.1'. Didn't realise it can load other documents types as well - nice!
.
Thanks, M@
[img]http://www.vernonsystems.com/images/logo_main_ani.gif[/img]
So how do I get the UNC path with UTILITY
Hi Dave
I looked at the old vbScript from OI375 ( see OINETWRK.VBS ), morphed it to OI 7.21 OLE syntax. Error handling is left as an Exercise for the user.
HTH
Bob
Function get_Unc(path)
If Assigned(Path) Then drvPath=Path Else drvPath='
If drvPath Else drvPath=drive()
Ans="
fso=OleCreateInstance("Scripting.FilesystemObject")
absolute_path=fso-]GetAbsolutePathName(drvpath)
DriveName=fso-]GetDriveName(absolute_Path)
oDrive=fso-]GetDrive(DriveName)
DriveLetter=oDrive-]DriveLetter
ShareName=oDrive-]ShareName
oDrive='
fso='
ans=absolute_path
ans1,Len(DriveName)=Sharename
RETURN ans
That helps and gives me all sorts of ideas about how to be dangerous in other ways.
Dave