ms word - MS Office 2010 - Last used template directory (VBA) -
i have question scripting macros ms office 2010, more specific word. looking way save document, created template, right in directory template saved (not standard template directory).
for example got directory letters, letter template saved , directory flyers, template flyers saved. create new flyer template , want save it. if in many subdirectories take many clicks there, looking way automatically directory template, current file created, saved or maybe last used directory templates.
i neither used vba nor macros office , did not find solutions far.
i appreciate thoughts me , others same problem.
edit:
as cindy suggested how want execute macro, add, want use built-in save feature open dialog box if file not exist yet.
but today unexpectedly found answer looking for. sorry created new question this, although found 1 day later, did not know would. :p
anyway, here code found (it not me):
sub filesave() if activedocument.path = "" 'if document never saved yet filesaveas exit sub end if activedocument.save end sub sub filesaveas() dim docname string activedocument docname = "/path end dialogs(wddialogfilesaveas) .name = docname .show end end sub
you can use system.io.path.getdirectoryname() directory name of template file , use directory save new file.
Comments
Post a Comment