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
| Global docword As Object
Public Sub generate_doc(ByVal Text As String)
' remplacement des valeurs des variables dans le doc
' variables en entree
' Text = nom du template à utiliser
' Doc word is being created
On Error Resume Next
Set docword = GetObject(, "Word.Basic")
If Err.number <> 0 Then
Set docword = CreateObject("Word.Basic")
End If
On Error GoTo 0
docword.fileopen repertory & "Template\" & Text
Call replace_results(ByVal "*V_tkox*", ByVal Str(FormatNumber(V_tkox, i)), ByVal i)
End Sub
Public Sub replace_results(ByVal stringresults As String, ByVal valueresults As String, ByVal j As Integer)
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
End Sub |
Partager