OLE Objects Attributes Excel Word Graph

 

Additional to the Common Attributes, this object has the following attributes:

Attribute Name

Description

Type

Values

Default Value

Left

Left position in Twips

Integer

 

0

Top

Top position in Twips

Integer

 

0

Right

Right position in Twips

Integer

 

0

Bottom

Bottom position in Twips

Integer

 

0

LeftF

Left position in Twips

Float

 

0.00F

TopF

Top position in Twips

Float

 

0.00F

RightF

Right position in Twips

Float

 

0.00F

BottomF

Bottom position in Twips

Float

 

0.00F

Page

Page Index where object is located.  Page Number is Page Index + 1.

Integer

>= 0

0

BorderColor

Color for drawing text border.

Color

COLORREF (bbggrr) 000000 to FFFFFF

COLORREF (aabbggrr) 00000000 to FFFFFFFF

000000 (Solid black)

BorderWidth

Width of border around cell.

enum acBorderWidth

Units are in points or 12th of an inch.

0: acBorderWidthNone

1: acBorderWidthSimple

2: acBorderWidthDouble

3: acBorderWidthTriple

4: acBorderWidthQuadruple

0: acBorderWidthNone

Hyperlink

Clicking on the object in Run mode will navigate to the specified location

String

Using URL: http://, ftp: // , mailto:// ,

Using Bookmark: #Ref ex: #Pages[2]

 

Editable

Standard PDF attribute that makes the object editable or not in any viewer.

Boolean

True / False

True

Locked

Object cannot be modified

Boolean

True / False

False

ProgId

OLE object class ID

 

 

 

CanActivate

User can Activate.

Boolean

True/False

True

Hidden

Hidden in certain report states

Integer

A binary combination of the following values:

1: Hidden in Run mode

2: Hidden in Design mode

4: Reserved value

8: Hidden in Print preview

16: Hidden in Annotation mode

0: Always visible

 

Example

Sub Sample()
    ' Constants for Activation codes
    Const strLicenseTo As String = "Amyuni PDF Creator Evaluation"
    Const strActivationCode As String = "07EFCDAB010001004282943F2AF19A88F332D9E781E40460727DF8A42847A1BDE06DB61C71E94E2D90424BF8762385335F9D6884E9FC"
 
    ' Initializing PDFCreativeX Object
    Dim pdf As ACPDFCREACTIVEX.PDFCreactiveX = New ACPDFCREACTIVEX.PDFCreactiveX()
 
    ' Set license key
    pdf.SetLicenseKey(strLicenseTo, strActivationCode)
 
    ' Set CurrentPage
    pdf.CurrentPage = 1
 
    ' Create a Excel in the current page
    pdf.CreateObject(ACPDFCREACTIVEX.ObjectTypeConstants.acObjectTypeExcel, "Excel1")
    ' Define Object
    Dim oExcel As ACPDFCREACTIVEX.IacObject = pdf.GetObjectByName("Excel1")
    ' General Attributes
    oExcel("Left") = 1000
    oExcel("Right") = 5250
    oExcel("Top") = 0
    oExcel("Bottom") = 5000
    ' Excel Attributes
    oExcel("BorderColor") = &HFF00FF
    oExcel("BorderWidth") = ACPDFCREACTIVEX.acBorderWidth.acBorderWidthSimple
 
    ' Create a Word in the current page
    pdf.CreateObject(ACPDFCREACTIVEX.ObjectTypeConstants.acObjectTypeWord, "Word1")
    ' Define Object
    Dim oWord As ACPDFCREACTIVEX.IacObject = pdf.GetObjectByName("Word1")
    ' General Attributes
    oWord("Left") = 6000
    oWord("Right") = 11250
    oWord("Top") = 0
    oWord("Bottom") = 5000
    ' Word Attributes
    oWord("BorderColor") = &HFF00FF
    oWord("BorderWidth") = ACPDFCREACTIVEX.acBorderWidth.acBorderWidthSimple
 
    ' Create a Graph in the current page
    pdf.CreateObject(ACPDFCREACTIVEX.ObjectTypeConstants.acObjectTypeGraph, "Graph1")
    ' Define Object
    Dim oGraph As ACPDFCREACTIVEX.IacObject = pdf.GetObjectByName("Graph1")
    ' General Attributes
    oGraph("Left") = 1000
    oGraph("Right") = 5250
    oGraph("Top") = 10000
    oGraph("Bottom") = 15000
    ' Graph Attributes
    oGraph("BorderColor") = &HFF00FF
    oGraph("BorderWidth") = ACPDFCREACTIVEX.acBorderWidth.acBorderWidthSimple
 
    ' Create a OLE in the current page
    pdf.CreateObject(ACPDFCREACTIVEX.ObjectTypeConstants.acObjectTypeOLE, "Ole1")
    ' Define Object
    Dim oOle As ACPDFCREACTIVEX.IacObject = pdf.GetObjectByName("Ole1")
    ' General Attributes
    oOle("Left") = 6000
    oOle("Right") = 11250
    oOle("Top") = 10000
    oOle("Bottom") = 15000
    ' OLE Attributes
    oOle("BorderColor") = &HFF00FF
    oOle("BorderWidth") = ACPDFCREACTIVEX.acBorderWidth.acBorderWidthSimple
 
    ' Save PDF
    pdf.Save("c:\temp\CreatePDFDocument_resulting.pdf", ACPDFCREACTIVEX.FileSaveOptionConstants.acFileSaveView)
 
    oExcel = Nothing
    oWord = Nothing
    oGraph = Nothing
    oOle = Nothing
End Sub
static void Sample()
{
    // Constants for Activation codes
    const string strLicenseTo = "Amyuni PDF Creator Evaluation";
    const string strActivationCode = "07EFCDAB010001004282943F2AF19A88F332D9E781E40460727DF8A42847A1BDE06DB61C71E94E2D90424BF8762385335F9D6884E9FC";
 
    // Initializing PDFCreativeX Object
    ACPDFCREACTIVEX.PDFCreactiveX pdf = new ACPDFCREACTIVEX.PDFCreactiveX();
 
    // Set license key
    pdf.SetLicenseKey(strLicenseTo, strActivationCode);
 
    // Set CurrentPage
    pdf.CurrentPage = 1;
 
    // Create a Excel in the current page
    pdf.CreateObject(ACPDFCREACTIVEX.ObjectTypeConstants.acObjectTypeExcel, "Excel1");
    // Define Object
    ACPDFCREACTIVEX.IacObject oExcel = pdf.GetObjectByName("Excel1");
    // General Attributes
    oExcel["Left"] = 1000;
    oExcel["Right"] = 5250;
    oExcel["Top"] = 0;
    oExcel["Bottom"] = 5000;
    // Excel Attributes
    oExcel["BorderColor"] = 0xFF00FF;
    oExcel["BorderWidth"] = ACPDFCREACTIVEX.acBorderWidth.acBorderWidthSimple;
 
    // Create a Word in the current page
    pdf.CreateObject(ACPDFCREACTIVEX.ObjectTypeConstants.acObjectTypeWord, "Word1");
    // Define Object
    ACPDFCREACTIVEX.IacObject oWord = pdf.GetObjectByName("Word1");
    // General Attributes
    oWord["Left"] = 6000;
    oWord["Right"] = 11250;
    oWord["Top"] = 0;
    oWord["Bottom"] = 5000;
    // Word Attributes
    oWord["BorderColor"] = 0xFF00FF;
    oWord["BorderWidth"] = ACPDFCREACTIVEX.acBorderWidth.acBorderWidthSimple;
 
    // Create a Graph in the current page
    pdf.CreateObject(ACPDFCREACTIVEX.ObjectTypeConstants.acObjectTypeGraph, "Graph1");
    // Define Object
    ACPDFCREACTIVEX.IacObject oGraph = pdf.GetObjectByName("Graph1");
    // General Attributes
    oGraph["Left"] = 1000;
    oGraph["Right"] = 5250;
    oGraph["Top"] = 10000;
    oGraph["Bottom"] = 15000;
    // Graph Attributes
    oGraph["BorderColor"] = 0xFF00FF;
    oGraph["BorderWidth"] = ACPDFCREACTIVEX.acBorderWidth.acBorderWidthSimple;
 
    // Create a OLE in the current page
    pdf.CreateObject(ACPDFCREACTIVEX.ObjectTypeConstants.acObjectTypeOLE, "Ole1");
    // Define Object
    ACPDFCREACTIVEX.IacObject oOle = pdf.GetObjectByName("Graph1");
    // General Attributes
    oOle["Left"] = 6000;
    oOle["Right"] = 11250;
    oOle["Top"] = 10000;
    oOle["Bottom"] = 15000;
    // OLE Attributes
    oOle["BorderColor"] = 0xFF00FF;
    oOle["BorderWidth"] = ACPDFCREACTIVEX.acBorderWidth.acBorderWidthSimple;
 
    // Save PDF
    pdf.Save(@"c:\temp\CreatePDFDocument_resulting.pdf", ACPDFCREACTIVEX.FileSaveOptionConstants.acFileSaveView);
 
 
    oExcel = null;
    oWord = null;
    oGraph = null;
    oOle = null;
}
#import "c:\users\amyuni\pdfcreactivex.dll" no_namespace
 
using namespace std;
 
int main()
{
    // Constants for Activation codes
    bstr_t strLicenseTo = "Amyuni PDF Creator Evaluation";
    bstr_t strActivationCode = "07EFCDAB010001004282943F2AF19A88F332D9E781E40460727DF8A42847A1BDE06DB61C71E94E2D90424BF8762385335F9D6884E9FC";
 
    // Initialize the COM subsystem
    CoInitialize(0);
 
    // IPDFCreactiveXPtr is a smart pointer type defined in pdfcreactivex.tlh,
    // the type library header file generated by the #import instruction above
    IPDFCreactiveXPtr pdf;
 
    // Create the PDFCreactiveX instance
    pdf.CreateInstance(__uuidof(PDFCreactiveX));
 
    // set license key
    pdf->SetLicenseKey(_bstr_t(strLicenseTo), _bstr_t(strActivationCode));
 
    // Set CurrentPage
    pdf->CurrentPage = 1;
 
    // Create a Excel in the current page
    pdf->CreateObject(acObjectTypeExcel, "Excel1");
 
    // Define Object
    IacObjectPtr oExcel = pdf->GetObjectByName("Excel1");
 
    // General Attributes
    oExcel->Attribute["Left"] = 1000;
    oExcel->Attribute["Right"] = 5250;
    oExcel->Attribute["Top"] = 0;
    oExcel->Attribute["Bottom"] = 5000;
    // Excel Attributes
    _variant_t varAttribute;
    varAttribute.vt = VT_I4;  // integers
    varAttribute.lVal = 0xFF00FF;
    oExcel->Attribute["BorderColor"] = varAttribute;
    varAttribute.lVal = acBorderWidthSimple;
    oExcel->Attribute["BorderWidth"] = varAttribute;
 
    // Create a Word in the current page
    pdf->CreateObject(acObjectTypeExcel, "Word1");
 
    // Define Object
    IacObjectPtr oWord = pdf->GetObjectByName("Word1");
 
    // General Attributes
    oWord->Attribute["Left"] = 6000;
    oWord->Attribute["Right"] = 11250;
    oWord->Attribute["Top"] = 0;
    oWord->Attribute["Bottom"] = 5000;
    // Word Attributes
    varAttribute.vt = VT_I4;  // integers
    varAttribute.lVal = 0xFF00FF;
    oWord->Attribute["BorderColor"] = varAttribute;
    varAttribute.lVal = acBorderWidthSimple;
    oWord->Attribute["BorderWidth"] = varAttribute;
 
    // Create a Graph in the current page
    pdf->CreateObject(acObjectTypeGraph, "Graph1");
 
    // Define Object
    IacObjectPtr oGraph = pdf->GetObjectByName("Graph1");
 
    // General Attributes
    oGraph->Attribute["Left"] = 1000;
    oGraph->Attribute["Right"] = 5250;
    oGraph->Attribute["Top"] = 10000;
    oGraph->Attribute["Bottom"] = 15000;
    // Graph Attributes
    varAttribute.vt = VT_I4;  // integers
    varAttribute.lVal = 0xFF00FF;
    oGraph->Attribute["BorderColor"] = varAttribute;
    varAttribute.lVal = acBorderWidthSimple;
    oGraph->Attribute["BorderWidth"] = varAttribute;
 
    // Create a OLE in the current page
    pdf->CreateObject(acObjectTypeOLE, "Ole1");
 
    // Define Object
    IacObjectPtr oOle = pdf->GetObjectByName("Ole1");
 
    // General Attributes
    oOle->Attribute["Left"] = 6000;
    oOle->Attribute["Right"] = 11250;
    oOle->Attribute["Top"] = 10000;
    oOle->Attribute["Bottom"] = 15000;
    // OLE Attributes
    varAttribute.vt = VT_I4;  // integers
    varAttribute.lVal = 0xFF00FF;
    oOle->Attribute["BorderColor"] = varAttribute;
    varAttribute.lVal = acBorderWidthSimple;
    oOle->Attribute["BorderWidth"] = varAttribute;
 
    // Save PDF
    pdf->Save("c:\\temp\\CreatePDFDocument_resulting.pdf", acFileSaveView);
 
    // destroy objects
    pdf = NULL;
    oExcel = NULL;
    oWord = NULL;
    oGraph = NULL;
    oOle = NULL;
 
    return 0;
}
' acBorderWidth Constants
Const acBorderWidthNone = 0
Const acBorderWidthSimple = 1
Const acBorderWidthDouble = 2
Const acBorderWidthTriple = 3
Const acBorderWidthQuadruple = 4
 
' ObjectTypeConstants
Const acObjectTypeArrow = 36
Const acObjectTypeBarcode = 45
Const acObjectTypeCell = 33
Const acObjectTypeCheckBox = 21
Const acObjectTypeEllipse = 4
Const acObjectTypeExcel = 17
Const acObjectTypeField = 6
Const acObjectTypeFrame = 2
Const acObjectTypeGraph = 19
Const acObjectTypeHighlight = 23
Const acObjectTypeLine = 1
Const acObjectTypeOLE = 20
Const acObjectTypePicture = 7
Const acObjectTypePolygon = 8
Const acObjectTypeRoundFrame = 3
Const acObjectTypeRow = 32
Const acObjectTypeSelection = 24
Const acObjectTypeSignature = 39
Const acObjectTypeStickyNote = 22
Const acObjectTypeTable = 16
Const acObjectTypeText = 5
Const acObjectTypeWord = 18
 
' FileSaveOptionConstants
Const acFileSaveAll = 0
Const acFileSaveDefault = -1
Const acFileSaveView = 1
Const acFileSaveDesign = 2
Const acFileSavePDFA_7 = 3
Const acFileSavePDFA = 4
Const acFileSavePDF14 = 5
 
' Constants for Activation codes
Const strLicenseTo = "Amyuni PDF Creator Evaluation"
Const strActivationCode = "07EFCDAB010001004282943F2AF19A88F332D9E781E40460727DF8A42847A1BDE06DB61C71E94E2D90424BF8762385335F9D6884E9FC"
 
' Initializing PDFCreativeX Object
Dim pdf
Set pdf = CreateObject("PDFCreactiveX.PDFCreactiveX.6.5")
 
' Set license key
pdf.SetLicenseKey strLicenseTo, strActivationCode
 
' Set CurrentPage
pdf.CurrentPage = 1
 
' Create a Excel in the current page
pdf.CreateObject acObjectTypeExcel, "Excel1"
' Define Object
Dim oExcel 
Set oExcel = pdf.GetObjectByName("Excel1")
' General Attributes
oExcel("Left") = 1000
oExcel("Right") = 5250
oExcel("Top") = 0
oExcel("Bottom") = 5000
' Excel Attributes
oExcel("BorderColor") = &HFF00FF
oExcel("BorderWidth") = acBorderWidthSimple
 
' Create a Word in the current page
pdf.CreateObject acObjectTypeWord, "Word1"
' Define Object
Dim oWord 
Set oWord = pdf.GetObjectByName("Word1")
' General Attributes
oWord("Left") = 6000
oWord("Right") = 11250
oWord("Top") = 0
oWord("Bottom") = 5000
' Word Attributes
oWord("BorderColor") = &HFF00FF
oWord("BorderWidth") = acBorderWidthSimple
 
' Create a Graph in the current page
pdf.CreateObject acObjectTypeGraph, "Graph1"
' Define Object
Dim oGraph 
Set oGraph = pdf.GetObjectByName("Graph1")
' General Attributes
oGraph("Left") = 1000
oGraph("Right") = 5250
oGraph("Top") = 10000
oGraph("Bottom") = 15000
' Graph Attributes
oGraph("BorderColor") = &HFF00FF
oGraph("BorderWidth") = acBorderWidthSimple
 
' Create a OLE in the current page
pdf.CreateObject acObjectTypeOLE, "Ole1"
' Define Object
Dim oOle 
Set oOle = pdf.GetObjectByName("Ole1")
' General Attributes
oOle("Left") = 6000
oOle("Right") = 11250
oOle("Top") = 10000
oOle("Bottom") = 15000
' OLE Attributes
oOle("BorderColor") = &HFF00FF
oOle("BorderWidth") = acBorderWidthSimple
 
' Save PDF
pdf.Save "c:\temp\CreatePDFDocument_resulting.pdf", acFileSaveView
 
' destroy Objects
Set pdf = Nothing
Set doc = Nothing
Set oExcel = Nothing
Set oWord = Nothing
Set oGraph = Nothing
Set oOle = Nothing