Private Sub Document_Open()
'Populate the drop down lists'
DeviceTypes.List = Array(" ", "Desktop", "Laptop", "Printer", "Other")
End Sub
The Document _open is the place to list all the events you want to happen
when the document is opened. Not trying for sarcasm here..
You can past this code into your form, substitute "DeviceTypes.List" with
ComboBox12.List, and replace items like "Desktop" with your user's names.
> Hello,
> I Have a Word form. Combo box12 I would like to auto populate with the users
> name when the file open
> Any help??
>
> Lime
Lime - 16 Aug 2006 20:47 GMT
I'm Sorry I meant Text Box. When the file is opened I would like the text box
to auto populate with the Users name (the person filling out the form)
> Private Sub Document_Open()
>
[quoted text clipped - 15 lines]
> >
> > Lime
lumpy04 - 16 Aug 2006 21:17 GMT
ok, you might try the following:
Private Sub Document_Open()
textbox1.text = "%username%"
end sub
> I'm Sorry I meant Text Box. When the file is opened I would like the text box
> to auto populate with the Users name (the person filling out the form)
[quoted text clipped - 18 lines]
> > >
> > > Lime
Lime - 17 Aug 2006 00:02 GMT
Hello,
Thanks for your input but all that will do is put %Username% in textbox1
Thanks,
Lime
> ok, you might try the following:
>
[quoted text clipped - 24 lines]
> > > >
> > > > Lime
lumpy04 - 17 Aug 2006 04:08 GMT
Private Sub Document_Open()
Set objNet = CreateObject("WScript.NetWork")
user = objNet.UserName
TextBox1.Text = user
End Sub
I tested this and it works. For me anyway...Replace textbox1 with the name
of the test box you are manipulating...
here's the link I plagiarized:
http://www.codeproject.com/vbscript/userinfo.asp
> Hello,
> Thanks for your input but all that will do is put %Username% in textbox1
[quoted text clipped - 30 lines]
> > > > >
> > > > > Lime