Roger
asked on
Application.Window.Caption is read-only in Visio 2010, 2013.Is there a work around to disable the cation or change it?
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
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
ASKER
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
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
Have you tried ?
visioApp.ActiveWindow.Capt ion = "testing... hello"
of course you should have first an active window
visioApp.ActiveWindow.Capt
of course you should have first an active window
ASKER
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.C aption
' the NEXT line is bug: 'invalid window type for this action'-->>
Application.ActiveWindow.C aption = "testing... hello"
Debug.Print "Custom Caption = "; Application.ActiveWindow.C aption
End Sub
I think the page: https://msdn.microsoft.com/en-US/en-en/library/office/ff768113(v=office.15).aspx
is incorrect!
Kelvin
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.C
' the NEXT line is bug: 'invalid window type for this action'-->>
Application.ActiveWindow.C
Debug.Print "Custom Caption = "; Application.ActiveWindow.C
End Sub
I think the page: https://msdn.microsoft.com/en-US/en-en/library/office/ff768113(v=office.15).aspx
is incorrect!
Kelvin
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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
Visio's object model is more limited than xl, and it can be a bit frustrating.
Kelvin
the reference says it is read and write
pls try
Debug.Print Application.ActiveWindow.C
Application.ActiveWindow.C
Debug.Print Application.ActiveWindow.C
for reference
https://msdn.microsoft.com/en-US/en-en/library/office/ff768113(v=office.15).aspx
Regards