title: Find latest approved version of an SPListItem
body: <p>I am trying to iterate through the SPListItem.Versions collection to find the latest approved list item.</p>
  
  <p>My list item has three versions: the first two are approved, the last is in draft. But my code says they're all in draft! Please help!</p>
  
  <pre><code>// Iterate through all versions
  for (int index = 0; index &lt; item.Versions.Count; index++)
  {
      SPListItem versionedItem = item.Versions[index].ListItem;
  
      // Check if moderation information is set to approved
      if (versionedItem.ModerationInformation.Status.Equals(SPModerationStatusType.Approved))
      {
          // We found an approved version!
          itemFound = versionedItem;
      }
  }
  </code></pre>