Add in pour Word et OutLook

daghfous11 Messages postés 9 Date d'inscription mercredi 7 mai 2008 Statut Membre Dernière intervention 9 juillet 2009 - 8 mai 2009 à 05:18
daghfous11 Messages postés 9 Date d'inscription mercredi 7 mai 2008 Statut Membre Dernière intervention 9 juillet 2009 - 8 mai 2009 à 05:36
Salut,
Je cherche, dans le cadre d'un projet d'etudes, à créer un add in pour word et Outlook.
Ce que je veux faire c'est bloquer la copie dans le presse papier et la suppression du contenue des fichiers word protègés (selon le nom et le path du fichier) et interdire la jointure des fichiers dans outlook.
Pour le moment, j'ai arrivé à ouvrir un fichier word et à y ajouter des chaines de caractère à partir d'une fenètre séparée.
Y a-t-il qui peut me donner le bon chemin pour continuer?
Please!!!

1 réponse

daghfous11 Messages postés 9 Date d'inscription mercredi 7 mai 2008 Statut Membre Dernière intervention 9 juillet 2009
8 mai 2009 à 05:36
Le code que j'ai développé est le suivant:

using

System;
using

System.Collections.Generic;
using

System.ComponentModel;
using

System.Data;
using

System.Drawing;
using

System.Linq;
using

System.Text;
using

System.Windows.Forms;
using

System.Xml.Linq;
using

Word = Microsoft.Office.Interop.Word;
using

Office = Microsoft.Office.Core;
namespace

WindowsFormsApplication1{

public
partial
class
Form1 :
Form{

Word.

DocumentClass msWord;

public Form1(){

InitializeComponent();

}

private
void fileToolStripMenuItem_Click(
object sender,
EventArgs e){

}

private
void newToolStripMenuItem_Click(
object sender,
EventArgs e){

msWord =

new Word.
DocumentClass();

object readOnly =
true;

object fileName =
@"D:\daghfous.docx";

object missing = System.Reflection.
Missing.Value;msWord.Application.Documents.Open(

ref fileName,

ref missing,
ref readOnly,
ref missing,
ref missing,
ref missing,

ref missing,
ref missing,
ref missing,
ref missing,
ref missing,

ref missing,
ref missing,
ref missing,
ref missing,
ref missing);

}

private
void button1_Click(
object sender,
EventArgs e){

msWord.Content.InsertAfter(textBox1.Text);

}

}

}

La fenètre:
0
Rejoignez-nous