Results 1 to 17 of 17

Thread: How to save an existing file into a new file using "save as" method?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2007
    Posts
    27

    How to save an existing file into a new file using "save as" method?

    Hai to all,

    if i'm having a file named as "tab.doc" which is a microsoft word document file ...

    i want to save it as another file as "tab1.doc" by using

    "save as" method....

    Is there any "save as" method available for doing this process in VC++....

    thanks in advance..
    senthil..

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: How to save an existing file into a new file using "save as" method?

    You want a "save as" that presents the user with the "Save As" dialog? Or you want a "save as" as in "I want to save it as tab1.doc"?
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jan 2007
    Posts
    27

    Re: How to save an existing file into a new file using "save as" method?

    Hai bee,

    thanks for ur reply...

    i want a "save as"... that saves the existing file tab.doc as a new file tab1.doc...

    thanks..
    senthil

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: How to save an existing file into a new file using "save as" method?

    You provided zero additional information. Your description of what you want to do still conflicts with the common association of "save as".
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Jan 2007
    Posts
    27

    Re: How to save an existing file into a new file using "save as" method?

    we are having some functions or methods suchas

    SaveFileTo(), SaveAs(),

    By using these kind of methods...

    Now i'm having a manually created word document file tab.doc...

    when we open that file in ms word... it displays the content....

    then i click the file->saveas button to save the same content of the tab.doc

    into another file named as tab1.doc...

    This is the process we are manually doing for saving the contents from an existing file into a new file...

    Now i want to do that process automatically by using any SaveAs method..

    Is there any SaveAs method available for doing this process?

    thanks..
    senthil

  6. #6
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276

    Re: How to save an existing file into a new file using "save as" method?

    Code:
    CopyFile(oldFileName, NewFileName, bFailIfExists)
    would do the trick.

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Jan 2007
    Posts
    27

    Re: How to save an existing file into a new file using "save as" method?

    Hai wey,

    thanks for ur reply...

    Itz working supervly...

    But this CopyFile() method is not suitable for my project...

    I want only "SaveAs" method for my project....

    Can u please tell me

    How to save an old file into a new fie by using "save as"...

    The manual process is that...

    if there is a file named 1.doc... we will open it with ms word...

    then click file->save as.. button for saving the contents of 1.doc to a
    new file named as 2.doc...

    I want to automate this process in my program using any SaveAs() method
    like CopyFile() method

    is there any source code available for this process...

    plzz help me...

    thanks for ur reply..
    senthil..

  8. #8
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: How to save an existing file into a new file using "save as" method?

    There's no difference between that and copying.

    But if you really, really want to do it that way, you need to use Word's scripting interface. Look up OLE Automation. And don't use C++ for it.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  9. #9

    Thread Starter
    Junior Member
    Join Date
    Jan 2007
    Posts
    27

    Re: How to save an existing file into a new file using "save as" method?

    Hai bee,

    Thanks for ur suggestions and responses...

    Then plzz tell me how to save the content of webpage into an image file...

    in C++...

    i found that saveToFile() is available for doing that...

    i found a sample code in the net also...

    Code:
    void DownloadHtml(void)
        {
        CkHttp http;
    
        // Unlock once at the beginning of your program.
        http.UnlockComponent("Anything for 30-day trial");
    
        CkString strHtml;
        bool success = http.QuickGetStr("C:/1.html",strHtml);
    
        // Save the HTML to a file.
        strHtml.saveToFile("1.jpg");
    	
        }
    
    But dont know how to use the above function in my project..
    
    it showing errors like 
    'http': identifier not found, even with argument-dependent lookup
    'CkString' : undeclared identifier
    'CkHttp' : undeclared identifier
    i'm a beginner to c++...
    i think these are only small problems...

    will u plzz help me...
    thanks
    senthil..

  10. #10
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: How to save an existing file into a new file using "save as" method?

    If you are a beginner to C++, those are HUGE problems. Well, actually it's exactly one problem: you don't know what you're doing.

    Learn the language first. C++ isn't some scripting language you can just start doing things with. You have to actually learn it first.

    C++ is also unsuited to all the things you've been trying to do so far. I recommend VB.Net instead.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  11. #11

    Thread Starter
    Junior Member
    Join Date
    Jan 2007
    Posts
    27

    Re: How to save an existing file into a new file using "save as" method?

    But i'm now started working in the c++...

    thats y i'm asking u...


    i'm also learning C++ hardly for working...

    plzz help me for those errors....

    thanks...
    senthil

  12. #12

    Thread Starter
    Junior Member
    Join Date
    Jan 2007
    Posts
    27

    Re: How to save an existing file into a new file using "save as" method?

    i think ckhttp is a base class...

    and creating an object http for that base class...

    by using that object we are accessing the saveToFile() method...

    But i dont know where the ckhttp base class...

    in the net they use ckhttp for class creating http object...

    Will u plzz tell me how to use this?

  13. #13
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: How to save an existing file into a new file using "save as" method?

    It's a class, not a base class. They got it from some library that's probably linked in the article.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  14. #14

    Thread Starter
    Junior Member
    Join Date
    Jan 2007
    Posts
    27

    Re: How to save an existing file into a new file using "save as" method?

    ok how can i get that ckhttp class....

    is there any *.lib files available for using this class?

  15. #15
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: How to save an existing file into a new file using "save as" method?

    Why do you ask us? Look in that article.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  16. #16
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276

    Re: How to save an existing file into a new file using "save as" method?

    I really don't understand why you are adamant about using this 3rd party library.
    I don't think there would be anything you couldn't do yourself or for free with open source code that can be done with that library.

    If you insist on using that code, pay for the library and I'm sure the vendor will give you support.

    Like CornedBee said, if you don't try to learn the language first, then you won't get much help here.

  17. #17

    Thread Starter
    Junior Member
    Join Date
    Jan 2007
    Posts
    27

    Re: How to save an existing file into a new file using "save as" method?

    ya ok thanks for ur suggestions...

    i'm also now learning C++ hardly to work in this field....

    thats y i joined this forum for clearing my doubts...

    ok u responsed well for my doubts...

    i will contact u in the future after learning C++ thouroghly..

    thanks
    bye..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width