Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Default text in textboxes
I have done this once but don't remember how. The licensee appears in all new
textboxes as a default and it can be prevented from appearing, which I would very much like to know how. Can anyone help me with this? Thanks |
#2
|
|||
|
|||
You can use an API call to get the username:
Option Explicit Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _ "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long Function fOSUserName() As String ' Returns the network login name Dim lngLen As Long, lngX As Long Dim strUserName As String strUserName = String$(254, 0) lngLen = 255 lngX = apiGetUserName(strUserName, lngLen) If lngX < 0 Then fOSUserName = Left$(strUserName, lngLen - 1) Else fOSUserName = "" End If End Function 'not quite a textbox, but you can use it kind of like this: Sub testme() Dim resp As String resp = InputBox(prompt:="Hi there", Default:=fOSUserName) MsgBox resp End Sub MissGenie wrote: I have done this once but don't remember how. The licensee appears in all new textboxes as a default and it can be prevented from appearing, which I would very much like to know how. Can anyone help me with this? Thanks -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I set my color default for gridlines & text? | Setting up and Configuration of Excel | |||
Adding default comment text | Excel Discussion (Misc queries) | |||
Set "print all text as black" as default in Excel | Excel Worksheet Functions | |||
Read Text File into Excel Using VBA | Excel Discussion (Misc queries) | |||
how do i set default font / text size in comments? | Setting up and Configuration of Excel |