Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Execution de Word 6.0 masqué à partir d'API
Message
From
27/05/1998 09:51:24
Cpam Cpam
Cpam de Rouen
Rouen, France
 
 
To
All
General information
Forum:
Visual Basic
Category:
Windows API functions
Title:
Execution de Word 6.0 masqué à partir d'API
Miscellaneous
Thread ID:
00102349
Message ID:
00102349
Views:
62
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 ?
Next
Reply
Map
View

Click here to load this message in the networking platform