Hello
I like to use early binding in Access VBA to make use of Intellisense. If you try to set a color property (DefaultFillColor, textColor etc), this gives the runtime error 424 = "Object required", but if I use late binding and define relevant variables as variants, there are no problems.
This gives an error:
Dim DPDoc As DynamicPDF.Document
Set DPDoc = New DynamicPDF.Document
DPDoc.DefaultTextColor = "808080"
But this does not:
Dim DPDoc As DynamicPDF.Document
Dim V as Variant
Set DPDoc = New DynamicPDF.Document
Set V = PDoc
V.DefaultTextColor = "808080"
This gives an error:
...
Dim DPLabel As DynamicPDF.Label
Set DPLabel = DPPage.AddLabel("X", 0, 0, 100, 8)
DPLabel.textColor = "606060"
But this does not:
...
Dim DPLabel As Variant
Set DPLabel = DPPage.AddLabel("X", 0, 0, 100, 8)
DPLabel.textColor = "606060"
Can I do anything different besides using Variant variables?
Btw when is the new V8 final release ready for sale?
(Im testing your product and want to wait buying until the new release).
Thank you in advance.
Best regards
Michael Johansen
Denmark
Color properties and early binding in Access VBA
Re: Color properties and early binding in Access VBA
Support · Jan 6, 2015Hello Michael,
You can use the methods, properties or constants of DynamicPDF API to set the supported styles (like color, font, etc.) instead of using Variant variables. Below is the VB6 code sample for it.
Code sample to set color for the Document object.
Dim DPDoc As DynamicPDF.Document
Set DPDoc = New DynamicPDF.Document
Set DPDoc.DefaultTextColor = DPDoc.Colors.GetWebColor("808080")
Code sample to set color for DynamicPDF Label object.
Dim MyLabel As DynamicPDF.Label
Set MyLabel = MyPage.AddLabel("My Text", 50, 50, 400, 100)
Set MyLabel.TextColor = DPDoc.Colors.GetWebColor("606060")
We are in the process of finalizing v8 release. At this point the approximate timeline is at 2-4 weeks.
Thanks,
ceTe Software Support Team.