Old New Document

K

Kolmyk AE

Hi again

Another question: How to convert saved document to new document? For example, I save document in database: (1) I save document in temporary file, (2) I save temporary file in database, and (3) I said: "Word, forgot about last save, this document never been saved.

Thanks
Kolmyk AE
 
M

murdoch

Hi

This might help:

ActiveDocument.Saved=False

-----Original Message-----
Hi again!

Another question: How to convert saved document to new
document? For example, I save document in database: (1) I
save document in temporary file, (2) I save temporary file
in database, and (3) I said: "Word, forgot about last
save, this document never been saved."
 
K

Kolmyk AE

Not it is not helps

Because
1. User see that document was saved
2. And when used press "Ctrl+S" Word save document in temporary file instead of ask user for file name

Why Word not supported SaveCopyAs?
 
J

Jean-Guy Marcil

Bonjour,

Dans son message, < Kolmyk AE > écrivait :
In this message, < Kolmyk AE > wrote:

|| Hi again!
||
|| Another question: How to convert saved document to new document? For
example, I save document in
|| database: (1) I save document in temporary file, (2) I save temporary
file in database, and (3)
|| I said: "Word, forgot about last save, this document never been saved."
||

Copy the content of the temporary document to a new document created from
the same template, then close/delete the temporary document?

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
M

murdoch

Perhaps something like this then?

With ActiveDocument
strDocName=.FullName
blnDocIsClean=.Saved
.SaveAs FileName:=TempFileName
.SaveAs FileName:=strDocName ' doc now has orginal name
.Saved=blnDocIsClean
End With
' --- put TempFileName in db here---


-----Original Message-----
Not it is not helps.

Because:
1. User see that document was saved.
2. And when used press "Ctrl+S" Word save document in
temporary file instead of ask user for file name.
 
J

Jean-Guy Marcil

Bonjour,

Dans son message, < Kolmyk AE > écrivait :
In this message, < Kolmyk AE > wrote:

|| It is may be not so good:
|| For example,
|| 1. User works with document.
|| 2. He (or she) clicks menu item "Save Document in Database"
|| 3. I (or program) save document in temporary file, place this file in DB,
call Documents.Add
|| Template:="file.tmp", close old document and activate new document.
||
|| BUT! User Exvironment is gone (cursor position, selections, and so on)
||
|| May be I can somehow save and restore User Environment?

Forget my previous post, I thought the whole process was done
programmatically, I did not understand that the user was calling the "save"
procedure after having worked on the document.

Try something a little different then:

User clicks on "Save to database";
Program saves current document (optional);
Using "Documents.Add", create an invisible (unless you are working with Word
97) document from the same template the user's document was based on;
Using a range object, copy the content of the user document to the invisible
one;
Save the invisible document to the database;
Terminate the invisible document.
User is returned to his/her document without any apparent changes.

I have not tested this, but I think it is worth exploring...

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top