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..
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"?
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
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".
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
Re: How to save an existing file into a new file using "save as" method?
Code:
CopyFile(oldFileName, NewFileName, bFailIfExists)
would do the trick.
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..
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.
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..
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.
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
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?
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.
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?
Re: How to save an existing file into a new file using "save as" method?
Why do you ask us? Look in that article.
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.
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..