As per the documentation, I tried doing the following:
PDF.put_ReportState(CPDFCreactiveX::acReportStateDesign);
PDF.CreateObject(CPDFCreactiveX::acObjectTypeHighlight, "HighlighterTest1");
PDF.put_ObjectAttribute("HighlighterTest1", "Left", COleVariant(200L));
PDF.put_ObjectAttribute("HighlighterTest1", "Top", COleVariant(200L));
PDF.put_ObjectAttribute("HighlighterTest1", "Right", COleVariant(600L));
PDF.put_ObjectAttribute("HighlighterTest1", "Bottom", COleVariant(400L));
PDF.put_ObjectAttribute("HighlighterTest1", "BackColor", COleVariant(CString("7FFFFF")));
PDF.put_ReportState(CPDFCreactiveX::acReportStateRun);
PDF.Refresh();
This creates a highlight object, as far as I can tell, but it is not displayed correctly. It is not the specified color, but is instead white (transparent?). Anyway, simply changing the object type from Highlight to Text creates a rectangular textbox of the correct color at the correct location. So it's something specific to the highlight object. What am I missing?
Creating highlight programmatically
Hello,
Please use this code instead:
Hope this helps
Please use this code instead:
Code: Select all
PDF.put_ObjectAttribute("HighlighterTest1", "Highlight Left", COleVariant(200L));
PDF.put_ObjectAttribute("HighlighterTest1", "Highlight Top", COleVariant
(200L));
PDF.put_ObjectAttribute("HighlighterTest1", "Highlight Right", COleVariant
(600L));
PDF.put_ObjectAttribute("HighlighterTest1", "Highlight Bottom", COleVariant
(400L));
PDF.put_ObjectAttribute("HighlighterTest1", "BackColor", COleVariant(CString);
PDF.put_ObjectAttribute("HighlighterTest1", "BackColor", COleVariant(CString("7FFFFF")));
Hope this helps