Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Common Dialog Save As

Posted on 2004-09-15
8
Medium Priority
?
1,184 Views
Last Modified: 2013-12-25
I know this has to be simple but I just can't find the answer.
Coding in Visual Basic 6 using the Common Dialog Box Control

My user opens a file say for example "me.wav". Then user user does a File SAVE AS and picks a different filter than than the orginal file name. example:r "wma".  The Users orginal file name says me.wav, but I want the file name extention to be what  ever filter was picked.  Example picked "wma"  the file name would me me.wma.  Picked "mp3" the file name would me.mp3.  
0
Comment
Question by:MKadric
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 44

Expert Comment

by:bruintje
ID: 12064425
you can see demo here
source : http://www.freevbcode.com/ShowCode.asp?ID=2773

you need to change the filter lines in the demo to

    Filter = "Alwee Files (*.alw)|*.alw|" 'This is the normal way of opening a file with your own ext.
    Filter = Filter + "JPEG Files (*.jpg)|*.jpg|" 'Shows JPG Files(This is how you normally open a file)
    Filter = Filter + "All Formats (*.*)|*.*" 'Show both formats at once

then it works to open jpg and save as alw

HTHAB
0
 

Author Comment

by:MKadric
ID: 12064929
Thank you, but I guess I did not state question clearly. I can save the file to any filter I have coded.... I WANT THE FILE NAME TO CHANGE WHEN THE USER SELECTS A DIFFERENT FILTER... Like Microsoft word... You open a Doc file example.... Me.doc and do a file save as and the file name is in the Box File name with the extention of the say text.... me.txt.... It does this automatically when the user changes the filter.   The file name no longer says me.doc.... it says me.txt.... depending what filter the user picked.... Same with excel... user opens file me.xls does a file save and picks txt as the filter and the file name is now me.txt...... not me.xls... user did not have to change... the file name extenion changed depending which filter was picked.
0
 
LVL 44

Expert Comment

by:bruintje
ID: 12064968
aha .... that's clear :) have to try
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:MKadric
ID: 12065024
Thanks
0
 
LVL 3

Expert Comment

by:redfordb
ID: 12072712
Are you talking about the file name in the common dialogue, or only once the user clicks the save button ?
0
 

Author Comment

by:MKadric
ID: 12073124
1. Select File open... There is now a file that can be saved in another format.... Original File name is    me.avi

2. Select File Save As. The file name is the File name box is     me.avi.

3. User clicks the "Save as type" (the filter) and selects the “Save as type:”     Wav Files (*.wav).

4. Immediately I want the file name to remain the same but the extension to change to wav.     So the File name would now be me.wav

This is the way Word, Excel and all Save AS works.
I just can’t get the extension to change in the File name box when I select a new Save As type.  A person would think that this would be pretty important due to the fact if the user has to change the file name extension to the filter they selected, 9 times out of 10 that won't happen and they will over write the original file.  I have looked on Microsoft for the answer; I have down loaded at least 20 examples of the Common dialog vb projects.  None of them including Microsoft helped with the answer.

  I sure would appreciate the answer if any body knows.
0
 
LVL 5

Accepted Solution

by:
JMoon5FTM earned 1000 total points
ID: 12096552
Microsoft Office uses its own, special file dialog - so don't look for the answer there.

There is, to the best of my knowledge, no easy way of doing what you want.  To do this, you would need to throw away the Common Dialog control, call the Windows API directly, use a hook function, and use a few hundred lines of code.

That or lower your standards.  Many commercial applications don't act like Word and Excel.
0
 

Expert Comment

by:neil17317
ID: 22458654
i love this site.... i learned a lot....!!!!!!!!!!!!!!!!!!thanks experts made  beginners an easier life
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses

618 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