Hiding the Product Name

Started by murugavelmsc, March 11, 2010, 11:43:43 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

murugavelmsc

Hi,

I have a Visio 2007 Application. I want to hide the text "Microsoft Visio" in the header of the document
(i.e. Filename - Microsoft Visio). Is it possible to hide that. If it is means please advice.

Thanks,
Murugavel

Paul Herber

Here is some code in Delphi that sets the application name to 'Fred':


target_hwnd: THandle;

target_hwnd := FindWindow(nil, 'Microsoft Visio');
if target_hwnd <> 0 then
  SendMessage(target_hwnd, WM_SETTEXT, 0, Integer(PChar('Fred')));


I've just tried it and it overwrites the Visio main window caption.
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

murugavelmsc

Hi
Is it possible in VBA to hide the Product Name.
If not means, how i can incorporate the delphi code into my application.

Thanks in advance,
Murugavel S

Paul Herber

Yes, you just have to translate the Delphi code into the VBA equivalent.
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

AndyW

Private Declare Function SendMessage Lib "USER32" Alias "SendMessageA" ( _
                                ByVal hwnd As Long, _
                                ByVal wMsg As Long, _
                                ByVal wParam As Long, _
                                LParam As Any) As Long

Private Const WM_SETTEXT = &HC


Call SendMessage(Visio.Application.WindowHandle32, WM_SETTEXT, 0, ByVal "New Title")
Live life with an open mind

Paul Herber

Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

AndyW

I've also noticed, that if you open another document in Visio, restore a document window etc that Visio will reset the application window and document window captions.
Live life with an open mind

murugavelmsc

Hi,

It works great, But i click the save as - the name can be changed as "File Name - Microsoft Visio".
I want to change the name as Filename only in visio header window.

I can use the following code to save as

ThisDocument.SaveAs "C:\" & Trim(Wrkflow_Name_txt.Text) & ".vsd"


Please Help me.

Murugavel