Solved

save in commondialog

Posted on 1998-07-07
4
171 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

762 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now