I am using an activeX control for the PDF-XChange Viewer software.
Their support team gave me the following code sample:
<html>
<head>
<title>PDF-XChange Viewer ActiveX test...</title>
<script language="VBScript">
Sub btnGetProperty_OnClick()
PXCV.OpenDocument "/sandpit/appsheet/faxcentre2/Faxes/1234-56789-abc-123-3.pdf", 0, 0, 0
End Sub
</script>
</head>
<body>
<input type="button" id="btnGetProperty" value="Open document"></br>
<object id="PXCV" classid="CLSID:FE36F0F3-F082-41B7-9EED-772505A7C054" width="500" height="480">
</object>
</body>
</html>
And this works fine in our standard browser (IE7) which is acceptable as this is an internal project.
However if I add this into a standard SharePoint page by editing it using SharePoint designer and adding the VBScript to the AdditionalPageHead content area and the INPUT and OBJECT tags into the Main content area, then the code fails.
The error that is reported is:
Error: Object required: 'PXCV'
Does anyone know what might be different between these two? Obviously SP includes a lot of other scripts and controls and the PXCV object is located entirely differently within the DOM, maybe this is the problem. Or is it top do with the presence of other scripts (all Javascript as far as I know) within the page?