1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| Sub Trt_fiche(chefdesecteur As String, comptable As String, ByRef secteur As String, ByRef numerodefiche As String, ByRef redacteur As String, numCGL As String, JCPC As String, ByRef datesaisie As Date, datecomptable As Date, sensCpte1 As String, lettre1 As String, cpte1 As String, specCpte1 As String, sensCpte2 As String, lettre2 As String, cpte2 As String, specCpte2 As String, montant As String, libelle As String)
Dim var1 As String
Dim var2 As Integer
Dim chemin As String
Dim prefixecomptable As String
Dim WordApp As Word.Application
Dim WordDoc As Word.Document
chemin = "C:\Users\acer\Desktop\5-11-2009 bis bureau"
' Ouvre session word
Set WordApp = New Word.Application
' Ouvre document Word
Set WordDoc = WordApp.Documents.Open(chemin & "\modele.doc")
' Word est visible pendant l'opération
WordApp.ShowMe
WordApp.Visible = True
' Ecriture document au signet 'secteur'
WordDoc.Bookmarks.Item ("secteur")
WordDoc.Bookmarks("secteur").Range.Text = secteur
With WordDoc.Bookmarks("secteur")
.Range.Font.Size = 14
.Range.Bold = wdToggle
.Range.Italic = wdToggle
End With
Application.DisplayAlerts = True
(..id..)
' Sauvegarde
'WordApp.ActiveDocument.SaveAs chemin & "\fic"
WordDoc.SaveAs "C:\Users\acer\Desktop\5-11-2009 bis bureau\fic"
' Fermeture
'WordApp.ActiveDocument.Close
'WordApp.ActiveDocument.Quit
'Set WordApp = Nothing
'Set WordDoc = Nothing
WordDoc.Close True
WordApp.Quit
Exit Sub |
Partager