Sub Access()
Dim doc As busobj.Document
Dim reps As busobj.Reports
Dim rep As busobj.Report
Dim sectionstruc As busobj.SectionStructure
Dim reportstructureitem As busobj.reportstructureitem
Dim reportstructureitems As busobj.reportstructureitems
Dim blockstruc As busobj.BlockStructure
Dim piv As busobj.Pivot
Dim doc_var As busobj.DocumentVariable
Dim row_var As busobj.DocumentVariable
Dim col_var As busobj.DocumentVariable
Dim doc_vars As busobj.DocumentVariables
Dim var As Variant
Dim j As Integer
Dim n As Integer
Dim i As Integer
Dim p, k As Integer
Dim myarr(5000, 5000) As Variant
Set doc = ActiveDocument
Set rep = doc.Reports.Item("Report1"
Set sectionstruc = rep.GeneralSectionStructure
Set reportstructureitems = sectionstruc.Body
For j = 1 To reportstructureitems.Count
Set reportstructureitem = reportstructureitems.Item(j)
Debug.Print "in j loop"
If reportstructureitem.Type = boTable Then
Set blocstruc = reportstructureitem
'This is essential so that all the properties are inherited
'from the ReportStructureItem to the BlockSructure
End If
Set piv = blocstruc.Pivot
Debug.Print p
For n = 2 To piv.BodyCount
Set doc_var = piv.Body
var = doc_var.Values(BoAllValues)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.