2014-11-03 162 views

回答

0

您可以为所有字段/文本做到这一点。见下:

aa = Report.Sections.Item("D").ReportObjects.Count 
For i = 1 To aa 
    Set crxFieldObject = Report.Sections.Item("D").ReportObjects.Item(i) 
    bb = crxFieldObject.Name 
    If Mid(bb, 1, 5) = "Field" Then 
     cc = Val(Mid(bb, 6)) 
     For j = 1 To NumberOfFields 'your value 
      If cc = xxxxx Then 'if your condition 
       crxFieldObject.suppress = False 
       crxFieldObject.Left = Leftxxxx 'your value 
       crxFieldObject.Top = Topxxxx 'your value 
       crxFieldObject.Font.Size = Fontsizexxxx 'your value 
       TenPointHeight = 221 'you can change this, too 
       If crxFieldObject.Font.Size = 10 Then 
        crxFieldObject.Height = TenPointHeight 
       Else 
        crxFieldObject.Height = TenPointHeight * crxFieldObject.Font.Size/10 
       End If 
      End If 
     Next j 
    End If 
Next i