View Single Post
  #4   Report Post  
Posted to microsoft.public.word.docmanagement
hard__ware hard__ware is offline
external usenet poster
 
Posts: 1
Default How do I make Word remember where the last document was saved?


Here are some Macro's for Word 2010 that allows it to Remember the
last
Location you Saved to or Opened a Document From.

The code is not 100% Optimized, but does work as expected ...

Has not been tested with Word 2007 ...

Add these Macro's to your Normal.dotm

-------------------- Start of Macro's-------------------

Sub FileOpen()

FilePath (wdDialogFileOpen)

End Sub

Sub FileSave()

FilePath ("Save")

End Sub

Sub FileSaveAs()

FilePath (wdDialogFileSaveAs)

End Sub

Function FilePath(iDialog)
Dim MyString As String
uProfile = Environ("USERPROFILE")

If FileOrDirExists(uProfile & "\FilePath.txt") Then
Else: GoTo SkipInput
End If

Open uProfile & "\FilePath.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, MyString
Loop
Close #1

ChangeFileOpenDirectory MyString

SkipInput:
If iDialog = "Save" Then
ActiveDocument.Save
Else
Set nDialog = Dialogs(iDialog)
On Error Resume Next
With nDialog
Show
End With
On Error GoTo 0
End If

Open uProfile & "\FilePath.txt" For Output As #2
Write #2, CurDir()
Close #2

End Function

Function FileOrDirExists(PathName As String) As Boolean
Dim iTemp As Integer

On Error Resume Next
iTemp = GetAttr(PathName)

Select Case Err.Number
Case Is = 0
FileOrDirExists = True
Case Else
FileOrDirExists = False
End Select

On Error GoTo 0
End Function

-------------------- End of Macro's -------------------


Aaks;20630 Wrote:

I am trying to save several files in the same location. However, each
time I
try to save a document, it goes back to My Computer, and I have to

navigate
to the folder I want to save my documents in. Is there a way for word

to
remember and show the last location straight away, when saving multiple

files
in the same location.



--
hard__ware
------------------------------------------------------------------------
hard__ware's Profile: http://www.thecodecage.com/forumz/member.php?u=2359
View this thread: http://www.thecodecage.com/forumz/showthread.php?t=6271

http://www.thecodecage.com/forumz


--- news://freenews.netfront.net/ - complaints: ---