Hello. First and foremost, I would like to provide some information. I am a system admin, with 10 years of experience, but very limited VB.
I found the code pasted below from a google search that is supposed to work, but it does not because it is incomplete, from what I can tell.
What I'm looking for: I'm looking to run a code that will detect a POP3 account being used within Outlook. Depending on whether one exists, I would need the VBS to output something AND create a file ( for example c:\notexist.txt or c:\exist.txt ) that way I can push a GPO and search for people who DO NOT have it setup. Every user in the building should have BOTH exchange and POP3, however some delete the POP3. I'm looking at detecting these users.
I found this code, but as I said it is incomplete, and I have no idea how to complete it. Any assistance would help: If you want the source as to where I found it, please let me know and I can provide. Thanks again!
Function ForceEmailcheck() as boolean
'------------ Set up the Variables / Objects
Dim oCtl As Microsoft.Office.Core.CommandBarControl
Dim oPop As Microsoft.Office.Core.CommandBarPopup
Dim oCB As Microsoft.Office.Core.CommandBar
'Use the Send/Receive on All Accounts action in the Tools
'menu to send the items from the Outbox, and receive new items for my specific account
oCB = objOutlook.ActiveExplorer.CommandBars("Menu Bar")
oPop = oCB.Controls("Tools")
oPop = oPop.Controls("Send/Receive")
oCtl = oPop.Controls.Item(6) '----- Please see below why this is a #6 (*)
oCtl.Execute()
'------ return something but not needed to work
ForceEmailCheck = True
End Function