![]() |
|
#3
|
||||
|
||||
|
You could add the following code to the 'ThisDocument' module of Word's Normal Template (or whatever other template you're using). It will warn you if the document you've just opened is not on a fixed or network drive.
Code:
Private Sub Document_Open()
Dim DrvNm As String, DocNm As String, FSO As Object, Drv As Object
Set FSO = CreateObject("Scripting.FileSystemObject")
DrvNm = Left(ActiveDocument.Path, 1): DocNm = Split(ActiveDocument.Name, "do")(0)
For Each Drv In FSO.Drives
Select Case Drv.DriveType
Case 1 'Removable
If Drv.DriveLetter = DrvNm Then MsgBox DocNm & " is on Removable Drive " & Drv.DriveLetter: Exit For
Case 2 'Fixed
Case 3 'Network
Case 4 'CD-ROM
If Drv.DriveLetter = DrvNm Then MsgBox DocNm & " is on CD-ROM " & Drv.DriveLetter: Exit For
Case 5 'RAM-Disk
If Drv.DriveLetter = DrvNm Then MsgBox DocNm & " is on RAM-Disk " & Drv.DriveLetter: Exit For
End Select
Next Drv
End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Macro to save as pdf with ability to choose save as folder
|
rvessio | Word VBA | 4 | 07-25-2016 12:37 PM |
Macro: How to get this macro to save to a specific location
|
LOUF | Word VBA | 1 | 12-07-2015 06:47 PM |
| Windows Media Player | Boo | Excel Programming | 0 | 04-28-2013 06:51 AM |
| Powerpoint save as WMV but media doesnt work. | hooney | PowerPoint | 0 | 02-21-2013 09:45 PM |
| Warn user/viewers if Font is not installed. | Rehnn | Word | 0 | 10-01-2009 06:26 AM |