Posted 4 August 2017, 2:38 pm ESTHi --<br> <br> I'm a new AR user (I think my question makes that fairly obvious). I'm trying to list the reports I have available by iterating through a specified directory, loading the layout and reading out the .captions property. But it always returns empty. I've had some success with the .UserData, but a) that data sometimes disappears, and I haven't been able to figure out exactly which conditions cause that to happen and b) I'd like to use that property for something else.<br> <br> I'd appreciate any help.<br> <br> Thanks! <br> <br> <font face="Courier New" size="2"> Dim RptsDir As String<br> RptsDir = pth & reports & "\"<br> Dim fs, fldr, fls, fl<br> Set fs = CreateObject("Scripting.FileSystemObject")<br> Set fldr = fs.GetFolder(RptsDir)<br> Set fls = fldr.Files<br> For Each fl In fls<br> Dim rptName As String<br> Dim AR As ActiveReport<br> Set AR = New ActiveReport<br> AR.LoadLayout s<br> rptName = AR.Caption<br> Next</font>
Can't read .caption at runtime?
Posted by: davinaster on 4 August 2017, 2:38 pm EST
Replied 4 August 2017, 2:38 pm ESTThe Caption property is intended for the VB designer window and is therefore not written out to the RPX file that you are loading. If you open thi RPX file (it is in XML), you can see all of the changed properties that are saved with the report. UserData should always be saved.<br>