ListTemplates
Description
ListTemplates() lists all the available journal templates.
Syntax
Function ListTemplates(
templateType() As String,
templateName() As String
) As Long
Parameters
templateType: An output argument. Returns the available template types(Standard or Recurring) as an array of strings.
templateName:An output argument. Returns the template names an array of strings.
Return Value
Returns 0 if successful; otherwise, returns the appropriate error code.
Example
Public Declare Function HypConnect Lib "HsAddin" (ByVal vtSheetName As Variant, ByVal vtUserName As Variant, ByVal vtPassword As Variant, ByVal vtFriendlyName As Variant) As Long
Sub TestListTemplates
‘Connect to an HFM data source
HypConnect "Sheet1", "admin", "password", "connName"
Set jObj = New JournalVBA
jObj.UseActiveConnectionContext
Dim templateType() As String
Dim templateName() As String
retVal = jObj.ListTemplates(templateType, templateName)
If retVal = 0 Then
Debug.Print "Following are the Template types and their names..."
Debug.Print "Type Name"
Dim i As Integer
For i = 0 To UBound(templateType)
Debug.Print Spc(5); templateType(i); Spc(10); templateName(i)
Next
Else
Debug.Print "ListTemplates Failed!!!"
End If
End Sub