🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: free.it.visual-basic
Article #3589

CreateObject

#3589
From: luckydor
Date: Mon, 27 May 2002 18:54
55 lines
2523 bytes
-------------------SCOPO :
Da VB devo aprire files .Doc di Microsoft Word 2000
gi� esistenti in una cartella.

Poich� devo interagire con essi
ho referenziato (Microsoft Word 9.0 Object Library)

Utilizzando la Sub seguente tengo traccia dei
documenti aperti.
---------------------
Private Sub Timer1_Timer()
On Error GoTo errore

    Caption = ""
    Dim MyApp As Word.Application
    Set MyApp = Application

    ReDim nome(MyApp.Documents.Count)
    For Each myDoc In MyApp.Documents
        nome(idx) = myDoc
        idx = idx + 1
    Next
    Text1 = Join(nome, vbNewLine)
    Set MyApp = Nothing

Exit Sub
errore:
    Text1 = ""
    Caption = Err.Description
End Sub
-------------------PROBLEMA:--

Se chiudo tutti i documenti, mentre il progetto � in esecuzione, aprendo
altro/i documento/i;
questi non vengono + rilevati.

In poche parole, deve rimanere aperto almeno un
documento Word.

Ho provato con :

    Set MyApp = New Application
    GetObject
    CreateObject

Niente da fare.
---------------
Ho l'impressione che venga memorizzato ID del processo Word e che una volta
chiusi tutti i documenti
al successivo riavvio (ovviamente) non avr� lo stesso ID.
--------------------
La cosa mi sembra veramente strana xch�
quando si utilizza un sistema del genere � ovvio che alla fine
dovranno essere chiusi prima i Doc Word e poi l'applicazione
che li gestisce.
Technical Details
Message-ID: <whvI8.91424$CN3.2693313@news2.tin.it>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!newsfeed.online.be!news.algonet.se!algonet!news.tele.dk!small.news.tele.dk!4.1.16.34!cpk-news-hub1.bbnplanet.com!news.gtei.net!nntp.abs.net!uunet!dca.uu.net!nyc.uu.net!ash.uu.net!seanews2.seabone.net!news-out.tin.it!news-in.tin.it!news2.tin.it.POSTED!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ITALIAN,ASCII
X-Google-Thread: f94ee,6fe1715d1aa9cf45,start
X-Google-Attributes: gidf94ee,public
X-Google-ArrivalTime: 2002-05-27 11:55:43 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!newsfeed.online.be!news.algonet.se!algonet!news.tele.dk!small.news.tele.dk!4.1.16.34!cpk-news-hub1.bbnplanet.com!news.gtei.net!nntp.abs.net!uunet!dca.uu.net!nyc.uu.net!ash.uu.net!seanews2.seabone.net!news-out.tin.it!news-in.tin.it!news2.tin.it.POSTED!not-for-mail
From: "luckydor" <orfwim@tin.it>
Newsgroups: free.it.visual-basic
Subject: CreateObject
Lines: 62
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
Message-ID: <whvI8.91424$CN3.2693313@news2.tin.it>
Date: Mon, 27 May 2002 18:54:20 GMT
NNTP-Posting-Host: 213.45.114.82
X-Complaints-To: newsmaster@tin.it
X-Trace: news2.tin.it 1022525660 213.45.114.82 (Mon, 27 May 2002 20:54:20 MET DST)
NNTP-Posting-Date: Mon, 27 May 2002 20:54:20 MET DST
Organization: TIN