Hi All,
I am completely new to macros (never even heard of them 24hrs ago), and basically just want to have a function to save a document as "Document 1- *todays date*" (eg Document 1- 01.01.2014) in microsoft word.
So far I have been able to achieve this, however when opening the newly named file I get an error message every time..... "We're sorry. We cant open file name because we found a problem with its contents"
The code i have used is.....
Sub Macro1
'
'Macro1 Macro
Dim FilePath As String
Dim NewName As String
FilePath = "C:\Users\Guest\Documents": NewName = FilePath & Format(Date"MM.DD.YYYY") & ".docm"
ActiveDocument.SaveAs Filename:=NewName, FileFormat _
End Sub
Am i on the right path?
Id also like to add a little save button in the document itself at the bottom, which the user clicks on to save using the macro. My research has shown me just how simple this is in MS Excel (draw clip art> right click > assign macro > choose the relevant macro). MS word doesnt appear to be this simple- any simple ways to achieve the same result in the simplest way possible?
Any help would be appreciated! Im a bit lost haha
Thanks
EDIT: Ive been playing around with the code a fair bit and some how changed the second last line (ActiveDocument.SaveAs.......etc) such that it only gives me a syntax error now- any suggestions?
I am completely new to macros (never even heard of them 24hrs ago), and basically just want to have a function to save a document as "Document 1- *todays date*" (eg Document 1- 01.01.2014) in microsoft word.
So far I have been able to achieve this, however when opening the newly named file I get an error message every time..... "We're sorry. We cant open file name because we found a problem with its contents"
The code i have used is.....
Sub Macro1
'
'Macro1 Macro
Dim FilePath As String
Dim NewName As String
FilePath = "C:\Users\Guest\Documents": NewName = FilePath & Format(Date"MM.DD.YYYY") & ".docm"
ActiveDocument.SaveAs Filename:=NewName, FileFormat _
End Sub
Am i on the right path?
Id also like to add a little save button in the document itself at the bottom, which the user clicks on to save using the macro. My research has shown me just how simple this is in MS Excel (draw clip art> right click > assign macro > choose the relevant macro). MS word doesnt appear to be this simple- any simple ways to achieve the same result in the simplest way possible?
Any help would be appreciated! Im a bit lost haha
Thanks
EDIT: Ive been playing around with the code a fair bit and some how changed the second last line (ActiveDocument.SaveAs.......etc) such that it only gives me a syntax error now- any suggestions?