Sub DrawJobs(p_org_code As Long)
Dim shpChild As Visio.Shape
Dim increment As Double
Dim j As Integer
Dim subNO As Double
Dim start_of_job_index As Integer
Dim xPos As Double, yPos As Double
Dim i As Integer
j = 1
Set pagObj_job = pagsObj.Item(2)
While (organization_jobs(j).code <> p_org_code And j < no_of_records)
j = j + 1
Wend
If organization_jobs(j).code = p_org_code Then
start_of_job_index = j
Else
Exit Sub
End If
i = start_of_job_index
'For i = 1 To no_of_records
box_height = 0.8
Set shpChild = pagObj_job.Drop(mastObj, job_xPos, job_yPos)
job_box = job_box + 1
'yPos = yPos 'job shape width
job_xPos = job_xPos + 3
' MyFont.Bold = True
shpChild.Text = organization_jobs(i).title & " ( " & organization_jobs(i).code & " ) " & Chr(10)
'MyFont.Bold = False
Do
'shpChild.Text = shpChild.Text & Chr(10) & organization_jobs(i).sap_job_code & " | " & organization_jobs(i).suffex & " | "
shpChild.Text = shpChild.Text & Chr(10) & organization_jobs(i).sap_job_code & " " & organization_jobs(i).suffex & " "
If organization_jobs(i).grade_code >= 15 Then
' shpChild.Text = shpChild.Text & " | EP | "
shpChild.Text = shpChild.Text & " EP "
Else
'shpChild.Text = shpChild.Text & " | "
shpChild.Text = shpChild.Text & " "
shpChild.Text = shpChild.Text & organization_jobs(i).grade_code & " "
'shpChild.Text = shpChild.Text & organization_jobs(i).grade_code & " | "
End If
'shpChild.Text = shpChild.Text & organization_jobs(i).Incumbent & " | "
shpChild.Text = shpChild.Text & organization_jobs(i).job_title
'& organization_jobs(i).grade_code & " | " & organization_jobs(i).job_title & " | " & organization(i).Incumbent
i = i + 1
box_height = box_height + 0.1
shpChild.Cells("Para.HorzAlign").Formula = 0
Loop While organization_jobs(i).code = p_org_code
' draw box in the next line
If job_box Mod 4 = 0 Then
job_yPos = job_yPos - 4
job_xPos = 2
End If
j = j + 1
i = i - 1
shpChild.Cells("Height").Formula = box_height
shpChild.Cells("Width").Formula = 2.5
shpChild.Cells("Char.Size").Formula = "= " & 7 & " pt."
'Next
End Sub