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 strGetEnvironmentFileName(strApplication As String)
    ' Transient variable used by the internal function.
    Dim strReturnedString As String
    Dim nSize As Long
    Dim strFileName As String
    strFileName = MacroContainer.Path & Application.PathSeparator & strApplication
    strFileName = strFileName & strcExtentINI
    'Applications such as Indxr, Docle, CodeT can use a GUI switch to cause strGPA & strPPA to switch to a local path rather than MacroContainer.Path.
    Dim strEnvironmentPath As String
    strEnvironmentPath = GetLargePrivateProfileString(strApplication, strcEnvironmentPath, "", strReturnedString, nSize, strFileName)
    If strEnvironmentPath <> "" Then
        If Right$(strEnvironmentPath, 1) = Application.PathSeparator Then
        Else
            strEnvironmentPath = strEnvironmentPath & Application.PathSeparator
        End If
    Else
        strEnvironmentPath = MacroContainer.Path & Application.PathSeparator
    End If
    strGetEnvironmentFileName = strEnvironmentPath & strcApplication & strcExtentINI
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

 

 

Hosted by www.Geocities.ws

1

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 strGetEnvironmentFileName(strApplication As String)
    ' Transient variable used by the internal function.
    Dim strReturnedString As String
    Dim nSize As Long
    Dim strFileName As String
    strFileName = MacroContainer.Path & Application.PathSeparator & strApplication
    strFileName = strFileName & strcExtentINI
    'Applications such as Indxr, Docle, CodeT can use a GUI switch to cause strGPA & strPPA to switch to a local path rather than MacroContainer.Path.
    Dim strEnvironmentPath As String
    strEnvironmentPath = GetLargePrivateProfileString(strApplication, strcEnvironmentPath, "", strReturnedString, nSize, strFileName)
    If strEnvironmentPath <> "" Then
        If Right$(strEnvironmentPath, 1) = Application.PathSeparator Then
        Else
            strEnvironmentPath = strEnvironmentPath & Application.PathSeparator
        End If
    Else
        strEnvironmentPath = MacroContainer.Path & Application.PathSeparator
    End If
    strGetEnvironmentFileName = strEnvironmentPath & strcApplication & strcExtentINI
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

 

 

Hosted by www.Geocities.ws

1