{{tag>category:"OpenInsight 32-Bit" author:"Dave Ballance" author:"dbakke@srpcs.com's Don Bakke" author:"[url=http://www.sprezzatura.com]The Sprezzatura Group[/url]" author:"Matthew Crozier" author:"Bob Carten"}} [[https://www.revelation.com/the-works|Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community]] ==== Link to Documents outside OI - Best Practice? (OpenInsight 32-Bit) ==== === At 24 JUL 2006 11:41:40PM Dave Ballance wrote: === 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? ---- === At 25 JUL 2006 12:15AM dbakke@srpcs.com's Don Bakke wrote: === 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? dbakke@srpcs.com [url=http://www.srpcs.com]SRP Computer Solutions, Inc.[/url] [img]http://www.srpcs.com/srpicon1.gif[/img] ---- === At 25 JUL 2006 05:47AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote: === 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...) [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] [i]World leaders in all things RevSoft[/i] [img]http://www.sprezzatura.com/zz.gif[/img] ---- === At 25 JUL 2006 06:19PM Matthew Crozier wrote: === 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@ [url=http://www.vernonsystems.com][img]http://www.vernonsystems.com/images/logo_main_ani.gif[/img][/url] ---- === At 25 JUL 2006 11:48PM Dave Ballance wrote: === 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. ---- === At 26 JUL 2006 04:46AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote: === 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... [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] [i]World leaders in all things RevSoft[/i] [img]http://www.sprezzatura.com/zz.gif[/img] ---- === At 26 JUL 2006 06:37PM Matthew Crozier wrote: === 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@ [url=http://www.vernonsystems.com][img]http://www.vernonsystems.com/images/logo_main_ani.gif[/img][/url] ---- === At 26 JUL 2006 08:15PM Dave Ballance wrote: === So how do I get the UNC path with UTILITY ---- === At 27 JUL 2006 12:25PM Bob Carten wrote: === 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 ---- === At 27 JUL 2006 02:00PM Dave Ballance wrote: === That helps and gives me all sorts of ideas about how to be dangerous in other ways. Dave [[https://www.revelation.com/revweb/oecgi4p.php/O4W_HANDOFF?DESTN=O4W_RUN_FORM&INQID=WORKS_READ&SUMMARY=1&KEY=E759F9918D208CD6852571B600144B67|View this thread on the Works forum...]]