Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

automatisation

1 réponse
Avatar
jfr
Bonjou,
J'ai bricol=E9 ce petit pg afin d'incorporer des fichiers rtf d'un
r=E9pertoire donn=E9 dans un document word.
J'aimerais pouvoir faire le m=EAme chose pour tous les fichiers pdf et
xls du r=E9pertoire.
Merci pour les id=E9es.
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 =3D AppWord.ActiveDocument.FullName
End With
ActiveWindow.Caption =3D ActiveDocument.Path


Selection.InlineShapes.AddOLEObject ClassType:=3D"Word.Document.8",
FileName _
:=3D _
"Requ=EAte Etat compatibilit=E9 contrat.rtf" _
, LinkToFile:=3DFalse, DisplayAsIcon:=3DTrue, IconFileName:=3D _
"C:\WINNT\Installer
\{90110409-6000-11D3-8CFE-0150048383C9}\wordicon.exe", _
IconIndex:=3D1, IconLabel:=3D"Requ=EAte Etat compatibilit=E9
contrat.rtf"
Selection.TypeText Text:=3DvbTab
Selection.InlineShapes.AddOLEObject ClassType:=3D"Word.Document.8",
FileName _
:=3D _
"Requ=EAte Etat compatibilit=E9_ot_ar.rtf" _
, LinkToFile:=3DFalse, DisplayAsIcon:=3DTrue, IconFileName:=3D _
"C:\WINNT\Installer
\{90110409-6000-11D3-8CFE-0150048383C9}\wordicon.exe", _
IconIndex:=3D1, IconLabel:=3D"Requ=EAte Etat
compatibilit=E9_ot_ar.rtf"
Selection.TypeText Text:=3DvbTab
Selection.InlineShapes.AddOLEObject ClassType:=3D"Word.Document.8",
FileName _
:=3D _
"Requ=EAte Etat de la remise - seuil de remise.rtf" _
, LinkToFile:=3DFalse, DisplayAsIcon:=3DTrue, IconFileName:=3D _
"C:\WINNT\Installer
\{90110409-6000-11D3-8CFE-0150048383C9}\wordicon.exe", _
IconIndex:=3D1, IconLabel:=3D _
"Requ=EAte Etat de la remise - seuil de remise.rtf"
Selection.TypeText Text:=3DvbTab
Selection.InlineShapes.AddOLEObject ClassType:=3D"Word.Document.8",
FileName _
:=3D _
"Requ=EAte Etat de la remise - trafic impact=E9.rtf" _
, LinkToFile:=3DFalse, DisplayAsIcon:=3DTrue, IconFileName:=3D _
"C:\WINNT\Installer
\{90110409-6000-11D3-8CFE-0150048383C9}\wordicon.exe", _
IconIndex:=3D1, IconLabel:=3D _
"Requ=EAte Etat de la remise - trafic impact=E9.rtf"
Selection.TypeText Text:=3DvbTab
Selection.InlineShapes.AddOLEObject ClassType:=3D"Word.Document.8",
FileName _
:=3D _
"Requ=EAte Etat de la remise - description g=E9n=E9rale.rtf" _
, LinkToFile:=3DFalse, DisplayAsIcon:=3DTrue, IconFileName:=3D _
"C:\WINNT\Installer
\{90110409-6000-11D3-8CFE-0150048383C9}\wordicon.exe", _
IconIndex:=3D1, IconLabel:=3D _
"Requ=EAte Etat de la remise - description g=E9n=E9rale.rtf"
Selection.TypeText Text:=3DvbTab
Selection.InlineShapes.AddOLEObject ClassType:=3D"Word.Document.8",
FileName _
:=3D _
"Requ=EAte Etat produit contrat et abonnement.rtf" _
, LinkToFile:=3DFalse, DisplayAsIcon:=3DTrue, IconFileName:=3D _
"C:\WINNT\Installer
\{90110409-6000-11D3-8CFE-0150048383C9}\wordicon.exe", _
IconIndex:=3D1, IconLabel:=3D _
"Requ=EAte Etat produit contrat et abonnement.rtf"
Selection.TypeText Text:=3DvbTab
Selection.InlineShapes.AddOLEObject ClassType:=3D"Word.Document.8",
FileName _
:=3D _
"Requ=EAte Etat niveau_ot.rtf" _
, LinkToFile:=3DFalse, DisplayAsIcon:=3DTrue, IconFileName:=3D _
"C:\WINNT\Installer
\{90110409-6000-11D3-8CFE-0150048383C9}\wordicon.exe", _
IconIndex:=3D1, IconLabel:=3D"Requ=EAte Etat niveau_ot.rtf"
Selection.TypeText Text:=3DvbTab
Selection.InlineShapes.AddOLEObject ClassType:=3D"Word.Document.8",
FileName _
:=3D _
"Requ=EAte Etat configuration_ot.rtf" _
, LinkToFile:=3DFalse, DisplayAsIcon:=3DTrue, IconFileName:=3D _
"C:\WINNT\Installer
\{90110409-6000-11D3-8CFE-0150048383C9}\wordicon.exe", _
IconIndex:=3D1, IconLabel:=3D"Requ=EAte Etat configuration_ot.rtf"
Selection.InlineShapes.AddOLEObject ClassType:=3D"Word.Document.8",
FileName _
:=3D _
"Requ=EAte Etat caract=E9ristique de l'offre.rtf" _
, LinkToFile:=3DFalse, DisplayAsIcon:=3DTrue, IconFileName:=3D _
"C:\WINNT\Installer
\{90110409-6000-11D3-8CFE-0150048383C9}\wordicon.exe", _
IconIndex:=3D1, IconLabel:=3D"Requ=EAte Etat caract=E9ristique de
l'offre.rtf"

End Sub

1 réponse

Avatar
3stone
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)