Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to supress OpenFile dialog box in Word97
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
How to supress OpenFile dialog box in Word97
Divers
Thread ID:
00877644
Message ID:
00877644
Vues:
59
I use MailMerge. Every time i create a SourceFile for my main documets. In Word2000/XP there is no problem but in 97 always open file dialog box appears when I open Main document. Here is my code:
=SYS(3005, 1033)
thisform.fl_error   = .t.
msg_error           = ON("ERROR")
fl_error            = .f.
ON ERROR fl_error   = .t.
thisform.nLocaleId = VAL(SYS(3004))  && Save local id
=SYS(3006,1033)                      && We will be sending instructions in English
DO WHILE TYPE("thisform.oWord") # "O" .OR. ISNULL(thisform.oWord)
   thisform.oWord             = GetObject(,"Word.Application")
   IF TYPE("thisform.oWord") # "O" .OR. ISNULL(thisform.oWord)
      thisform.oWord = CreateObject("Word.Application")
   ENDIF
ENDDO
thisform.oWord.DisplayAlerts = 0
thisform.oWord.Visible = .f.

* Here open file dialog box is raised on the screen
thisform.oWord.Documents.Open(m_name)

thisform.oWord.Caption = ALLTRIM(Blanki.Name)
WITH thisform.oWord.ActiveDocument.MailMerge
     .OpenDataSource(m_name1)
ENDWITH

ON ERROR &msg_error
thisform.fl_error = .f.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform