I am trying to create a pst file on the C:\root directory named as the current date though using the code;
Sub CreatePST()
Dim myOlApp As New Outlook.Application
Dim myNameSpace As Outlook.NameSpace
Set myNameSpace = myOlApp.GetNamespace("MAPI")
myNameSpace.AddStore "c:\" & Date & ".pst"
End Sub
Outlook creates the pst in a subfolder of day of the month as the year instead of on the root drive. Does anyone know how to format the date so that the file is saved on the root directory ie. to save as dd-mm-yy etc instead of dd/mm/yy. (eg, instead of using /)?
Any help greatly appreciated.
thanks
James
Sub CreatePST()
Dim myOlApp As New Outlook.Application
Dim myNameSpace As Outlook.NameSpace
Set myNameSpace = myOlApp.GetNamespace("MAPI")
myNameSpace.AddStore "c:\" & Date & ".pst"
End Sub
Outlook creates the pst in a subfolder of day of the month as the year instead of on the root drive. Does anyone know how to format the date so that the file is saved on the root directory ie. to save as dd-mm-yy etc instead of dd/mm/yy. (eg, instead of using /)?
Any help greatly appreciated.
thanks
James