active page always nothing

Started by perry59, August 23, 2016, 04:23:58 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

perry59

title kinda says it all.
for some reason that's driving me nuts I cant get the active page from visio.
I can get the document just fine, like this...
Dim vsoDoc As Microsoft.Office.Interop.Visio.Document = Globals.ThisAddIn.Application.ActiveDocument

but even though I am looking at a drawing, the debugger always says my active page is nothing. these are the lines I'm using...

Dim vsoPage As Microsoft.Office.Interop.Visio.Page
vsoPage = Globals.ThisAddIn.Application.ActivePage 'this is returning nothing, why?

normally, I'd have those two lines concatenated like the activedocument one, I split it up when I started having problems
I hope someone can shed some light on this
Thanks
what, me worry?

Yacine

Do the other properties of the application return values (activewindow, activedocument, etc.)?
Yacine

perry59

active document works as expected but even active window is "nothing" even though I can pull other properties from it like so...

If Globals.ThisAddIn.Application IsNot Nothing AndAlso Globals.ThisAddIn.Application.ActiveWindow IsNot Nothing Then
            If UCase(Microsoft.VisualBasic.Right(vsoDoc.FullName, 3)) = "VSD" Then
                window = Globals.ThisAddIn.Application.ActiveWindow
                currentDocument = window.Document.Name
            End If

here, window is "nothing" in the debugger, but "currentdocument" has the appropriate value
what, me worry?