# Word 2010 Macro - Save File in Folder



## mwhcrew (Sep 4, 2009)

I have a word 2010 template and I would like to create a macro (button) that saves it as "Meeting Minutes MM-DD-YYYY" where the date is today's date. It also needs to be put into a specific folder which has a filepath of p:\Folder (it's more complicated, but if we can put that in as an example I'll be able to substitute it). 

I haven't been able to figure out the exact coding. 

Thanks!


----------



## macropod (Apr 11, 2008)

If you add a macro like the following to the document template, plus a MACROBUTTON field to call it, clicking the MACROBUTTON field should save the document as specified.

```
Sub SaveMe()
Dim StrPath As String
StrPath = "MyPath"
ActiveDocument.SaveAs FileName:=StrPath & "Meeting Minutes " & Format(Now(), "MM-DD-YYYY"), Fileformat:=wdFormatXMLDocument
End Sub
```


----------



## mwhcrew (Sep 4, 2009)

Thanks! Where can I put it so that the file saves into the correct path? As it is it wasn't saving it in the right path but was naming it the StrPath but putting it into the last folder I had open.


----------



## macropod (Apr 11, 2008)

Simply change "MyPath" to your actual path (I thought that'd be pretty obvious).


----------



## mwhcrew (Sep 4, 2009)

I was missing a \ in the pathname so have figured it out. Thanks!


----------

