Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Execution de Word 6.0 masqué à partir d'API
Message
De
27/05/1998 09:51:24
Cpam Cpam
Cpam de Rouen
Rouen, France
 
 
À
Tous
Information générale
Forum:
Visual Basic
Catégorie:
Fonctions API de Windows
Titre:
Execution de Word 6.0 masqué à partir d'API
Divers
Thread ID:
00102349
Message ID:
00102349
Vues:
64
J'utilise Word 6.0 à partir de VB pour éditer un document courant. Je n'arrive pas à quitter Word automatiquement après l'édition du document. Veuillez ci-joint la fonction utilisée:

Option Explicit
Declare Function SendMessage& Lib « user » (ByVal hwnd%, ByVal wMsg%, Byval wParm%, ByVal lParam AS Long)
Declare Function WinExec Lib « Kernel » (ByVal lpCmdLine As String, ByVal nCmdShow As Integer) As Integer
Declare Function GetModuleHandle Lib « Kernel » (ByVal lpModuleName As String) As Integer
Declare Function ShowWindow Lib « user » (ByVal hwnd As Integer, ByVal nCmdShow As Integer) As Integer

Sub ExecMasqueWord6()

Dim WordBasicObj As Object
Dim WordObj As Object
Dim hInst As Integer
Dim Winword_hnd As Integer
Dim x As Integer
Const SW_HIDE = 0
Const NILL = 0&
Const WM_SYSCOMMAND = &H112
Const SC_CLOSE = &HF060

HInst = WinExec(« Winword.exe »,SW_HIDE)
‘ * Execution de Word en masqué
Winword_hnd = GetModuleHandle(« winword.exe »)
‘ * lecture de l’objet document word
Set WordObj = GetObject(« « , »Word.document.6 »)
‘ * lecture de l’objet document WordBasic
Set WordBasicObj = WordObj.Application.WordBasic
‘ * Impressio du document courant
WordBasicObj.FichierImprimerDefaut
‘ * Suppression de l’objet WordBasic
Set WordBasicObj = Nothing

COMMENT FERMER Word 6 ?
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform