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

Impression

2 réponses
Avatar
xyzDaniel
Bonjour =E0 tous,

Depuis VB6, SP5, je souhaite imprimer un document Word=20
dont je connais le chemin complet.
Est-il possible d'imprimer son contenu sans ouvrir=20
l'application Word ?

merci beaucoup.
Daniel

2 réponses

Avatar
François Picalausa
Hello!

Il est possible de faire l'équivalent d'un click droit sur le fichier >
imprimer par shell execute avec le verb print:

Private Const SW_SHOWNORMAL = 1
Private Const SW_HIDE = 0

Private Declare Function ShellExecute _
Lib "shell32.dll" _
Alias "ShellExecuteA" _
( _
ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long _
) _
As Long

ShellExecute Me.hwnd, "print", "C:File.doc", vbNullString, "C:",
SW_SHOWNORMAL

Tu peux remplacer SW_SHOWNORMAL par SW_HIDE ppour le masquer entièrement.

--
François Picalausa (MVP VB)
http://faq.vb.free.fr --- http://msdn.microsoft.com
http://apisvb.europe.webmatrixhosting.net

"xyzDaniel" a écrit dans le
message de news:87aa01c4329f$05099740$
Bonjour à tous,

Depuis VB6, SP5, je souhaite imprimer un document Word
dont je connais le chemin complet.
Est-il possible d'imprimer son contenu sans ouvrir
l'application Word ?

merci beaucoup.
Daniel


Avatar
xyzDaniel
François,
Merci beaucoup, je la teste. Mais je suis sûr du résultat.
à tantôt.
Daniel

-----Message d'origine-----
Hello!

Il est possible de faire l'équivalent d'un click droit


sur le fichier >
imprimer par shell execute avec le verb print:

Private Const SW_SHOWNORMAL = 1
Private Const SW_HIDE = 0

Private Declare Function ShellExecute _
Lib "shell32.dll" _
Alias "ShellExecuteA" _
( _
ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long _
) _
As Long

ShellExecute Me.hwnd, "print", "C:File.doc",


vbNullString, "C:",
SW_SHOWNORMAL

Tu peux remplacer SW_SHOWNORMAL par SW_HIDE ppour le


masquer entièrement.

--
François Picalausa (MVP VB)
http://faq.vb.free.fr --- http://msdn.microsoft.com
http://apisvb.europe.webmatrixhosting.net

"xyzDaniel" a écrit


dans le
message de news:87aa01c4329f$05099740$
Bonjour à tous,

Depuis VB6, SP5, je souhaite imprimer un document Word
dont je connais le chemin complet.
Est-il possible d'imprimer son contenu sans ouvrir
l'application Word ?

merci beaucoup.
Daniel




.