Excel\word

Résolu
tomy7 Messages postés 62 Date d'inscription mardi 22 janvier 2008 Statut Membre Dernière intervention 25 avril 2008 - 25 janv. 2008 à 14:38
cs_MPi Messages postés 3877 Date d'inscription mardi 19 mars 2002 Statut Membre Dernière intervention 17 août 2018 - 25 janv. 2008 à 23:27
bonjour,


je pense que la commance pour ouvrir un doc word  depuis excel est ceci:
Sub openword()


    Dim appword As Word.Application
Set appword = New Word.Application
Application.DisplayAlerts = True
appword.ShowMe
appword.Visible = True
appword.Documents.Open Filename:="D:\My Documents\template\Label\label.doc"
End Sub

mais lorsque je teste ceci une fenetre apparait me disant:"User defined type not defined"
<?xml:namespace prefix v ns "urn:schemas-microsoft-com:vml" /??><v:shapetype id="_x0000_t75" stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"> <v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"></v:path><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /??><o:lock aspectratio="t" v:ext="edit"></o:lock></v:shapetype><v:shape id="_x0000_i1025" style="WIDTH: 216.6pt; HEIGHT: 132.6pt" type="#_x0000_t75"><v:imagedata cropright="23180f" cropleft=".375" cropbottom="23572f" croptop="27340f" o:title="" src="file:///C:\temp\msohtml1\02\clip_image001.png"></v:imagedata></v:shape>
Que  dois je faire?  Help........
merci

3 réponses

tomy7 Messages postés 62 Date d'inscription mardi 22 janvier 2008 Statut Membre Dernière intervention 25 avril 2008
25 janv. 2008 à 15:35
probleme resolu comme un grand!
solutions
ds vba
aller ds tools
   puis reference
      puis cocher MS DAO 3.6 object library 
       ainsi que MS word 11.0 object library
voila tout
3
tomy7 Messages postés 62 Date d'inscription mardi 22 janvier 2008 Statut Membre Dernière intervention 25 avril 2008
25 janv. 2008 à 15:21
et j ai coche dans reference tools Ms DAO 3.6 obkect library!
je ne sais pas d'ou vient le probleme!
0
cs_MPi Messages postés 3877 Date d'inscription mardi 19 mars 2002 Statut Membre Dernière intervention 17 août 2018 23
25 janv. 2008 à 23:27
MS DAO seulement si tu utilises le moteur Jet d'Access avec la technologie DAO.
Sinon, enlève cette référence qui ne sert à rien...

Pour communiquer avec Word via une référence, seule la référence Word est nécessaire.

Si tu ne veux pas utiliser de référence, utilise la commande CreateObject("Word.Application")
plutôt que le New Word.Application

MPi²
Pour ceux qui programment sous Office, n'oubliez pas qu'il existe un forum dédié à ces applications VBA....... ICI
0
Rejoignez-nous