Re: Create a Label with code
Re: Create a Label with code
as you did not explain what you are trying to achieve, or in what application, difficult for anyone to give answer
Re: Create a Label with code
Oh, well i was just trying to just create a normal label with code instead of having to make it in the design mode. Like when I press a button a label with like the text from a textbox I have.
And the application is Word 2007, but I just use the Visual Basic function not Word itself. Kinda hard to explain since I'm not too good with this stuff.
So just create a label with code is the only thing I want. Thankful for any help :)
Re: Create a Label with code
is this on a userform?
if so it should be something like
vb Code:
Set newlbl = Me.Controls.Add("Forms.Label.1", "mylabel", True)
newlbl.Caption = "this is a test"
newlbl.Left = 20
newlbl.Top = 40
this works, much easier to make the labels in design mode
Re: Create a Label with code
Yes thank you! That was exactly what I wanted :D