Solved

Application.Window.Caption is read-only in Visio 2010, 2013.Is there a work around to disable the cation or change it?

Posted on 2015-02-02
6
118 Views
Last Modified: 2015-02-12
I drive Visio 2010 from excel 2010.
Excel causes visio files to be made with machine-defined file names, and maintains a spreadsheet of visio files created.
In this spread sheet, the user does not see the machine defined name, but a token name the user has chosen.

Ideally, I'd like the token file name to replace the machine file name in the App.window.caption (seems not).

If that's not possible, is there a way of customising the Status Bar Message?

One 'indirect' option is to provide a customised ribbon button called "My File Name", which calls a MsgBox or UserForm that displays the file name from a variable.

Else, is there another work around (except for displaying the token file name within the Visio drawing window)?


Thanks

Kelvin
0
Comment
Question by:Kelvin4
  • 3
  • 3
6 Comments
 
LVL 49

Expert Comment

by:Rgonzo1971
ID: 40585647
Hi,

the reference says it is read and write

pls try

Debug.Print Application.ActiveWindow.Caption
Application.ActiveWindow.Caption = Application.ActiveWindow.Caption & 1
Debug.Print Application.ActiveWindow.Caption

for reference
https://msdn.microsoft.com/en-US/en-en/library/office/ff768113(v=office.15).aspx

Regards
0
 

Author Comment

by:Kelvin4
ID: 40586293
Thank you Rgonzo,
I see your reference, which is new to me.
In my hybrid system (code in Excel drives Visio) the following code has these effects:

'Application' refers to Excel
Application.Caption = "Think! Question Writer, loaded with Question File: " & "'" & item_FileName & "'"
'this alters the Caption of the excel application

visioApp is the object I set for the visio application
    MsgBox "visioApp.Window.Caption = " & visioApp.Window.Caption
'this reports the default text of the Visio window

'I think this is the ACID test of whether visioApp.Window.Caption is write as well as read.......
    visioApp.Window.Caption = "testing... hello" does not write ... it threw a bug report

I conclude visioApp.Window.Caption is read only?

Kelvin
0
 
LVL 49

Expert Comment

by:Rgonzo1971
ID: 40586310
Have you tried ?

visioApp.ActiveWindow.Caption  = "testing... hello"

of course you should have first an active window
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:Kelvin4
ID: 40590452
Thanks, sorry for the delay -

I tested the code as you commented,: the default caption reads as expected; the customised caption failed:

Code written directly into into standard module of Visio 2013 (Excel not involved).  

Sub test()

          ' the NEXT line reports the default caption, as displayed on the Visio application window ----->>
    Debug.Print "default Caption = "; Application.ActiveWindow.Caption

          ' the NEXT line is bug: 'invalid window type for this action'-->>
    Application.ActiveWindow.Caption = "testing... hello"

    Debug.Print "Custom Caption = "; Application.ActiveWindow.Caption

End Sub

I think the page: https://msdn.microsoft.com/en-US/en-en/library/office/ff768113(v=office.15).aspx
is incorrect!

Kelvin
0
 
LVL 49

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 40590467
Sorry can't help further
0
 

Author Closing Comment

by:Kelvin4
ID: 40605179
Thanks for your advice, which is always appreciated.
Visio's object model is more limited than xl, and it can be a bit frustrating.

Kelvin
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A recent Visio zone question asked how to use the data in an Excel file to create a Visio Gantt chart -- and then to dynamically update the Gantt chart. The good news is that the Viso Gantt Chart wizard can be automated. The bad news is that the…
The ability to add structure to Visio diagrams using containers, lists and callouts is one of my favorite features in Visio 2010. In this article we’ll examine lists. We’ll explore containers and callouts in separate articles. Prior to reading th…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now