Si on admets que la résultat de ta transformation xslt est le string Transformed voici mon code:
string temp = Environment.GetEnvironmentVariable("TEMP");
XmlDocument XmlSave = new XmlDocument();
XmlSave.LoadXml(Transformed);
int cpt = 0;
try
{
XmlSave.Save(temp + "\\form0.pnet");
}
catch (Exception)
{
bool ok = false;
while ((ok == false) && (cpt <= 15))
{
cpt = cpt + 1;
try
{
XmlSave.Save(temp + "\\form" + cpt + ".pnet");
ok = true;
}
catch (Exception)
{
continue;
}
}
if (cpt == 16)
{
thisXDocument.UI.Alert("Sie haben zuviel formular geöffnet(16)!");
return;
}
}
string Recup = temp + "\\form" + cpt + ".pnet";
// instanciés les paramètre de word
Word.Application newApp = new Word.Application();
object o = System.Reflection.Missing.Value;
object Source = Recup;
//newApp.Path = @"C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE";
newApp.Visible = true;
//démarrage de word
newApp.Documents.Open(ref Source, ref o, ref o, ref o, ref o, ref o, ref o, ref o, ref o, ref o, ref o, ref o, ref o, ref o, ref o, ref o);
La boucle permet si d'ouvrir un autre document si un est déjà ouvert limite le tout a 16 word ouvert!
J'espère que ca t'aidera
++
Thierry
Infopath 2007, Langage: C#2.0 (Modèle Objet 2003)
merci de lire ceci