Just posted on using C# and the new object model in InfoPath 2007 to retrieve the current user. I have 3 other posts that deal with this issue as well. Believe it or not, the product team has actually addressed this in with a no code solution in InfoPath 2007. Follow these steps to see for yourself.
- Create a new form by Designing a New Form Template
- Choose blank form
- Add a text box to the form (Field1)
- Go to Tools | Form Options
- Go to the Open Behavior section and click on Rules
- Add Action to Set a Field's Value
- Choose the field you added above as the field to populate
- For the value, click on the Fx button and choose Insert Function
- View All in the Categories drop down
- At the bottom you'll see userName, pick it
- The formula that gets dropped in is userName()
- Preview the form, you'll see your UserName in field1
That, my friends, is progress!