automatisation

Le
jfr
Bonjou,
J'ai bricol ce petit pg afin d'incorporer des fichiers rtf d'un
rpertoire donn dans un document word.
J'aimerais pouvoir faire le mme chose pour tous les fichiers pdf et
xls du rpertoire.
Merci pour les ides.
Private Sub CommandButton1_Click()
'Dim AppWord As word.Application
'Dim DocWord As word.Document
Debug.Print Application.ActiveDocument.FullName


With ActiveDocument

Debug.Print .Path

' ActiveWindow.Caption = AppWord.ActiveDocument.FullName
End With
ActiveWindow.Caption = ActiveDocument.Path


Selection.InlineShapes.AddOLEObject ClassType:="Word.Document.8",
FileName _
:= _
"Requte Etat compatibilit contrat.rtf" _
, LinkToFile:=False, DisplayAsIcon:=True, IconFileName:= _
"C:WINNTInstaller
{90110409-6000-11D3-8CFE-0150048383C9}wordicon.exe", _
IconIndex:=1, IconLabel:="Requte Etat compatibilit
contrat.rtf"
Selection.TypeText Text:=vbTab
Selection.InlineShapes.AddOLEObject ClassType:="Word.Document.8",
FileName _
:= _
"Requte Etat compatibilit_ot_ar.rtf" _
, LinkToFile:=False, DisplayAsIcon:=True, IconFileName:= _
"C:WINNTInstaller
{90110409-6000-11D3-8CFE-0150048383C9}wordicon.exe", _
IconIndex:=1, IconLabel:="Requte Etat
compatibilit_ot_ar.rtf"
Selection.TypeText Text:=vbTab
Selection.InlineShapes.AddOLEObject ClassType:="Word.Document.8",
FileName _
:= _
"Requte Etat de la remise - seuil de remise.rtf" _
, LinkToFile:=False, DisplayAsIcon:=True, IconFileName:= _
"C:WINNTInstaller
{90110409-6000-11D3-8CFE-0150048383C9}wordicon.exe", _
IconIndex:=1, IconLabel:= _
"Requte Etat de la remise - seuil de remise.rtf"
Selection.TypeText Text:=vbTab
Selection.InlineShapes.AddOLEObject ClassType:="Word.Document.8",
FileName _
:= _
"Requte Etat de la remise - trafic impact.rtf" _
, LinkToFile:=False, DisplayAsIcon:=True, IconFileName:= _
"C:WINNTInstaller
{90110409-6000-11D3-8CFE-0150048383C9}wordicon.exe", _
IconIndex:=1, IconLabel:= _
"Requte Etat de la remise - trafic impact.rtf"
Selection.TypeText Text:=vbTab
Selection.InlineShapes.AddOLEObject ClassType:="Word.Document.8",
FileName _
:= _
"Requte Etat de la remise - description gnrale.rtf" _
, LinkToFile:=False, DisplayAsIcon:=True, IconFileName:= _
"C:WINNTInstaller
{90110409-6000-11D3-8CFE-0150048383C9}wordicon.exe", _
IconIndex:=1, IconLabel:= _
"Requte Etat de la remise - description gnrale.rtf"
Selection.TypeText Text:=vbTab
Selection.InlineShapes.AddOLEObject ClassType:="Word.Document.8",
FileName _
:= _
"Requte Etat produit contrat et abonnement.rtf" _
, LinkToFile:=False, DisplayAsIcon:=True, IconFileName:= _
"C:WINNTInstaller
{90110409-6000-11D3-8CFE-0150048383C9}wordicon.exe", _
IconIndex:=1, IconLabel:= _
"Requte Etat produit contrat et abonnement.rtf"
Selection.TypeText Text:=vbTab
Selection.InlineShapes.AddOLEObject ClassType:="Word.Document.8",
FileName _
:= _
"Requte Etat niveau_ot.rtf" _
, LinkToFile:=False, DisplayAsIcon:=True, IconFileName:= _
"C:WINNTInstaller
{90110409-6000-11D3-8CFE-0150048383C9}wordicon.exe", _
IconIndex:=1, IconLabel:="Requte Etat niveau_ot.rtf"
Selection.TypeText Text:=vbTab
Selection.InlineShapes.AddOLEObject ClassType:="Word.Document.8",
FileName _
:= _
"Requte Etat configuration_ot.rtf" _
, LinkToFile:=False, DisplayAsIcon:=True, IconFileName:= _
"C:WINNTInstaller
{90110409-6000-11D3-8CFE-0150048383C9}wordicon.exe", _
IconIndex:=1, IconLabel:="Requte Etat configuration_ot.rtf"
Selection.InlineShapes.AddOLEObject ClassType:="Word.Document.8",
FileName _
:= _
"Requte Etat caractristique de l'offre.rtf" _
, LinkToFile:=False, DisplayAsIcon:=True, IconFileName:= _
"C:WINNTInstaller
{90110409-6000-11D3-8CFE-0150048383C9}wordicon.exe", _
IconIndex:=1, IconLabel:="Requte Etat caractristique de
l'offre.rtf"

End Sub
Vos réponses
Gagnez chaque mois un abonnement Premium avec GNT : Inscrivez-vous !
Trier par : date / pertinence
3stone
Le #20263411
jfr wrote:
Bonjou,
J'ai bricolé ce petit pg afin d'incorporer des fichiers rtf d'un
répertoire donné dans un document word.




Tu devrais donc aller sur le NG Word ;-)

--
A+
Pierre (3stone) Access MVP
Perso: http://www.3stone.be/
MPFA: http://www.mpfa.info/ (infos générales)
Publicité
Poster une réponse
Anonyme