Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

VBA Word; Hide namebar ...

Posted on 2002-07-30
12
Medium Priority
?
135 Views
Last Modified: 2010-05-01
Hey!

I need to hide the namebar on my form (frm1), when run in word.

I don't know if i called it at it's right name, but the bar is the one where frm1.caption is shown.

Can anyone help med with this?

Regards
nicolaus
0
Comment
Question by:nicolaus
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
12 Comments
 
LVL 17

Expert Comment

by:Barry Cunney
ID: 7188151
nicolaus
Do you mean the title bar
.. if so the following article may help
http://www.vbaccelerator.com/tips/vba0016.htm
0
 

Author Comment

by:nicolaus
ID: 7189729
BCUNNEY>>
Thats exactly what i mean. But the link you provided is dead - "problems with the homepage".

I'll try again later, to see if it works then.

(Maybee you could desribe in short what to do - or not to do)
0
 

Author Comment

by:nicolaus
ID: 7190298
The homepage is still a problem.

Could you assist me?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 17

Expert Comment

by:Barry Cunney
ID: 7190481
nicolaus,
will try and get source code for you
give me 30 mins

Cheers
0
 
LVL 17

Expert Comment

by:Barry Cunney
ID: 7190540
nicolaus
I thought I had saved the source from above article but I had not.
In the meantime take a look at this article
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q83349
0
 
LVL 17

Expert Comment

by:Barry Cunney
ID: 7190569
nic
This is another sample which may give you some ideas
http://www.vbdiamond.com/Sources/ViewSource.asp?ID=17008
0
 
LVL 17

Expert Comment

by:Barry Cunney
ID: 7190573
Have a look at the Custom Caption demo on this page
http://www.softcircuits.com/sw_vbsrc.htm
0
 

Author Comment

by:nicolaus
ID: 7192563
Thank you very much, BCUNNEY.

But all the above samples is for VB, and i need the code to run in VBA for Word.
0
 
LVL 17

Expert Comment

by:Barry Cunney
ID: 7193014
I thought you may be able to do something similar in Word VBA - if I get a chance I will see if I can apply some of the above example code in Word vba - What version of Word are you using??
0
 

Author Comment

by:nicolaus
ID: 7193051
Thank you. I don't think i can use the examples in VBA - tryed before.

I'm using Word 2000.
0
 

Author Comment

by:nicolaus
ID: 7200188
Thank you for all your help. But i figured it out myself.

With this code, i have solved my problem:

Private Declare Function FindWindow Lib "user32" Alias _
      "FindWindowA" (ByVal lpClassName As String, ByVal _
      lpWindowName As String) As Long
Private Declare Function GetWindowLong Lib "user32" Alias _
      "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex _
      As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias _
      "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex _
      As Long, ByVal dwNewLong As Long) As Long
Private Declare Function DrawMenuBar Lib "user32" (ByVal _
      hwnd As Long) As Long
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 Declare Function ReleaseCapture Lib "user32" () As Long
Private wHandle As Long

Private Sub UserForm_Initialize()
    If Val(Application.Version) >= 9 Then
        wHandle = FindWindow("ThunderDFrame", Me.Caption)
    Else
        wHandle = FindWindow("ThunderXFrame", Me.Caption)
    End If
    If wHandle = 0 Then Exit Sub
    frm = GetWindowLong(wHandle, GWL_STYLE)
    frm = frm Or &HC00000
    SetWindowLong wHandle, -16, frmStyle
    DrawMenuBar wHandle
End Sub
Private Sub UserForm_MouseDown(ByVal Button As Integer, ByVal _
        Shift As Integer, ByVal X As Single, ByVal Y As Single)
    If wHandle = 0 Then Exit Sub
    If Button = 1 Then
        ReleaseCapture
        SendMessage wHandle, &HA1, 2, 0
    End If
End Sub

nicolaus
0
 
LVL 6

Accepted Solution

by:
Mindphaser earned 200 total points
ID: 7200821
Points refunded and moved to PAQ

** Mindphaser - Community Support Moderator **
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

722 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