
This interface inserts an object onto the HTML page.
This element is a block element.
IHTMLObjectElement Methods
HRESULT get_object(
IDispatch **p
);
References the contained OBJECT. For instance, if the control's object model uses a conflicting name space, preceding the control's property with object resolves the conflict
HRESULT get_classid(
BSTR *p
);
Specifies the class identifier for the OBJECT.
The format is: classid="clsid:controlspecificclsid "
HRESULT get_data(
BSTR *p
);
Retrieves a URL referencing the object's data.
HRESULT get_recordset(
IDispatch **p
);
Retrieves the recordset if the object is a data provider.
HRESULT put_align(
BSTR v
);
Specifies how the element is aligned with adjacent text.
| absbottom | Aligns the bottom of the element with the absolute bottom of the surrounding text. The absolute bottom is equal to the baseline of the text minus the height of the largest descender in the text. |
| absmiddle | Aligns the middle of the element with the middle of the surrounding text. The absolute middle is the midpoint between the absolute bottom and texttop of the surrounding text. |
| baseline | Aligns the bottom of the element with the baseline of the surrounding text. |
| bottom | Aligns the bottom of the element with the bottom of the surrounding text. The bottom is equal to the baseline minus the standard height of a descender in the text. |
| left | Aligns the element to the left of the surrounding text. All preceding and subsequent text flows to the right of the element. This is the default value. |
| middle | Aligns the middle of the element with the surrounding text. |
| right | Aligns the element to the right of the surrounding text. All subsequent text flows to the left of the element. |
| texttop | Aligns the top of the element with the absolute top of the surrounding text. The absolute top is the baseline plus the height of the largest ascender in the text. |
| top | Aligns the top of the element with the top of the text. The top of the text is the baseline plus the standard height of an ascender in the text. |
For the INPUT element, this attribute applies only to the image type. It is undefined for all other types.
See also get_align
HRESULT get_align(
BSTR *p
);
Retrieves how the element is aligned with adjacent text.
| absbottom | Aligns the bottom of the element with the absolute bottom of the surrounding text. The absolute bottom is equal to the baseline of the text minus the height of the largest descender in the text. |
| absmiddle | Aligns the middle of the element with the middle of the surrounding text. The absolute middle is the midpoint between the absolute bottom and texttop of the surrounding text. |
| baseline | Aligns the bottom of the element with the baseline of the surrounding text. |
| bottom | Aligns the bottom of the element with the bottom of the surrounding text. The bottom is equal to the baseline minus the standard height of a descender in the text. |
| left | Aligns the element to the left of the surrounding text. All preceding and subsequent text flows to the right of the element. This is the default value. |
| middle | Aligns the middle of the element with the surrounding text. |
| right | Aligns the element to the right of the surrounding text. All subsequent text flows to the left of the element. |
| texttop | Aligns the top of the element with the absolute top of the surrounding text. The absolute top is the baseline plus the height of the largest ascender in the text. |
| top | Aligns the top of the element with the top of the text. The top of the text is the baseline plus the standard height of an ascender in the text. |
For the INPUT element, this attribute applies only to the image type. It is undefined for all other types.
See also put_align
HRESULT put_name(
BSTR v
);
Sets the name of the control, bookmark, or application.
The name is used to bind the value of the control when submitting a form. The NAME is not the value that is displayed for the button, reset, and submit objects. Submitting the form submits the internally stored value, not the one displayed.
JScript allows the name to be changed at run time. This does not change the name in the programming model, in the collection of elements, but does change the name used for submitting elements.
See also get_name
HRESULT get_name(
BSTR *p
);
Retrieves the name of the control, bookmark, or application.
The name is used to bind the value of the control when submitting a form. The NAME is not the value that is displayed for the button, reset, and submit objects. Submitting the form submits the internally stored value, not the one displayed.
JScript allows the name to be changed at run time. This does not change the name in the programming model, in the collection of elements, but does change the name used for submitting elements.
See also put_name
HRESULT put_codeBase(
BSTR v
);
Sets a URL referencing where to find the implementation of the object.
See also get_codeBase
HRESULT get_codeBase(
BSTR *p
);
Retrieves a URL referencing where to find the implementation of the object.
See also put_codeBase
HRESULT put_codeType(
BSTR v
);
Sets the Internet media type for the code associated with the object.
See also get_codeType
HRESULT get_codeType(
BSTR *p
);
Retrieves the Internet media type for the code associated with the object.
See also put_codeType
HRESULT put_code(
BSTR v
);
Sets a URL referencing where to find the implementation of the object.
See also get_code
HRESULT get_code(
BSTR *p
);
Retrieves a URL referencing where to find the implementation of the object.
See also put_code
HRESULT get_BaseHref(
BSTR *p
);
Returns a string of the BASE href where the object tag can be found. This is often the base href of the document that the object is in, or the value set by a BASE tag.
The BASE tag is used to ensure that your document's relative links are associated with the proper document path.
<BASE HREF="http://www.sample.com/hello.htm">
HRESULT put_type(
BSTR v
);
Specifies the MIME type of the object. This is used to retrieve a classid for the object when no CLASSID= attribute is given.
See also get_type
HRESULT get_type(
BSTR *p
);
Retrieves the MIME type of the object. This is used to retrieve a classid for the object when no CLASSID= attribute is given.
See also put_type
HRESULT get_form(
IHTMLFormElement **p
);
Retrieves a reference to the form the element is embedded on.
See also IHTMLFormElement
HRESULT put_width(
VARIANT v
);
Sets the calculated width of the element, in pixels.
This property is an integer value. Although an HTML author can specify the width as a percentage, this property always specifies the width in pixels.
See also get_width
HRESULT get_width(
VARIANT *p
);
Retrieves the calculated width of the element, in pixels.
This property is an integer value. Although an HTML author can specify the width as a percentage, this property always specifies the width in pixels.
See also put_width
HRESULT put_height(
VARIANT v
);
Sets the calculated height of the element, in pixels.
If the value of the corresponding HTML attribute was set using a percentage, this property specifies the height in pixels represented by that percentage.
See also get_height
HRESULT get_height(
VARIANT *p
);
Retrieves the calculated height of the element, in pixels.
If the value of the corresponding HTML attribute was set using a percentage, this property specifies the height in pixels represented by that percentage.
See also put_height
HRESULT get_readyState(
long *p
);
Retrieves the current state of an object being downloaded.
| complete | The object is completely loaded. |
| interactive | The object can be interacted with even though it is not fully loaded. |
| loading | The object is currently being loaded. |
| unitialized | The object is not created. Usually when the object is being downloaded. |
Each object can independently determine which of the states it exposes.
HRESULT put_onreadystatechange(
VARIANT v
);
Sets the inline script associated with the onreadystatechange event on the OBJECT element. This event is fired whenever the readyState for the object has changed.
For more information on inline script, see Attaching an Event Handler in the Understanding the Event Model documentation.
See also get_onreadystatechange
HRESULT get_onreadystatechange(
VARIANT *p
);
Retrieves the inline script associated with the onreadystatechange event on the OBJECT element. This event is fired whenever the readyState for the object has changed.
For more information on inline script, see Attaching an Event Handler in the Understanding the Event Model documentation.
See also put_onreadystatechange
HRESULT put_onerror(
VARIANT v
);
Sets the inline script associated with the onerror event on the OBJECT element. This error event occurs when the loading of the object causes an error.
For more information on inline script, see Attaching an Event Handler in the Understanding the Event Model documentation.
See also get_onerror
HRESULT get_onerror(
VARIANT *p
);
Retrieves the inline script associated with the onerror event on the OBJECT element. This error event occurs when the loading of the object causes an error.
For more information on inline script, see Attaching an Event Handler in the Understanding the Event Model documentation.
See also put_onerror
HRESULT put_altHtml(
BSTR v
);
Sets the string of alternative text that could be displayed instead of the object.
See also get_altHtml
HRESULT get_altHtml(
BSTR *p
);
Returns the string of alternative text that would be displayed for the object if the object is unable to be instantiated, or the browser does not support objects.
See also put_altHtml
HRESULT put_vspace(
long v
);
Sets the amount of vertical space defined in pixels for the object
See also get_vspace
HRESULT get_vspace(
long *p
);
Returns the amount of vertical space defined in pixels for the object.
See also put_vspace
HRESULT put_hspace(
long v
);
Sets the amount of horizontal space defined in pixels for the object
See also get_hspace
HRESULT get_hspace(
long *p
);
Returns the amount of horizontal space defined in pixels for the object.
See also put_hspace
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.