Solved

save in commondialog

Posted on 1998-07-07
4
192 Views
Last Modified: 2010-05-03
I want to save text5.text with the commondialog. I use:
Private Sub save_Click()
CommonDialog1.CancelError = True
CommonDialog1.DialogTitle = "Commando save"
On Error Resume Next
CommonDialog1.ShowSave
End Sub

My problem is, I don't know how to specify what I want to save.
Sorry, thats all my points.
0
Comment
Question by:mkdjo
  • 2
  • 2
4 Comments
 
LVL 2

Accepted Solution

by:
swilt earned 10 total points
ID: 1465110
Use FileName

Private Sub save_Click()
    CommonDialog1.CancelError = True
    CommonDialog1.DialogTitle = "Commando save"
    CommonDialog1.FileName = "MyFile.txt"
    On Error Resume Next
    CommonDialog1.ShowSave
End Sub

0
 

Author Comment

by:mkdjo
ID: 1465111
I want to save the content of a textbox, for example text5.text. How can I choose to save this?
0
 
LVL 2

Expert Comment

by:swilt
ID: 1465112
As in CommonDialog1.FileName = Text5.Text, the variable holding the filename;

or

dim fh as integer

fh = freefile
open "MyFile.txt" for output as #fh
print #fh, Text5.Text  ' Could use Write #fh, Text5.Text
close #fh
0
 

Author Comment

by:mkdjo
ID: 1465113
Oh yes, thank you very much.
Martin

0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Use Multiple Forms 4 57
Sending a email via excel using vba 6 80
Modifying Conditional Format from VBA code 3 55
Passing a Text Box name to a Sub 6 96
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

786 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