|
Visual Basic (VB and VBA) |
|
Copyright 1999-2001 Christopher Greaves. All rights reserved. Home Page and email to [email protected] |
| If in doubt, record a macro and inspect the entrails! |
Please read the DISCLAIMER.
Here is an INDEX to all the procedures.
You will probably need one copy of my GLOBAL DECLARATIONS.
Public Function strBuildPathAndName(strFileName As String)
' Procedure : strBuildPathAndName
' Description: This code builds a full document name.
' Copyright: Chris Greaves Inc.
' Inputs: A string.
' Returns: A document name string; empty string if any problems.
' Assumes: If no path name is apparent, the MacroContainer path will be used.
' If no document name is apparent, the MacroContainer name will be used.
' Side Effects: None.
' Tested: By the calls shown below.
Dim strDocPath As String
Dim strDocName As String
strDocPath = strGetFilename(strFileName, intcDrivePath)
strDocName = strGetFilename(strFileName, intcFullName)
If strDocPath = "" Then
strDocPath = MacroContainer.Path
End If
If strDocName = "" Then
strDocName = strGetFilename(strTemplatePath, intcName) & ".DOC"
End If
strBuildPathAndName = strDocPath & Application.PathSeparator & strDocName
'Sub TESTstrBuildPathAndName()
' Dim str As String
'' str = strBuildPathAndName("erasemr.txt")
' If str = "" Then
' MsgBox "An Error ocurred"
' Else
' MsgBox str
' End If
'End Sub
End Function
| We all knew nothing when we started … |
|
Home Page and Contact Information Send email to [email protected]. This page was last updated Thursday, November 15, 2001 |