Sign In
MSDN Blogs
Microsoft Blog Images
More ...
Microsoft InfoPath 2010
The official blog of the Microsoft InfoPath team
Advanced search options...
Search In:
Everything
Blogs
Forums
People
Groups
Places
Pages
Date range:
All Time
Last Year
Last 6 Months
Last 3 Months
Last Month
Last Week
Last Two Days
Common Tasks
Blog Home
Subscribe via RSS
RSS for comments
RSS for posts
Atom
recent posts
Goodbye WhoAmI! Hello userName()
Posted
over 6 years ago
by
infopath1
Use Visual Studio to create InfoPath forms… without code
Posted
over 6 years ago
by
infopath1
Download the Beta!
Posted
over 6 years ago
by
infopath1
Cool video on InfoPath in Outlook
Posted
over 6 years ago
by
infopath1
Best Practices for Rules
Posted
over 6 years ago
by
infopath1
Tags
5 for forms
Academy Live
Beta
Browser Forms
Community
Controls
Cool Forms
Data Connections
Developer
Formulas and XPath
InfoPath 2010
InfoPath Form Web Part
Layout
Outlook
Picture button
Rapid Development
Sandboxed Solutions
SharePoint
SharePoint List
SharePoint Lists
Talks
Technical Preview
VSTA
Web Part
Writing Code
General
Office Online
Support Center
Office Developer Center
InfoPath Dev
Office Blogs
Microsoft Access
Microsoft Excel
Microsoft OneNote
Microsoft Outlook
Microsoft PowerPoint
Microsoft Project
Microsoft Publisher
Microsoft SharePoint
Microsoft SharePoint Designer
Microsoft SharePoint Workspace
Microsoft Visio
Microsoft Word
Office 2010 Engineering
Office Extensibility
Office Global Experience
Office Interoperability
Office Math
Office Natural Language Team
Office Sustained Engineering
Office Web Applications
Performance Point
Archives
Archives
April 2011
(1)
July 2010
(3)
June 2010
(3)
May 2010
(7)
April 2010
(12)
March 2010
(8)
February 2010
(8)
January 2010
(8)
December 2009
(3)
November 2009
(2)
October 2009
(3)
August 2009
(3)
July 2009
(3)
February 2009
(1)
October 2008
(1)
September 2008
(2)
August 2008
(1)
July 2008
(1)
June 2008
(5)
May 2008
(1)
April 2008
(1)
July 2007
(1)
May 2007
(2)
April 2007
(1)
March 2007
(11)
February 2007
(14)
January 2007
(13)
December 2006
(10)
November 2006
(14)
October 2006
(13)
September 2006
(3)
August 2006
(2)
July 2006
(8)
June 2006
(11)
May 2006
(8)
April 2006
(7)
March 2006
(2)
February 2006
(1)
December 2005
(1)
November 2005
(1)
August 2005
(1)
July 2005
(1)
June 2005
(3)
April 2005
(3)
March 2005
(2)
February 2005
(4)
January 2005
(2)
December 2004
(4)
November 2004
(8)
October 2004
(8)
September 2004
(10)
August 2004
(7)
July 2004
(2)
June 2004
(5)
May 2004
(12)
April 2004
(12)
March 2004
(16)
May, 2006
MSDN Blogs
>
Microsoft InfoPath 2010
>
May, 2006
Subscribe via RSS
Sort by:
Most Recent
|
Most Views
|
Most Comments
Excerpt View
|
Full Post View
Microsoft InfoPath 2010
Goodbye WhoAmI! Hello userName()
Posted
over 6 years ago
by
infopath1
17
Comments
Anyone who's tried to get the username of the person filling out their form in InfoPath 2003 knows the
WhoAmI web service
. That was the only way to get the username without writing Visual Basic or C# managed code and using
System.Environment.UserName
.
In
InfoPath 2007
we built an easier way.
Announcing a new formula function: userName()
Now you can simply set the default value to the current form-filler's username. No code, no data connections, no custom web service. Just use the formula dialog and select the function from the category "All":
To get a default value like this:
If that's too easy for you, use it in script
If you're writing script anyway, or if you need to check this value as part of a bigger algorithm and don't want to persist the username anywhere in the form, then you can also access this value in script:
Application.User.UserName
Of course, you can also use this in C# or Visual Basic, but you could always use
System.Environment.UserName
, so that's nothing new.
Either way requires Domain Trust
For security reasons, either approach will make your form require domain trust, so you'll need to publish the form to a shared location (like Windows SharePoint Services) for the function to work.
Enjoy!
-ned
Microsoft InfoPath 2010
Use Visual Studio to create InfoPath forms… without code
Posted
over 6 years ago
by
infopath1
11
Comments
Although the primary purpose of
Visual Studio 2005 Tools for Office (InfoPath 2007 Support)
is to add C# and Visual Basic code to your InfoPath form template, you can still take advantage of hosting InfoPath inside Visual Studio to design forms that don't have any code.
When you create a new InfoPath form template project in Visual Studio, by default, it will be created with code enabled. To obtain a form without code, you need to explicitly remove the code from the form by using the remove code button in the programming tab of the form options dialog.
After clicking on this button, you might be confused to see that the code file is still present in the project. Don’t worry about this. When you build the project, the hosted designer will not add the output assemblies to the form template.
How it works
After a new project is created, the “enabled” attribute of the “managedCode” element in the manifest.xsf defaults to “yes”. Clicking the remove code button sets this attribute to “no”.
<
xsf2:managedCode …
enabled
=
"
no
"
></
xsf2:managedCode
>
This attribute is set back to “yes” when you insert an event handler using the hosted InfoPath designer.
After a success build, the output assemblies will only be included with the form template when this attribute is set to yes.
- Gary
Software Development Engineer
Microsoft InfoPath 2010
Download the Beta!
Posted
over 6 years ago
by
infopath1
10
Comments
I'm super excited to announce
Microsoft Office InfoPath 2007 Beta
and
Microsoft Office Forms Server 2007 Beta
for
browser-enabled forms
, so you can
install both of them today
.
After registering you'll get to select which products you want, which should include:
Microsoft® Office Professional Plus 2007
(includes InfoPath)
Microsoft® Office SharePoint® Server 2007 - Enterprise
(includes Forms Services, which is also available standalone as Microsoft® Office Forms Server 2007. Both servers have 64-bit options.)
All are available in English, French, Spanish, German, and Japanese, so tell your friends!
If you're a regular Visual Studio code-junkie, then download the
Visual Studio 2005 Tools for the Microsoft Office System (InfoPath 2007 update)
, which is also included in the
Visual Studio Tools for Office "v3" June Community Technology Preview
.
Woohoo!
- Ned and the whole exuberant InfoPath team
Microsoft InfoPath 2010
Cool video on InfoPath in Outlook
Posted
over 6 years ago
by
infopath1
5
Comments
As part of getting everyone up to speed on Office 2007, and in preparation for the imminent release of the Beta, we've just posted some "Partner technical readiness training" videos.
It includes a great one on using InfoPath in Outlook, so I thought I'd call it out:
http://download.microsoft.com/download/3/9/0/39024c52-eb1a-4fa4-84fd-6d0686657f08/(%205%20)%20Office%202007%20InfoPath%20Forms%20In%20Outlook.wmv
You can check out all the videos here:
http://www.microsoft.com/downloads/details.aspx?FamilyID=5cb386ff-1b77-4adc-a42f-f5ea375e4ed1&DisplayLang=en
Enjoy!
-ned
Microsoft InfoPath 2010
Best Practices for Rules
Posted
over 6 years ago
by
infopath1
1
Comments
My forms have a bad habit of accumulating more and more rules as I add more and more functionality over time, so I came up with a set of guidelines to keep those rules clean and orderly.
Remember that there are four places to add rules
On Button Click (in Properties dialog)
When values change (in Controls and Data Source Properties)
On Submit (in Submitting Forms dialog)
On Load (in Form Options | Open and Save section)
Give your rules names for the scenario they capture
Good names will summarize their conditions/actions in a more friendly way: eg "
Submit using multiple data connections
", or "Cancel query if expenses too high".
Group rules by condition, but separate actions without conditions
If more than one action has the same condition, put them together so you can edit the condition only once. Otherwise, put each action in its own rule, so you can easily reorder them independently.
Use "Stop processing rules" to save retyping conditions
If there's a case where you don't want to run any of your rules, add a rule that checks that case. It doesn't need to have any actions, just check the box to stop processing rules and put the rule before any of the other rules that would also check that case. For example, if you want to skip some submit logic if the expenses in the form are less than 100, put that condition in its own rule before your submit logic, and just have it stop the rules.
Use dialog messages to debug while developing
Dialog messages are great for tracing your rules at runtime, but are usually jarring while filling out the form. If you have a condition message to show, use conditional formatting instead to hide/show a section/expression-box with the message. You can even make the message dynamic by having the expression box look up a value in the data source and setting that value from the rule.
Know when to use calculated default values vs set a field's value
The “Set a field’s value” action is best for values that only need to be set/copied once, or for values that are conditional. For values that need to update every time another field changes unconditionally, best to use a calculated default value. Good examples for rules:
Demo button that populates an entire form with sample data
Copying suggested values from a secondary data source that the users can edit afterward
Setting someone’s email address based on their name, but only if the email field is blank beforehand
Got tips?
If you've got your own best practices we'd love to hear them! Post a comment to share your insights with the whole community.
- Ned
Microsoft InfoPath 2010
Auto height for sections
Posted
over 6 years ago
by
infopath1
4
Comments
InfoPath forms are all about being dynamic, so it's important that the sections in your form grow and shrink appropriately. For example, if someone deletes an optional section from inside another section, the outer section should shrink accordingly.
Of course, sections will grow/shrink by default after you insert them, but InfoPath will change it to a fixed size if you resize the section, since we don't want to disobey your command to be a specific size. So in the example above, the outer section will stay the same size even when the Notes section isn't there -- it will just have a bunch of white space in its place.
The trick: Use "auto"
If you resized a section by accident and want to return it to the default, just open its properties, switch to the "Size" tab, and type
auto
for the height. Now it will only be as big as it needs to be and never bigger.
- Ned
Microsoft InfoPath 2010
Moving fields in the data source
Posted
over 6 years ago
by
infopath1
7
Comments
As most folks figure out quickly, InfoPath doesn't support drag-and-drop of fields in the data source. There are a lot of technical reasons for this, and even a usability concern that people won't realize they can drag fields onto the form as controls if we also allowed them to drag fields around in the data source. But we've heard enough feedback that changing that has made it onto the long list of possible features for future releases. Keep the feedback coming!
So how do you move fields groups in the data source?
One way is to right-click the field or group and select "Move Up" or "Move Down".
This is great for novices because it's discoverable, but it's a painful number of clicks if you're an expert who has to move a lot of fields in many forms.
A trick for the keyboardist
The fastest way to move a field or group a long distances is:
Open the data source task pane
Type the "F6" key
Click tab until a field in the data source is highlighted in orange
Use the Up/Down arrow keys to select the field you want to move
Hold down the CTRL key and use the Up/Down arrow keys to move the field
Note that this only moves the field in order, it won't move it as a child of a different group. To do that you still need to right-click the field and select "Move".
Hope that helps!
ned
Microsoft InfoPath 2010
Tabs
Posted
over 6 years ago
by
infopath1
10
Comments
In my last post I covered how to make
Wizard-like forms
. This time I want to talk about another common practice for organizing all the fields in a form: grouping each set of fields onto a "tab" so the user can switch between the sets in whichever order they wish. While wizards are useful in forms with a clear flow, tabs are useful when the same form will be updated multiple times in different places.
In Windows XP, tabs look like this (this screenshot's taken from InfoPath's View Properties dialog):
InfoPath doesn't have a built-in Tab Control, but it's easy enough to build one using tables, buttons, and views, so let's do it!
The basic idea
Here's what to build:
Views for the contents of each tab
Table with shading to give the visual effect of tabs
Buttons for each tab with a rule that switches the view
For example:
Then when the user clicks "Details" they switch views to see this:
How To, with tricks along the way
Create all of your views (from the Views task pane)
Select the same color scheme for each view (use the Color Schemes task pane)
Use Background Color on the Format menu to make the background of each view the second color for the current color scheme (the second-darkest color at the top of the color picker)
Insert a layout table (on the Insert menu, click Table)
Make it two rows high. The first row will be for the buttons, the second will be for the tab content.
Split the first row to make a cell for each view, plus one extra cell to take the remaining horizontal space.
Insert a button into each cell (from the Controls task pane)
Add a rule to each button to switch to the corresponding view. Do this even for the current view's button.
Make the current "active" button Bold, so it stands out.
Use borders and shading (on the Format menu)
Select all the buttons at once (hold down the Control key and click each one), then remove all borders and shading from the buttons (they're invisible except for their label!).
Select the entire table, then add borders inside and out using the first color in the color scheme (the darkest color).
Select the non-active cells and set their shading to the third lightest color of the color scheme.
Select the active cell and the content cell, and set their shading to white.
Select the active cell and remove the bottom border so it becomes connected to the content cell.
Select the right-most "extra" cell and remove the top and right border
Copy the table to each view
Update the borders and shading to change the "active" cell for each view
Put all your fields for each tab in its content cell
Getting fancy
If the tabs above aren't pretty enough for your form, add some images inside a few more table cells around each button to provide rounded corners and other visual effects. It's more work, and requires some image editing, but with a little elbow grease you could get something as schmancy as this:
Enjoy,
Ned
Page 1 of 1 (8 items)