Visio Guy

Visio Discussions => Programming & Code => Topic started by: matthew on November 13, 2020, 05:40:33 PM

Title: How to tell if there are other visio files open?
Post by: matthew on November 13, 2020, 05:40:33 PM
Hi, can anyone tell me if there is a way for my visio vba code to tell if there is 1 or more other visio files open (when you don't know what they are called)? I know it sounds like a simple thing to be able to do but I don't know how to start and can't find any references, any suggestions would be very welcome, thanks, Matthew
Title: Re: How to tell if there are other visio files open?
Post by: Nikolay on November 13, 2020, 06:37:28 PM
Do you mean, open in the same Visio application?
Title: Re: How to tell if there are other visio files open?
Post by: matthew on November 13, 2020, 07:03:43 PM
yes, sorry for not being clear, multiple files in the same application
Title: Re: How to tell if there are other visio files open?
Post by: Surrogate on November 13, 2020, 07:28:57 PM
All these documents are open in single Visio application session?
Title: Re: How to tell if there are other visio files open?
Post by: Nikolay on November 13, 2020, 07:57:49 PM
Quote from: matthew on November 13, 2020, 07:03:43 PM
yes, sorry for not being clear, multiple files in the same application

Then you can just check the collection of documents, it will list all open documents:


For Each doc In Application.Documents
    Debug.Print doc.FullName
Next
Title: Re: How to tell if there are other visio files open?
Post by: Paul Herber on November 13, 2020, 08:25:21 PM
and the current document is:
ActiveDocument.FullName
Title: Re: How to tell if there are other visio files open?
Post by: matthew on November 15, 2020, 08:48:18 AM
thanks, works great, much appreciated
Matthew