New topic: GetFolderItem
<http://forums.realsoftware.com/viewtopic.php?t=46561> Page 1 of 1 [ 4 posts ] Previous topic | Next topic Author Message ronw Post subject: GetFolderItemPosted: Mon Jan 14, 2013 4:03 pm Joined: Fri Oct 20, 2006 12:33 pm Posts: 14 Mac OS 10.6.8 RS 2011.4.3 I want to open a text file and load the contents into a TextArea. Dim f as FolderItem f=GetOpenFolderItem( "application/rtf;text/plain") If f <> Nil Then If ta_PartyFoodList.Open(f) then else MsgBox "Open Failed" End if End if File types have been defined in the IDE. When this code is run the MsgBox always comes up with "Open Failed". When the msg box is dismissed the TextArea has the contents of the file. Why is the failed message being sent? Also, if I try to open a .rtf file the content displays the rtf code rather than the text. _________________ Thanks, Ron Top Bob Keeney Post subject: Re: GetFolderItemPosted: Mon Jan 14, 2013 6:50 pm Joined: Fri Sep 30, 2005 11:48 am Posts: 3366 Location: Lenexa, KS The function ta_PartyFoodList.Open is returning false. Check to make sure it's returning true if it actually handles the file. _________________ Bob K. Start BKeeney Season early with Real Studio training day at Real World 2013. http://www.bkeeney.com/realbasic-training-section/training-2013 Top ronw Post subject: Re: GetFolderItemPosted: Tue Jan 15, 2013 9:08 am Joined: Fri Oct 20, 2006 12:33 pm Posts: 14 Bob Keeney wrote:The function ta_PartyFoodList.Open is returning false. Check to make sure it's returning true if it actually handles the file. It always returns False, but yet the text is placed in the TextArea. That is the issue, why is the text entered into the field if the Open function failed? _________________ Thanks, Ron Top pixe656 Post subject: Re: GetFolderItemPosted: Tue Jan 15, 2013 9:20 am Joined: Wed May 20, 2009 11:02 am Posts: 398 Your code works for me. I don't get the error message. I am on windows 7 using RB 2011r4.3 Pixe _________________ Using RS2011r4.3 on Windows7. Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 4 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
