I have created a Field which has a defined background color, this shows just great in the OCX viewer, however it does not show on a saved document when loaded into adobe PDF viewer(5.0).
The code I have used is as below, i pass the cords into the function below, currently I have the back color hard coded in, it is the field version of this that is not working.
--------------------------------------
Code: Select all
Public Sub PDFPrintLine(ByRef pPrintObject As Object, lX1 As Single, lY1 As Single, lX2 As Single, lY2 As Single, pColour As Long, boxswitch As String)
Dim sCurCol As String
sCurCol = "000000"
Set printObject = pPrintObject
'Create a new print Object
currentObjectCount = currentObjectCount + 1
Select Case LCase(boxswitch)
Case ""
currentObjectName = "Line" & pObjectCount
PDFO.CreateObject acObjectTypeLine, ObjectName
Set currentObject = PDFO.GetObjectByName(ObjectName)
With currentObject
.Attribute("StrokeColor") = sCurCol
End With
Case "b"
currentObjectName = "Frame" & pObjectCount
PDFO.CreateObject acObjectTypeFrame, ObjectName
Set currentObject = PDFO.GetObjectByName(ObjectName)
With currentObject
.Attribute("StrokeColor") = sCurCol
End With
Case "bf"
currentObjectName = "Field" & pObjectCount
PDFO.CreateObject acObjectTypeField, ObjectName
Set currentObject = PDFO.GetObjectByName(ObjectName)
With currentObject
.Attribute("BackColor") = "296BF7"
End With
End Select
With currentObject
.Attribute("Left") = lX1
.Attribute("Top") = lY1
.Attribute("Right") = lX2
.Attribute("Bottom") = lY2
End With
End Sub
Code: Select all
PDFO.ReportState = acReportStateRun
PDFO.Open sPDFPath, ""
PDFO.Save PDFPath, 0
Many thanks
Andrew
Code: Select all