709-218-7927 The Landfall Garden House 60 Canon Bayley Road Bonavista, Newfoundland CANADA A0C 1B0 |
---|
File Diversion
Monday, September 19, 2011
Your new system came in today, and while you are all free to read Word documents from the old server, you are all supposed to save files to the new server on drive J:.
Here's some stripped-down proof-of-concept code:
Public Const strcNewDrive As String = "J:"Sub FileSave()
MsgBox "FileSave"
If Len(ActiveDocument.Path) = 0 Then ' not previously saved
Call SaveAsDialog(strcNewDrive, ActiveDocument.Name)
Else
If UCase(Left(ActiveDocument.Path, 2)) = strcNewDrive Then ' User is logged on to th drive
ActiveDocument.Save
Else
Call SaveAsDialog(strcNewDrive, ActiveDocument.Name)
End If
End If
End Sub
Sub FileSaveAs()
MsgBox "FileSaveAs"
Call SaveAsDialog(strcNewDrive, ActiveDocument.Name)
End Sub
Function SaveAsDialog(strDrive As String, strName As String)
With Application.Dialogs(wdDialogFileSaveAs)
.Name = strDrive & "\" & strName
.Format = wdFormatDocument
.Show
End With
End Function
709-218-7927 CPRGreaves@gmail.com Bonavista, Sunday, December 08, 2024 9:32 AM Copyright © 1990-2024 Chris Greaves. All Rights Reserved. |
---|