Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Save Dialog / Move File problem

Posted on 2006-04-20
2
Medium Priority
?
216 Views
Last Modified: 2010-04-05

Hello,

I have an application that creates a file name output.html in the same directory as the application.  I'm trying to give the user the option to save this file to a different name and location.

Here's the code that I have right now:


    sDialog.Title := 'Save your file...';
    sDialog.Filter := 'HTML File (*.html)|*.html';
    sDialog.DefaultExt := 'html';
    sDialog.FilterIndex := 1;

    If sDialog.Execute Then
    Begin
        ShowMessage(sDialog.FileName);
        MoveFile('output.html',PChar(sDialog.FileName));
    End;

This doesn't work.  I don't receive any errors, but it simply doesn't move the file to any location.

Thanks!
0
Comment
Question by:light_bulb
2 Comments
 
LVL 17

Accepted Solution

by:
mokule earned 500 total points
ID: 16500178
provide full path for source file

        MoveFile(PChar(ExtractFilePath(Paramstr(0))+ 'output.html'),PChar(sDialog.FileName));
0
 
LVL 3

Author Comment

by:light_bulb
ID: 16500238
That worked!  

Thanks!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This is an update to some code that someone else posted on Experts Exchange. It is an alternate approach, I think a little easier to use, & makes sure that things like the Task Bar will update.
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…
Suggested Courses
Course of the Month10 days, 20 hours left to enroll

571 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