FixPath_Word

Fixes the path for a given folder, PC or Mac by adding separator only if needed
Also can gets the path for active document

Function FixPath_Word(Optional InPath = "This", Optional Seperater = "FolderAuto_PC_or_Mac")
 ' To Fix the path as needed, always put the '\' at end ...
 ' FixPath (add the '\' character (: for Mac) to the end of string or not)
 If InPath = "This" Then InPath = ActiveDocument.Path
 If Seperater = "FolderAuto_PC_or_Mac" Then
  Seperater = "\"
  If Application.OperatingSystem Like "*Mac*" Then Seperater = ":"
 End If
 If Right(InPath, 1) <> Seperater Then InPath = InPath & Seperater
 FixPath_Word= InPath
End Function

Optional InPath, Optional Seperater

Views 439 Downloads 208

'Word', 'path', 'fixpath', 'activedocument', 'thisdocument'

ANmarAmdeen
326
File System VBA-Word
Revisions

v1.0