Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 8th, 2004, 05:07 AM
Authorized User
 
Join Date: Dec 2004
Posts: 67
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ALEX_GRIM
Default OPEN DIALOG.... NOW !!!!!!!!!!!!

OK. i've been trying for days to get this, and i'm about to strangle someone. i had visual studio 2005 beta installed..... MY FIRST MISTAKE.
so i got to reinstall xp, then visual basic6. now the same problem....
my common dialog wont open a file in my text editor.... instead it's opening the full path, (or rather DISPLAYING the path to the file i select). i finally got to figure out how to write a "save file command" or whatever you call it, but my open file isn't working, and i've been to a hundred of theese kinds of forums, and tutorial, faq, help, knowlege base sites, because i didn't want to bother anyone else if i could figure it out, but i give up. here's my latest attemt at the code, if someone can just paste a simple version of the working code in reply, i'd be gratefull. please do not show me a big fancy, multi-function code-guru version, i need to see what the bare minimum code is FIRST, so i better understand what MAKES the BASIC function work. then i will have no prob adding stuff like the filter and such. thanks.

begin my code;

---------------------------------------------------------------------
Private Sub Command1_Click()
CommonDialog1.ShowSave
Open CommonDialog1.FileName For Output As 1
Print #1, Text1.Text
Close 1
End Sub

Private Sub Command2_Click()
CommonDialog1.ShowOpen
Text1.Text = (FileName)
End Sub

Private Sub Command3_Click()
Text1.Text = ""
End Sub

Private Sub Command7_Click()
End
End Sub
---------------------------------------------------------------------

here's a pic of what the layout is so far....

<a href="www.download.grimmusic.com/text.jpg"><img src="www.download.grimmusic.com/text.jpg" width="100%" hieght="100%" border= "0">

[email protected]
WWW.GRIMMUSIC.COM
__________________
---------------------------
A Black sheep moves easy in the darkness.
[email protected]
WWW.GRIMMUSIC.COM
 
Old December 8th, 2004, 10:26 AM
Authorized User
 
Join Date: Dec 2004
Posts: 67
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ALEX_GRIM
Default

hey, for those of you who are also having trouble with this issue, an admin who goes by;

-----------------
-herilane--------
-Unashamed geek--
-Super Moderator-
-* Expert *------
-----------------

from http://www.visualbasicforum.com helped me fix this to work with my config;

---------------------------------------------------------
Private Sub Command2_Click()

CommonDialog2.Filter = "Text Files (*.txt)|*.txt|All Files|*.*|HTML|*.HTML"
CommonDialog2.InitDir = "X:\"
CommonDialog2.ShowOpen

Dim strPath As String
Dim strText As String

strPath = CommonDialog2.FileNAME
Open strPath For Input As 1
Line Input #1, strText
Text1.Text = strText
Close #1

End Sub
-------------------------------------------------------------------

i hope this helps you guys.

http://www.grimmusic.com

[email protected]
WWW.GRIMMUSIC.COM





Similar Threads
Thread Thread Starter Forum Replies Last Post
Open File Dialog Issue rodmcleay VS.NET 2002/2003 0 March 7th, 2007 12:10 PM
Open Print Dialog Vision G Access 4 July 16th, 2006 02:41 AM
Open dialog box... hooking shikhar_ntd Visual C++ 0 April 13th, 2006 12:25 AM
open print dialog X-Ken VS.NET 2002/2003 4 July 26th, 2004 11:21 PM
Open File Dialog Box KennethMungwira VB.NET 3 August 3rd, 2003 09:44 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.