Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get file from Document in MS Word

Status
Not open for further replies.

ZakiMaksyutov

Programmer
Feb 28, 2001
87
RU
Hi!

I need to send file MS Word via http to the server.
But problem is in getting this file:
1) I may save Document (and use this file), but may be user wants only sending without saving.
2) I may SaveAs but then name of document will be changed and to change it back I should SaveAs to the original name - as a result document is saved again.

I want to somehow save document in tmp file without changing name and saving it in original file and use this tmp file for sending, but I don't know how I can save in tmp file.

May be I may use following:
Documents.Add ActiveDocument.FullPath
But if ActiveDocument wasn't been saved before error will be occured.

Thanks for any help,

With best regards,
Zaki Maksyutov
 
I would just save normally in word and use dos to rename it, you can rename it whatever you want, i usually use my initials as the file extension. Then once you get it where it needs to go, you can change it back to what it was...
 
But I need to receive tmp file without saving in original file, because user may want to send via internet but don't save to the disk...
 
Zaki, why don't you create a template with a DocumentNew event that changes the save as directory?

Why are you using documents? I'm not sure I understand...

X-)
techsupportgirl@home.com
Brainbench MVP for Microsoft Word
 
Dreambot, sorry but I didn't understand you properly.

I need to send Document via http to one site (for this I should save Document to file). But I should not save this document to the disk. If I call SaveAs then name will be changed and for changing it back I should call SaveAs with original name.
 
I guess i dont quite understand either, why cant you save it on your hdd? There is no way that you can send a file without saving it to your hdd first. When you save it it will save it at a .doc unless you choose to save it as .html. I guess i dont really understand how you plan to send it either you mean you are seding it via FTP to a intranet server? Or going to put it on a web page?
 
why don't you do a filecopy command aso you end up with 2 copies, 1 temp one and 1 real one, then you are free to do wahtever you wish with the temp copy and then execute a 'kill'command when you're done.
 
To markbeeson:
----------------------
I must NOT save Document to the original file because user may want to send via internet without saving to disk.
And for using filecopy command I need to call
Document.Save (or SaveAs) first (I must NOT do this).
 
To Zorlod:
----------------
I need to save Document but I can not use Save or SaveAs methods.
Since in the MS Word there is SendTo which sends letter with file as attachment. And it doesn't save to the original file. So I think that this functionality isn't closed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top