Problem A
Declare all your variables - using Option Explicit will ensure that you do
Instead of using a For Each loop use
For lngCount = olItems.Count To 1 Step -1
Set olMailItem = olItems(lngCount)
This will process the folder in reverse order and thus not screw up the count as items are removed.
Problem B
This is the bigger problem, because of the way attachments are identified in HTML e-mails which have graphic elements. Those graphics are classed as attachments. It can therefore be difficult to identify whether the attachments are required attachments or message images. I have not tested it, but I think the following may be closer to what you have in mind:
Option Explicit
Sub SortFolder()
Dim olNs As Outlook.NameSpace
Dim olMailFolder As Outlook.Folder
Dim myDestFolder As Outlook.Folder
Dim noAttachFolder As Folder
Dim PDFOnlyFolder As Folder
Dim olItems As Outlook.Items
Dim olMailItem As Outlook.MailItem
Dim olAttach As Attachment
Dim bPDF As Boolean
Dim lngCount As Long
Dim lngAtt As Long
On Error GoTo err_Handler
Set olNs = GetNamespace("MAPI")
Set myDestFolder = olNs.GetDefaultFolder(olFolderInbox).folders("For Investigation")
Set noAttachFolder = olNs.GetDefaultFolder(olFolderInbox).folders("No Attachments")
Set PDFOnlyFolder = olNs.GetDefaultFolder(olFolderInbox).folders("PDF Only")
Set olMailFolder = olNs.GetDefaultFolder(olFolderInbox).folders("Batch Prints")
Set olItems = olMailFolder.Items
For lngCount = olItems.Count To 1 Step -1
Set olMailItem = olItems(lngCount)
bPDF = False
If olMailItem.Attachments.Count > 0 Then
For lngAtt = 1 To olMailItem.Attachments.Count
If Right(LCase(olAttach.FileName), 4) = ".pdf" Then
bPDF = True
Exit For
End If
Next lngAtt
Else
olMailItem.Move noAttachFolder
End If
If bPDF = True Then
olMailItem.Move PDFOnlyFolder
Else
olMailItem.Move myDestFolder
End If
DoEvents
Next lngCount
err_Handler:
Set olNs = Nothing
Set olMailFolder = Nothing
Set myDestFolder = Nothing
Set noAttachFolder = Nothing
Set PDFOnlyFolder = Nothing
Set olItems = Nothing
Set olMailItem = Nothing
lbl_Exit:
Exit Sub
End Sub