Salut,
Voici mon code :
Set WinWord = CreateObject("Word.application")
With WinWord
.WindowState = wdWindowStateMinimize
.Visible = False
If .Documents.Count = 1 Then
Set Doc = .Documents(1)
Else
Set Doc = .Documents.Add
End If
DoEvents
End With
If Doc Is Nothing Or Err <> 0 Then
If IsWordDoc Then
Doc.Close False
Set Doc = Nothing
WinWord.Quit False
DoEvents
Set WinWord = Nothing
DoEvents
End If
Exit Sub
End If
With Doc
.Activate
.OptimizeForWord97 = True
.PageSetup.PaperSize = wdPaperA4
.PageSetup.LineNumbering.Active = False
.PageSetup.Orientation = wdOrientPortrait
.PageSetup.TopMargin = CentimetersToPoints(1.5)
.PageSetup.BottomMargin = CentimetersToPoints(2)
.PageSetup.LeftMargin = CentimetersToPoints(0.5)
.PageSetup.RightMargin = CentimetersToPoints(0.5)
.PageSetup.PageWidth = CentimetersToPoints(21)
.PageSetup.PageHeight = CentimetersToPoints(29.7)
.PageSetup.VerticalAlignment = wdAlignVerticalTop
End With
With Doc
.Close False
Set Doc = Nothing
End With
WinWord.Quit False
DoEvents
Set WinWord = Nothing
DoEvents
Hope this helps...
Christian
--
Pour répondre à ce message, utilisez EXCLUSIVEMENT ce lien :
http://couriel.biz/c2h/
********************************************************
Bonjour,
Cordialement
Christian Hubert-Hugoud
"lou" a écrit dans le message de
news:41a7860b$0$25044$
> bonjour
> je me serts de ce code pour travailler un fichier word
> apparament il fonctionne bien
>
> mais apres avoir fait plusieurs essais
> mon pc n'en pouvais plus et je me suis demandé pourquoi ??? apres
> cherché ,
>
> je suis allé voir dans le gestionnaire des taches et la j'ai vu des
> dizaines de word dans
> le processus , j'ai du passer par le fin de tache pour les enlever
>
> Set W_App = Nothing ne marche pas
> comment fermer word sans qu'il reste dans le processus
> je ne trouve pas la solution
> un petit peu d'aide svp
>
>
> voici le code en question
>
> Private Sub Commande95_Click()
> aa.Object.Application.Options.BackgroundSave = False
> aa.Object.Application.Options.AllowFastSave = True
> aa.Object.SaveAs "C:PDFTEMP.doc"
>
> Dim W_App As Object
> Set W_App = CreateObject("Word.Application")
> With W_App
> .Visible = False
> .Documents.Open ("C:PDFTEMP.doc")
> .Selection.HomeKey Unit:=wdStory
> .Selection.EndKey Unit:=wdStory, Extend:=wdExtend
> .Selection.Copy
> .ActiveDocument.Close wdDoNotSaveChanges
>
> .Quit
>
> Set W_App = Nothing
>
> End With
>
> End Sub
>
> merci de votre aide
>
>
>
>
>
Salut,
Voici mon code :
Set WinWord = CreateObject("Word.application")
With WinWord
.WindowState = wdWindowStateMinimize
.Visible = False
If .Documents.Count = 1 Then
Set Doc = .Documents(1)
Else
Set Doc = .Documents.Add
End If
DoEvents
End With
If Doc Is Nothing Or Err <> 0 Then
If IsWordDoc Then
Doc.Close False
Set Doc = Nothing
WinWord.Quit False
DoEvents
Set WinWord = Nothing
DoEvents
End If
Exit Sub
End If
With Doc
.Activate
.OptimizeForWord97 = True
.PageSetup.PaperSize = wdPaperA4
.PageSetup.LineNumbering.Active = False
.PageSetup.Orientation = wdOrientPortrait
.PageSetup.TopMargin = CentimetersToPoints(1.5)
.PageSetup.BottomMargin = CentimetersToPoints(2)
.PageSetup.LeftMargin = CentimetersToPoints(0.5)
.PageSetup.RightMargin = CentimetersToPoints(0.5)
.PageSetup.PageWidth = CentimetersToPoints(21)
.PageSetup.PageHeight = CentimetersToPoints(29.7)
.PageSetup.VerticalAlignment = wdAlignVerticalTop
End With
With Doc
.Close False
Set Doc = Nothing
End With
WinWord.Quit False
DoEvents
Set WinWord = Nothing
DoEvents
Hope this helps...
Christian
--
Pour répondre à ce message, utilisez EXCLUSIVEMENT ce lien :
http://couriel.biz/c2h/
********************************************************
Bonjour,
Cordialement
Christian Hubert-Hugoud
"lou" <colluluigi@skynet.be> a écrit dans le message de
news:41a7860b$0$25044$ba620e4c@news.skynet.be...
> bonjour
> je me serts de ce code pour travailler un fichier word
> apparament il fonctionne bien
>
> mais apres avoir fait plusieurs essais
> mon pc n'en pouvais plus et je me suis demandé pourquoi ??? apres
> cherché ,
>
> je suis allé voir dans le gestionnaire des taches et la j'ai vu des
> dizaines de word dans
> le processus , j'ai du passer par le fin de tache pour les enlever
>
> Set W_App = Nothing ne marche pas
> comment fermer word sans qu'il reste dans le processus
> je ne trouve pas la solution
> un petit peu d'aide svp
>
>
> voici le code en question
>
> Private Sub Commande95_Click()
> aa.Object.Application.Options.BackgroundSave = False
> aa.Object.Application.Options.AllowFastSave = True
> aa.Object.SaveAs "C:PDFTEMP.doc"
>
> Dim W_App As Object
> Set W_App = CreateObject("Word.Application")
> With W_App
> .Visible = False
> .Documents.Open ("C:PDFTEMP.doc")
> .Selection.HomeKey Unit:=wdStory
> .Selection.EndKey Unit:=wdStory, Extend:=wdExtend
> .Selection.Copy
> .ActiveDocument.Close wdDoNotSaveChanges
>
> .Quit
>
> Set W_App = Nothing
>
> End With
>
> End Sub
>
> merci de votre aide
>
>
>
>
>
Salut,
Voici mon code :
Set WinWord = CreateObject("Word.application")
With WinWord
.WindowState = wdWindowStateMinimize
.Visible = False
If .Documents.Count = 1 Then
Set Doc = .Documents(1)
Else
Set Doc = .Documents.Add
End If
DoEvents
End With
If Doc Is Nothing Or Err <> 0 Then
If IsWordDoc Then
Doc.Close False
Set Doc = Nothing
WinWord.Quit False
DoEvents
Set WinWord = Nothing
DoEvents
End If
Exit Sub
End If
With Doc
.Activate
.OptimizeForWord97 = True
.PageSetup.PaperSize = wdPaperA4
.PageSetup.LineNumbering.Active = False
.PageSetup.Orientation = wdOrientPortrait
.PageSetup.TopMargin = CentimetersToPoints(1.5)
.PageSetup.BottomMargin = CentimetersToPoints(2)
.PageSetup.LeftMargin = CentimetersToPoints(0.5)
.PageSetup.RightMargin = CentimetersToPoints(0.5)
.PageSetup.PageWidth = CentimetersToPoints(21)
.PageSetup.PageHeight = CentimetersToPoints(29.7)
.PageSetup.VerticalAlignment = wdAlignVerticalTop
End With
With Doc
.Close False
Set Doc = Nothing
End With
WinWord.Quit False
DoEvents
Set WinWord = Nothing
DoEvents
Hope this helps...
Christian
--
Pour répondre à ce message, utilisez EXCLUSIVEMENT ce lien :
http://couriel.biz/c2h/
********************************************************
Bonjour,
Cordialement
Christian Hubert-Hugoud
"lou" a écrit dans le message de
news:41a7860b$0$25044$
> bonjour
> je me serts de ce code pour travailler un fichier word
> apparament il fonctionne bien
>
> mais apres avoir fait plusieurs essais
> mon pc n'en pouvais plus et je me suis demandé pourquoi ??? apres
> cherché ,
>
> je suis allé voir dans le gestionnaire des taches et la j'ai vu des
> dizaines de word dans
> le processus , j'ai du passer par le fin de tache pour les enlever
>
> Set W_App = Nothing ne marche pas
> comment fermer word sans qu'il reste dans le processus
> je ne trouve pas la solution
> un petit peu d'aide svp
>
>
> voici le code en question
>
> Private Sub Commande95_Click()
> aa.Object.Application.Options.BackgroundSave = False
> aa.Object.Application.Options.AllowFastSave = True
> aa.Object.SaveAs "C:PDFTEMP.doc"
>
> Dim W_App As Object
> Set W_App = CreateObject("Word.Application")
> With W_App
> .Visible = False
> .Documents.Open ("C:PDFTEMP.doc")
> .Selection.HomeKey Unit:=wdStory
> .Selection.EndKey Unit:=wdStory, Extend:=wdExtend
> .Selection.Copy
> .ActiveDocument.Close wdDoNotSaveChanges
>
> .Quit
>
> Set W_App = Nothing
>
> End With
>
> End Sub
>
> merci de votre aide
>
>
>
>
>
bonjour christian
un grand merci grace a ton code j'ai pu bidouiller
un truc qui fonctionne enfin
je n'ai plus de WORD non termine dans le processus
un grand merci pour ton aide
lou
"Christian HUBERT-HUGOUD- Xtrem7" a écrit dans le
message de news: co97cc$efl$
> Salut,
>
> Voici mon code :
>
> Set WinWord = CreateObject("Word.application")
>
> With WinWord
> .WindowState = wdWindowStateMinimize
> .Visible = False
> If .Documents.Count = 1 Then
> Set Doc = .Documents(1)
> Else
> Set Doc = .Documents.Add
> End If
> DoEvents
> End With
>
> If Doc Is Nothing Or Err <> 0 Then
> If IsWordDoc Then
> Doc.Close False
> Set Doc = Nothing
> WinWord.Quit False
> DoEvents
> Set WinWord = Nothing
> DoEvents
> End If
> Exit Sub
> End If
>
> With Doc
>
> .Activate
> .OptimizeForWord97 = True
> .PageSetup.PaperSize = wdPaperA4
> .PageSetup.LineNumbering.Active = False
> .PageSetup.Orientation = wdOrientPortrait
> .PageSetup.TopMargin = CentimetersToPoints(1.5)
> .PageSetup.BottomMargin = CentimetersToPoints(2)
> .PageSetup.LeftMargin = CentimetersToPoints(0.5)
> .PageSetup.RightMargin = CentimetersToPoints(0.5)
> .PageSetup.PageWidth = CentimetersToPoints(21)
> .PageSetup.PageHeight = CentimetersToPoints(29.7)
> .PageSetup.VerticalAlignment = wdAlignVerticalTop
> End With
>
> With Doc
> .Close False
> Set Doc = Nothing
> End With
>
> WinWord.Quit False
> DoEvents
> Set WinWord = Nothing
> DoEvents
>
>
> Hope this helps...
> Christian
>
>
> --
> Pour répondre à ce message, utilisez EXCLUSIVEMENT ce lien :
> http://couriel.biz/c2h/
> ********************************************************
>
>
> Bonjour,
>
>
>
>
>
> Cordialement
>
> Christian Hubert-Hugoud
>
> "lou" a écrit dans le message de
> news:41a7860b$0$25044$
> > bonjour
> > je me serts de ce code pour travailler un fichier word
> > apparament il fonctionne bien
> >
> > mais apres avoir fait plusieurs essais
> > mon pc n'en pouvais plus et je me suis demandé pourquoi ??? apres
avoir
> > cherché ,
> >
> > je suis allé voir dans le gestionnaire des taches et la j'ai vu des
> > dizaines de word dans
> > le processus , j'ai du passer par le fin de tache pour les enlever
> >
> > Set W_App = Nothing ne marche pas
> > comment fermer word sans qu'il reste dans le processus
> > je ne trouve pas la solution
> > un petit peu d'aide svp
> >
> >
> > voici le code en question
> >
> > Private Sub Commande95_Click()
> > aa.Object.Application.Options.BackgroundSave = False
> > aa.Object.Application.Options.AllowFastSave = True
> > aa.Object.SaveAs "C:PDFTEMP.doc"
> >
> > Dim W_App As Object
> > Set W_App = CreateObject("Word.Application")
> > With W_App
> > .Visible = False
> > .Documents.Open ("C:PDFTEMP.doc")
> > .Selection.HomeKey Unit:=wdStory
> > .Selection.EndKey Unit:=wdStory, Extend:=wdExtend
> > .Selection.Copy
> > .ActiveDocument.Close wdDoNotSaveChanges
> >
> > .Quit
> >
> > Set W_App = Nothing
> >
> > End With
> >
> > End Sub
> >
> > merci de votre aide
> >
> >
> >
> >
> >
>
>
bonjour christian
un grand merci grace a ton code j'ai pu bidouiller
un truc qui fonctionne enfin
je n'ai plus de WORD non termine dans le processus
un grand merci pour ton aide
lou
"Christian HUBERT-HUGOUD- Xtrem7" <nospam@xtrem7.com> a écrit dans le
message de news: co97cc$efl$1@aphrodite.grec.isp.9tel.net...
> Salut,
>
> Voici mon code :
>
> Set WinWord = CreateObject("Word.application")
>
> With WinWord
> .WindowState = wdWindowStateMinimize
> .Visible = False
> If .Documents.Count = 1 Then
> Set Doc = .Documents(1)
> Else
> Set Doc = .Documents.Add
> End If
> DoEvents
> End With
>
> If Doc Is Nothing Or Err <> 0 Then
> If IsWordDoc Then
> Doc.Close False
> Set Doc = Nothing
> WinWord.Quit False
> DoEvents
> Set WinWord = Nothing
> DoEvents
> End If
> Exit Sub
> End If
>
> With Doc
>
> .Activate
> .OptimizeForWord97 = True
> .PageSetup.PaperSize = wdPaperA4
> .PageSetup.LineNumbering.Active = False
> .PageSetup.Orientation = wdOrientPortrait
> .PageSetup.TopMargin = CentimetersToPoints(1.5)
> .PageSetup.BottomMargin = CentimetersToPoints(2)
> .PageSetup.LeftMargin = CentimetersToPoints(0.5)
> .PageSetup.RightMargin = CentimetersToPoints(0.5)
> .PageSetup.PageWidth = CentimetersToPoints(21)
> .PageSetup.PageHeight = CentimetersToPoints(29.7)
> .PageSetup.VerticalAlignment = wdAlignVerticalTop
> End With
>
> With Doc
> .Close False
> Set Doc = Nothing
> End With
>
> WinWord.Quit False
> DoEvents
> Set WinWord = Nothing
> DoEvents
>
>
> Hope this helps...
> Christian
>
>
> --
> Pour répondre à ce message, utilisez EXCLUSIVEMENT ce lien :
> http://couriel.biz/c2h/
> ********************************************************
>
>
> Bonjour,
>
>
>
>
>
> Cordialement
>
> Christian Hubert-Hugoud
>
> "lou" <colluluigi@skynet.be> a écrit dans le message de
> news:41a7860b$0$25044$ba620e4c@news.skynet.be...
> > bonjour
> > je me serts de ce code pour travailler un fichier word
> > apparament il fonctionne bien
> >
> > mais apres avoir fait plusieurs essais
> > mon pc n'en pouvais plus et je me suis demandé pourquoi ??? apres
avoir
> > cherché ,
> >
> > je suis allé voir dans le gestionnaire des taches et la j'ai vu des
> > dizaines de word dans
> > le processus , j'ai du passer par le fin de tache pour les enlever
> >
> > Set W_App = Nothing ne marche pas
> > comment fermer word sans qu'il reste dans le processus
> > je ne trouve pas la solution
> > un petit peu d'aide svp
> >
> >
> > voici le code en question
> >
> > Private Sub Commande95_Click()
> > aa.Object.Application.Options.BackgroundSave = False
> > aa.Object.Application.Options.AllowFastSave = True
> > aa.Object.SaveAs "C:PDFTEMP.doc"
> >
> > Dim W_App As Object
> > Set W_App = CreateObject("Word.Application")
> > With W_App
> > .Visible = False
> > .Documents.Open ("C:PDFTEMP.doc")
> > .Selection.HomeKey Unit:=wdStory
> > .Selection.EndKey Unit:=wdStory, Extend:=wdExtend
> > .Selection.Copy
> > .ActiveDocument.Close wdDoNotSaveChanges
> >
> > .Quit
> >
> > Set W_App = Nothing
> >
> > End With
> >
> > End Sub
> >
> > merci de votre aide
> >
> >
> >
> >
> >
>
>
bonjour christian
un grand merci grace a ton code j'ai pu bidouiller
un truc qui fonctionne enfin
je n'ai plus de WORD non termine dans le processus
un grand merci pour ton aide
lou
"Christian HUBERT-HUGOUD- Xtrem7" a écrit dans le
message de news: co97cc$efl$
> Salut,
>
> Voici mon code :
>
> Set WinWord = CreateObject("Word.application")
>
> With WinWord
> .WindowState = wdWindowStateMinimize
> .Visible = False
> If .Documents.Count = 1 Then
> Set Doc = .Documents(1)
> Else
> Set Doc = .Documents.Add
> End If
> DoEvents
> End With
>
> If Doc Is Nothing Or Err <> 0 Then
> If IsWordDoc Then
> Doc.Close False
> Set Doc = Nothing
> WinWord.Quit False
> DoEvents
> Set WinWord = Nothing
> DoEvents
> End If
> Exit Sub
> End If
>
> With Doc
>
> .Activate
> .OptimizeForWord97 = True
> .PageSetup.PaperSize = wdPaperA4
> .PageSetup.LineNumbering.Active = False
> .PageSetup.Orientation = wdOrientPortrait
> .PageSetup.TopMargin = CentimetersToPoints(1.5)
> .PageSetup.BottomMargin = CentimetersToPoints(2)
> .PageSetup.LeftMargin = CentimetersToPoints(0.5)
> .PageSetup.RightMargin = CentimetersToPoints(0.5)
> .PageSetup.PageWidth = CentimetersToPoints(21)
> .PageSetup.PageHeight = CentimetersToPoints(29.7)
> .PageSetup.VerticalAlignment = wdAlignVerticalTop
> End With
>
> With Doc
> .Close False
> Set Doc = Nothing
> End With
>
> WinWord.Quit False
> DoEvents
> Set WinWord = Nothing
> DoEvents
>
>
> Hope this helps...
> Christian
>
>
> --
> Pour répondre à ce message, utilisez EXCLUSIVEMENT ce lien :
> http://couriel.biz/c2h/
> ********************************************************
>
>
> Bonjour,
>
>
>
>
>
> Cordialement
>
> Christian Hubert-Hugoud
>
> "lou" a écrit dans le message de
> news:41a7860b$0$25044$
> > bonjour
> > je me serts de ce code pour travailler un fichier word
> > apparament il fonctionne bien
> >
> > mais apres avoir fait plusieurs essais
> > mon pc n'en pouvais plus et je me suis demandé pourquoi ??? apres
avoir
> > cherché ,
> >
> > je suis allé voir dans le gestionnaire des taches et la j'ai vu des
> > dizaines de word dans
> > le processus , j'ai du passer par le fin de tache pour les enlever
> >
> > Set W_App = Nothing ne marche pas
> > comment fermer word sans qu'il reste dans le processus
> > je ne trouve pas la solution
> > un petit peu d'aide svp
> >
> >
> > voici le code en question
> >
> > Private Sub Commande95_Click()
> > aa.Object.Application.Options.BackgroundSave = False
> > aa.Object.Application.Options.AllowFastSave = True
> > aa.Object.SaveAs "C:PDFTEMP.doc"
> >
> > Dim W_App As Object
> > Set W_App = CreateObject("Word.Application")
> > With W_App
> > .Visible = False
> > .Documents.Open ("C:PDFTEMP.doc")
> > .Selection.HomeKey Unit:=wdStory
> > .Selection.EndKey Unit:=wdStory, Extend:=wdExtend
> > .Selection.Copy
> > .ActiveDocument.Close wdDoNotSaveChanges
> >
> > .Quit
> >
> > Set W_App = Nothing
> >
> > End With
> >
> > End Sub
> >
> > merci de votre aide
> >
> >
> >
> >
> >
>
>
Et peux-tu diagnostiquer ?
Ne serait-ce pas que la fermeture était refusée
car Word voulait poser une question ?
@+
"lou" a écrit dans le message de
news:41a85f01$0$30711$
> bonjour christian
>
> un grand merci grace a ton code j'ai pu bidouiller
> un truc qui fonctionne enfin
> je n'ai plus de WORD non termine dans le processus
>
> un grand merci pour ton aide
> lou
>
> "Christian HUBERT-HUGOUD- Xtrem7" a écrit dans le
> message de news: co97cc$efl$
> > Salut,
> >
> > Voici mon code :
> >
> > Set WinWord = CreateObject("Word.application")
> >
> > With WinWord
> > .WindowState = wdWindowStateMinimize
> > .Visible = False
> > If .Documents.Count = 1 Then
> > Set Doc = .Documents(1)
> > Else
> > Set Doc = .Documents.Add
> > End If
> > DoEvents
> > End With
> >
> > If Doc Is Nothing Or Err <> 0 Then
> > If IsWordDoc Then
> > Doc.Close False
> > Set Doc = Nothing
> > WinWord.Quit False
> > DoEvents
> > Set WinWord = Nothing
> > DoEvents
> > End If
> > Exit Sub
> > End If
> >
> > With Doc
> >
> > .Activate
> > .OptimizeForWord97 = True
> > .PageSetup.PaperSize = wdPaperA4
> > .PageSetup.LineNumbering.Active = False
> > .PageSetup.Orientation = wdOrientPortrait
> > .PageSetup.TopMargin = CentimetersToPoints(1.5)
> > .PageSetup.BottomMargin = CentimetersToPoints(2)
> > .PageSetup.LeftMargin = CentimetersToPoints(0.5)
> > .PageSetup.RightMargin = CentimetersToPoints(0.5)
> > .PageSetup.PageWidth = CentimetersToPoints(21)
> > .PageSetup.PageHeight = CentimetersToPoints(29.7)
> > .PageSetup.VerticalAlignment = wdAlignVerticalTop
> > End With
> >
> > With Doc
> > .Close False
> > Set Doc = Nothing
> > End With
> >
> > WinWord.Quit False
> > DoEvents
> > Set WinWord = Nothing
> > DoEvents
> >
> >
> > Hope this helps...
> > Christian
> >
> >
> > --
> > Pour répondre à ce message, utilisez EXCLUSIVEMENT ce lien :
> > http://couriel.biz/c2h/
> > ********************************************************
> >
> >
> > Bonjour,
> >
> >
> >
> >
> >
> > Cordialement
> >
> > Christian Hubert-Hugoud
> >
> > "lou" a écrit dans le message de
> > news:41a7860b$0$25044$
> > > bonjour
> > > je me serts de ce code pour travailler un fichier word
> > > apparament il fonctionne bien
> > >
> > > mais apres avoir fait plusieurs essais
> > > mon pc n'en pouvais plus et je me suis demandé pourquoi ??? apres
> avoir
> > > cherché ,
> > >
> > > je suis allé voir dans le gestionnaire des taches et la j'ai vu
> > > dizaines de word dans
> > > le processus , j'ai du passer par le fin de tache pour les enlever
> > >
> > > Set W_App = Nothing ne marche pas
> > > comment fermer word sans qu'il reste dans le processus
> > > je ne trouve pas la solution
> > > un petit peu d'aide svp
> > >
> > >
> > > voici le code en question
> > >
> > > Private Sub Commande95_Click()
> > > aa.Object.Application.Options.BackgroundSave = False
> > > aa.Object.Application.Options.AllowFastSave = True
> > > aa.Object.SaveAs "C:PDFTEMP.doc"
> > >
> > > Dim W_App As Object
> > > Set W_App = CreateObject("Word.Application")
> > > With W_App
> > > .Visible = False
> > > .Documents.Open ("C:PDFTEMP.doc")
> > > .Selection.HomeKey Unit:=wdStory
> > > .Selection.EndKey Unit:=wdStory, Extend:=wdExtend
> > > .Selection.Copy
> > > .ActiveDocument.Close wdDoNotSaveChanges
> > >
> > > .Quit
> > >
> > > Set W_App = Nothing
> > >
> > > End With
> > >
> > > End Sub
> > >
> > > merci de votre aide
> > >
> > >
> > >
> > >
> > >
> >
> >
>
>
Et peux-tu diagnostiquer ?
Ne serait-ce pas que la fermeture était refusée
car Word voulait poser une question ?
@+
"lou" <colluluigi@skynet.be> a écrit dans le message de
news:41a85f01$0$30711$ba620e4c@news.skynet.be...
> bonjour christian
>
> un grand merci grace a ton code j'ai pu bidouiller
> un truc qui fonctionne enfin
> je n'ai plus de WORD non termine dans le processus
>
> un grand merci pour ton aide
> lou
>
> "Christian HUBERT-HUGOUD- Xtrem7" <nospam@xtrem7.com> a écrit dans le
> message de news: co97cc$efl$1@aphrodite.grec.isp.9tel.net...
> > Salut,
> >
> > Voici mon code :
> >
> > Set WinWord = CreateObject("Word.application")
> >
> > With WinWord
> > .WindowState = wdWindowStateMinimize
> > .Visible = False
> > If .Documents.Count = 1 Then
> > Set Doc = .Documents(1)
> > Else
> > Set Doc = .Documents.Add
> > End If
> > DoEvents
> > End With
> >
> > If Doc Is Nothing Or Err <> 0 Then
> > If IsWordDoc Then
> > Doc.Close False
> > Set Doc = Nothing
> > WinWord.Quit False
> > DoEvents
> > Set WinWord = Nothing
> > DoEvents
> > End If
> > Exit Sub
> > End If
> >
> > With Doc
> >
> > .Activate
> > .OptimizeForWord97 = True
> > .PageSetup.PaperSize = wdPaperA4
> > .PageSetup.LineNumbering.Active = False
> > .PageSetup.Orientation = wdOrientPortrait
> > .PageSetup.TopMargin = CentimetersToPoints(1.5)
> > .PageSetup.BottomMargin = CentimetersToPoints(2)
> > .PageSetup.LeftMargin = CentimetersToPoints(0.5)
> > .PageSetup.RightMargin = CentimetersToPoints(0.5)
> > .PageSetup.PageWidth = CentimetersToPoints(21)
> > .PageSetup.PageHeight = CentimetersToPoints(29.7)
> > .PageSetup.VerticalAlignment = wdAlignVerticalTop
> > End With
> >
> > With Doc
> > .Close False
> > Set Doc = Nothing
> > End With
> >
> > WinWord.Quit False
> > DoEvents
> > Set WinWord = Nothing
> > DoEvents
> >
> >
> > Hope this helps...
> > Christian
> >
> >
> > --
> > Pour répondre à ce message, utilisez EXCLUSIVEMENT ce lien :
> > http://couriel.biz/c2h/
> > ********************************************************
> >
> >
> > Bonjour,
> >
> >
> >
> >
> >
> > Cordialement
> >
> > Christian Hubert-Hugoud
> >
> > "lou" <colluluigi@skynet.be> a écrit dans le message de
> > news:41a7860b$0$25044$ba620e4c@news.skynet.be...
> > > bonjour
> > > je me serts de ce code pour travailler un fichier word
> > > apparament il fonctionne bien
> > >
> > > mais apres avoir fait plusieurs essais
> > > mon pc n'en pouvais plus et je me suis demandé pourquoi ??? apres
> avoir
> > > cherché ,
> > >
> > > je suis allé voir dans le gestionnaire des taches et la j'ai vu
> > > dizaines de word dans
> > > le processus , j'ai du passer par le fin de tache pour les enlever
> > >
> > > Set W_App = Nothing ne marche pas
> > > comment fermer word sans qu'il reste dans le processus
> > > je ne trouve pas la solution
> > > un petit peu d'aide svp
> > >
> > >
> > > voici le code en question
> > >
> > > Private Sub Commande95_Click()
> > > aa.Object.Application.Options.BackgroundSave = False
> > > aa.Object.Application.Options.AllowFastSave = True
> > > aa.Object.SaveAs "C:PDFTEMP.doc"
> > >
> > > Dim W_App As Object
> > > Set W_App = CreateObject("Word.Application")
> > > With W_App
> > > .Visible = False
> > > .Documents.Open ("C:PDFTEMP.doc")
> > > .Selection.HomeKey Unit:=wdStory
> > > .Selection.EndKey Unit:=wdStory, Extend:=wdExtend
> > > .Selection.Copy
> > > .ActiveDocument.Close wdDoNotSaveChanges
> > >
> > > .Quit
> > >
> > > Set W_App = Nothing
> > >
> > > End With
> > >
> > > End Sub
> > >
> > > merci de votre aide
> > >
> > >
> > >
> > >
> > >
> >
> >
>
>
Et peux-tu diagnostiquer ?
Ne serait-ce pas que la fermeture était refusée
car Word voulait poser une question ?
@+
"lou" a écrit dans le message de
news:41a85f01$0$30711$
> bonjour christian
>
> un grand merci grace a ton code j'ai pu bidouiller
> un truc qui fonctionne enfin
> je n'ai plus de WORD non termine dans le processus
>
> un grand merci pour ton aide
> lou
>
> "Christian HUBERT-HUGOUD- Xtrem7" a écrit dans le
> message de news: co97cc$efl$
> > Salut,
> >
> > Voici mon code :
> >
> > Set WinWord = CreateObject("Word.application")
> >
> > With WinWord
> > .WindowState = wdWindowStateMinimize
> > .Visible = False
> > If .Documents.Count = 1 Then
> > Set Doc = .Documents(1)
> > Else
> > Set Doc = .Documents.Add
> > End If
> > DoEvents
> > End With
> >
> > If Doc Is Nothing Or Err <> 0 Then
> > If IsWordDoc Then
> > Doc.Close False
> > Set Doc = Nothing
> > WinWord.Quit False
> > DoEvents
> > Set WinWord = Nothing
> > DoEvents
> > End If
> > Exit Sub
> > End If
> >
> > With Doc
> >
> > .Activate
> > .OptimizeForWord97 = True
> > .PageSetup.PaperSize = wdPaperA4
> > .PageSetup.LineNumbering.Active = False
> > .PageSetup.Orientation = wdOrientPortrait
> > .PageSetup.TopMargin = CentimetersToPoints(1.5)
> > .PageSetup.BottomMargin = CentimetersToPoints(2)
> > .PageSetup.LeftMargin = CentimetersToPoints(0.5)
> > .PageSetup.RightMargin = CentimetersToPoints(0.5)
> > .PageSetup.PageWidth = CentimetersToPoints(21)
> > .PageSetup.PageHeight = CentimetersToPoints(29.7)
> > .PageSetup.VerticalAlignment = wdAlignVerticalTop
> > End With
> >
> > With Doc
> > .Close False
> > Set Doc = Nothing
> > End With
> >
> > WinWord.Quit False
> > DoEvents
> > Set WinWord = Nothing
> > DoEvents
> >
> >
> > Hope this helps...
> > Christian
> >
> >
> > --
> > Pour répondre à ce message, utilisez EXCLUSIVEMENT ce lien :
> > http://couriel.biz/c2h/
> > ********************************************************
> >
> >
> > Bonjour,
> >
> >
> >
> >
> >
> > Cordialement
> >
> > Christian Hubert-Hugoud
> >
> > "lou" a écrit dans le message de
> > news:41a7860b$0$25044$
> > > bonjour
> > > je me serts de ce code pour travailler un fichier word
> > > apparament il fonctionne bien
> > >
> > > mais apres avoir fait plusieurs essais
> > > mon pc n'en pouvais plus et je me suis demandé pourquoi ??? apres
> avoir
> > > cherché ,
> > >
> > > je suis allé voir dans le gestionnaire des taches et la j'ai vu
> > > dizaines de word dans
> > > le processus , j'ai du passer par le fin de tache pour les enlever
> > >
> > > Set W_App = Nothing ne marche pas
> > > comment fermer word sans qu'il reste dans le processus
> > > je ne trouve pas la solution
> > > un petit peu d'aide svp
> > >
> > >
> > > voici le code en question
> > >
> > > Private Sub Commande95_Click()
> > > aa.Object.Application.Options.BackgroundSave = False
> > > aa.Object.Application.Options.AllowFastSave = True
> > > aa.Object.SaveAs "C:PDFTEMP.doc"
> > >
> > > Dim W_App As Object
> > > Set W_App = CreateObject("Word.Application")
> > > With W_App
> > > .Visible = False
> > > .Documents.Open ("C:PDFTEMP.doc")
> > > .Selection.HomeKey Unit:=wdStory
> > > .Selection.EndKey Unit:=wdStory, Extend:=wdExtend
> > > .Selection.Copy
> > > .ActiveDocument.Close wdDoNotSaveChanges
> > >
> > > .Quit
> > >
> > > Set W_App = Nothing
> > >
> > > End With
> > >
> > > End Sub
> > >
> > > merci de votre aide
> > >
> > >
> > >
> > >
> > >
> >
> >
>
>
bonjour
je me serts de ce code pour travailler un fichier word
apparament il fonctionne bien
mais apres avoir fait plusieurs essais
mon pc n'en pouvais plus et je me suis demandé pourquoi ??? apres avoir
cherché ,
je suis allé voir dans le gestionnaire des taches et la j'ai vu des
dizaines de word dans
le processus , j'ai du passer par le fin de tache pour les enlever
Set W_App = Nothing ne marche pas
comment fermer word sans qu'il reste dans le processus
je ne trouve pas la solution
un petit peu d'aide svp
voici le code en question
Private Sub Commande95_Click()
aa.Object.Application.Options.BackgroundSave = False
aa.Object.Application.Options.AllowFastSave = True
aa.Object.SaveAs "C:PDFTEMP.doc"
Dim W_App As Object
Set W_App = CreateObject("Word.Application")
With W_App
.Visible = False
.Documents.Open ("C:PDFTEMP.doc")
.Selection.HomeKey Unit:=wdStory
.Selection.EndKey Unit:=wdStory, Extend:=wdExtend
.Selection.Copy
.ActiveDocument.Close wdDoNotSaveChanges
.Quit
Set W_App = Nothing
End With
End Sub
merci de votre aide
bonjour
je me serts de ce code pour travailler un fichier word
apparament il fonctionne bien
mais apres avoir fait plusieurs essais
mon pc n'en pouvais plus et je me suis demandé pourquoi ??? apres avoir
cherché ,
je suis allé voir dans le gestionnaire des taches et la j'ai vu des
dizaines de word dans
le processus , j'ai du passer par le fin de tache pour les enlever
Set W_App = Nothing ne marche pas
comment fermer word sans qu'il reste dans le processus
je ne trouve pas la solution
un petit peu d'aide svp
voici le code en question
Private Sub Commande95_Click()
aa.Object.Application.Options.BackgroundSave = False
aa.Object.Application.Options.AllowFastSave = True
aa.Object.SaveAs "C:PDFTEMP.doc"
Dim W_App As Object
Set W_App = CreateObject("Word.Application")
With W_App
.Visible = False
.Documents.Open ("C:PDFTEMP.doc")
.Selection.HomeKey Unit:=wdStory
.Selection.EndKey Unit:=wdStory, Extend:=wdExtend
.Selection.Copy
.ActiveDocument.Close wdDoNotSaveChanges
.Quit
Set W_App = Nothing
End With
End Sub
merci de votre aide
bonjour
je me serts de ce code pour travailler un fichier word
apparament il fonctionne bien
mais apres avoir fait plusieurs essais
mon pc n'en pouvais plus et je me suis demandé pourquoi ??? apres avoir
cherché ,
je suis allé voir dans le gestionnaire des taches et la j'ai vu des
dizaines de word dans
le processus , j'ai du passer par le fin de tache pour les enlever
Set W_App = Nothing ne marche pas
comment fermer word sans qu'il reste dans le processus
je ne trouve pas la solution
un petit peu d'aide svp
voici le code en question
Private Sub Commande95_Click()
aa.Object.Application.Options.BackgroundSave = False
aa.Object.Application.Options.AllowFastSave = True
aa.Object.SaveAs "C:PDFTEMP.doc"
Dim W_App As Object
Set W_App = CreateObject("Word.Application")
With W_App
.Visible = False
.Documents.Open ("C:PDFTEMP.doc")
.Selection.HomeKey Unit:=wdStory
.Selection.EndKey Unit:=wdStory, Extend:=wdExtend
.Selection.Copy
.ActiveDocument.Close wdDoNotSaveChanges
.Quit
Set W_App = Nothing
End With
End Sub
merci de votre aide