Discussion:
Save As Copy?
(too old to reply)
Marcio Marchini
2006-01-23 19:00:18 UTC
Permalink
Hi,

How can I do a "Save As Copy" as present in programs like Photoshop etc?

I have a doc, foo.doc loaded. I want to save it as foo.xml, but the
problem is that the SaveAs call saves the XML file but, as side-effect,
changes the loaded document path (to be the XML file). I just want to
save an XML version without any side effect to the loaded doc. Basically
I want to save foo.doc into a file temp.xml and not change the loaded
foo.doc at all.

Ideas?

Currently I SaveAs, Close (the XML) and (re)Open the original .DOC,
re-positioning the selection as it was before saving as XML. Annoying.
In one particular case (one particular user's PC) Word is bombing in the
call to Open (from C#). I posted the issue in the other newsgroup,
oleinterop. So, I am trying to avoid the need for Close/Open.

Making a full copy in memory as a new doc sounds like an option too,
probably as annoying and as likely to cause its own problems too.

Thanks,

marcio
Doug Robbins - Word MVP
2006-01-23 21:01:36 UTC
Permalink
Save as a Word document
Save as an xml document
Close the document
Open the Word document.
--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
Post by Marcio Marchini
Hi,
How can I do a "Save As Copy" as present in programs like Photoshop etc?
I have a doc, foo.doc loaded. I want to save it as foo.xml, but the
problem is that the SaveAs call saves the XML file but, as side-effect,
changes the loaded document path (to be the XML file). I just want to save
an XML version without any side effect to the loaded doc. Basically I want
to save foo.doc into a file temp.xml and not change the loaded foo.doc at
all.
Ideas?
Currently I SaveAs, Close (the XML) and (re)Open the original .DOC,
re-positioning the selection as it was before saving as XML. Annoying. In
one particular case (one particular user's PC) Word is bombing in the call
to Open (from C#). I posted the issue in the other newsgroup, oleinterop.
So, I am trying to avoid the need for Close/Open.
Making a full copy in memory as a new doc sounds like an option too,
probably as annoying and as likely to cause its own problems too.
Thanks,
marcio
Marcio
2006-01-23 21:55:15 UTC
Permalink
Post by Doug Robbins - Word MVP
Save as a Word document
Save as an xml document
Close the document
Open the Word document.
Ahem. Maybe I wasn't clear, but I already do this. I am looking for
another solution. I want to eliminate the need to reopen the DOC.

My code is a C# plugin for Word, BTW.

marcio
Charles Kenyon
2006-01-23 22:01:03 UTC
Permalink
Any solution is going to reopen the document. AFAIK
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
Post by Marcio
Post by Doug Robbins - Word MVP
Save as a Word document
Save as an xml document
Close the document
Open the Word document.
Ahem. Maybe I wasn't clear, but I already do this. I am looking for
another solution. I want to eliminate the need to reopen the DOC.
My code is a C# plugin for Word, BTW.
marcio
Tony Jollans
2006-01-23 22:27:55 UTC
Permalink
Word doesn't have an equivalent of Excel's SaveCopyAs method - somewhat
annoying as Word clearly has code to do it which it uses if you, for
example, Send To > Mail Recipient (As Attachment).

You must do it yourself, one way or another - instead of having to reopen,
you could copy the whole document to a new one and save and close that as
xml.

--
Enjoy,
Tony
Post by Marcio
Post by Doug Robbins - Word MVP
Save as a Word document
Save as an xml document
Close the document
Open the Word document.
Ahem. Maybe I wasn't clear, but I already do this. I am looking for
another solution. I want to eliminate the need to reopen the DOC.
My code is a C# plugin for Word, BTW.
marcio
Charles Kenyon
2006-01-23 21:52:01 UTC
Permalink
If this is something you have to do 15 times a day, you could write a macro
to handle it. Store the macro in a global template, and write a keyboard
shortcut or menu command for it. Seems like overkill though for something
that you only do a few times. Otherwise, Doug gives you the basic steps.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
Post by Marcio Marchini
Hi,
How can I do a "Save As Copy" as present in programs like Photoshop etc?
I have a doc, foo.doc loaded. I want to save it as foo.xml, but the
problem is that the SaveAs call saves the XML file but, as side-effect,
changes the loaded document path (to be the XML file). I just want to save
an XML version without any side effect to the loaded doc. Basically I want
to save foo.doc into a file temp.xml and not change the loaded foo.doc at
all.
Ideas?
Currently I SaveAs, Close (the XML) and (re)Open the original .DOC,
re-positioning the selection as it was before saving as XML. Annoying. In
one particular case (one particular user's PC) Word is bombing in the call
to Open (from C#). I posted the issue in the other newsgroup, oleinterop.
So, I am trying to avoid the need for Close/Open.
Making a full copy in memory as a new doc sounds like an option too,
probably as annoying and as likely to cause its own problems too.
Thanks,
marcio
Loading...