Ver Mensaje Individual
  #1 (permalink)  
Antiguo 04/11/2010, 03:07
javaprendiz
 
Fecha de Ingreso: agosto-2006
Mensajes: 45
Antigüedad: 17 años, 9 meses
Puntos: 0
Ayuda con Objeto ActiveX

Hola,

Tengo el siguiente código para enviar un documento de una biblioteca sharepoint como adjunto:

Código PHP:
<SCRIPT LANGUAGE="JavaScript">
function 
Custom_AddDocLibMenuItems(m,ctx)
{
strDisplayText "Envie documento por E-mail";
strDisplayTextAtt "Envie documento por E-mail como Adjunto";
strBody "Mira este documento, por favor...";
strImagePath ctx.imagesPath "mapi16.gif";

URL "";
index itemTable.innerHTML.indexOf("href=");

if (
index 0)
{
  
str itemTable.innerHTML.substr(index 6);
  
index str.indexOf(´'"');
  if (
index 0)
  {
    
URL str.substr(0index);
  }
}

if (
URL != "")
{
  
strAction 'window.navigate("mailto:%20?subject=" + strBody + "&body=<' URL '>")';
  
strActionAtt 'SendMessage(URL)';
  
CAMOpt(mstrDisplayTextstrActionstrImagePath);
  
CAMOpt(mstrDisplayTextAttstrActionAttstrImagePath);
  
CAMSep(m);
}
return 
false;
}

function 
SendMessage(URL)
{  
  try   
  {     
    var 
outlook = new ActiveXObject("Outlook.Application");
    var 
msg outlook.CreateItem(0);
    var 
atach msg.Attachments();
    
msg.subject strBody;
    
msg.body strBody;
    
msg.display();
    
atach.Add(URL);
  }
  catch(
e)
  {
    
alert("Error "+e.description);
  }
}

</SCRIPT> 
El problema es que tiene q ejecutar un activeX, por lo es necesario tener el sitio desde el q se ejecuta como sitio de confianza, y poner la seguridad como baja. Es posible ejecutar un ActiveX sin tener que modificar las opciones del Internet Explorer?

Gracias