Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Word
application.errors
conversions
docmanagement
drawing.graphics
formatting.longdocs
international
internet.assistant
mail
mailmerge.fields
menustoolbars
newusers
numbering
oleinterop
pagelayout
printingfonts
setup.networking
spelling.grammar
tables
vba.addins
vba.beginners
vba.customization
vba.general
vba.userforms
web.authoring
word6-7macros
word97vba
  
 
date: 29 Dec 2005 13:02:41 -0800,    group: microsoft.public.word.vba.customization        back       


Template Saves File To Custom Filename/Directory   
Here's what I want to do with Word 2003:

>From a custom template I've made (MS.dot), open and save files to a
directory OTHER than the one I've specified in Word's Options dialog OR
the most recently saved path, and use the template's Title Style
Definition as the filename in the directory. Then, when I'm NOT using
that template, have Word revert back to my "default" configuration.

I have Word options set to open documents from and save them to
"D:\Data," my default file location. I want MS.dot to open files from
and save them to "D:\Data\MS." I also want it to use as a filename
whatever I've designated as a Title Style Definition in the document.
Then, when I close a file based on the MS.dot and go back to using
Normal.dot, I want to revert to my default settings.

For example: Say I open a new MS.dot document, write a manuscript, and
title it, "MS Ten" (in the body of the manuscript, NOT in the file
properties dialog). I apply the template's Title Style Definition to
the words, "MS Ten." When I Save or Save As, I want the template to
save the file to "D:\Data\MS\MS Ten.doc." When I close the MS.dot
document and return to using my Normal.dot, I want Word to Save or Save
As to "D:\Data" and whatever filename I chose, per usual.

Can anyone tell me how to do this? It appears a combination of one or
two simple macros in MS.dot could accomplish it, but the "use last
saved location path" feature of Word is getting in my way.

Thanks in advance.
date: 29 Dec 2005 13:02:41 -0800   author:   whaywardj

Re: Template Saves File To Custom Filename/Directory   
Hi Whaywardj, 

My feeling is that you probably need a pair of macros named FileSave and 
FileSaveAs, one saved in ms.dot, the other in Normal.dot.

Or a single pair in Normal.dot that check the Path property or the 
AttachedTemplate property of the ActiveDocument to determine to which 
path the file should be saved.

Does that make any sense?

> Here's what I want to do with Word 2003:
>  
> >From a custom template I've made (MS.dot), open and save files to a
> directory OTHER than the one I've specified in Word's Options dialog OR
> the most recently saved path, and use the template's Title Style
> Definition as the filename in the directory. Then, when I'm NOT using
> that template, have Word revert back to my "default" configuration.
>  
> I have Word options set to open documents from and save them to
> "D:\Data," my default file location. I want MS.dot to open files from
> and save them to "D:\Data\MS." I also want it to use as a filename
> whatever I've designated as a Title Style Definition in the document.
> Then, when I close a file based on the MS.dot and go back to using
> Normal.dot, I want to revert to my default settings.
>  
> For example: Say I open a new MS.dot document, write a manuscript, and
> title it, "MS Ten" (in the body of the manuscript, NOT in the file
> properties dialog). I apply the template's Title Style Definition to
> the words, "MS Ten." When I Save or Save As, I want the template to
> save the file to "D:\Data\MS\MS Ten.doc." When I close the MS.dot
> document and return to using my Normal.dot, I want Word to Save or Save
> As to "D:\Data" and whatever filename I chose, per usual.
>  
> Can anyone tell me how to do this? It appears a combination of one or
> two simple macros in MS.dot could accomplish it, but the "use last
> saved location path" feature of Word is getting in my way.
>

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or 
reply in the newsgroup and not by e-mail :-)
date: Fri, 30 Dec 2005 11:57:05 +0100   author:   Cindy M -WordMVP-

Re: Template Saves File To Custom Filename/Directory   
Yep. Figured that out this morning about the same time you composed
your suggestion. Works very nearly as I desire. Merely saving the
ActiveDocument (FileSave) from each .dot crashes, though. I have to use
SaveAs until I figure out the syntax for makng the .dot save an active
document to a specific (different) directory. Not a huge issue though,
since I've got ChangeFileOpenDirectory in both. Word's FileSave puts
the docs back where they came from nicely . Toying with AutoNew and
AutoOpen right now to see if either or both can be employed to positive
effect.

Your thought to have Normal.dot check the Path property of the
ActiveDocument sounds a more elegant solutrion. Wish I had some idea of
how to go about doing that.

Thanks.
date: 30 Dec 2005 15:57:04 -0800   author:   whaywardj

Re: Template Saves File To Custom Filename/Directory   
Hi Whaywardj, 

> Your thought to have Normal.dot check the Path property of the
> ActiveDocument sounds a more elegant solutrion. Wish I had some idea of
> how to go about doing that.
>
s = ActiveDocument.Path

Select Case s 
    Case is "C:\whatever"
    Case is "C:\xyz"
End Select

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or 
reply in the newsgroup and not by e-mail :-)
date: Sat, 31 Dec 2005 16:57:49 +0100   author:   Cindy M -WordMVP-

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us