MS Access – VBA – Set Focus on Next TabIndex Control

I’ve seen this question a few times over the years:

How can I set the focus on the next control on a form as if the user pressed the tab button?

Now there are a variety of possible answers

SendKeys

I cringe to say it, but SendKeys can be a solution, but at the same time SendKeys are notorious for causing issues and are to be avoided at all cost.  Never the less, you could simply do something like

SendKeys "{tab}"

Continue reading

Microsoft PowerApps, Get Ready To Open Your Wallet

Fellow MVP Alum Anders Ebro shared with the MVP group an article We need citizen devs, cries Microsoft – but pricey new licensing plans for PowerApps might put paid to that which elaborates on the fact that PowerApps will soon begin to cost developers. It would seem that Microsoft plans to monetize PowerApps above and beyond your Office365 subscription.

People are also complaining about how complex the pricing plans (different routes, differnt plans, …) are to understand and figure out actual costs vs. needs.

Continue reading

VBA – Extract Outlook Contacts

contact information

Once again, helping out with a forum question regarding the very limited information returned when using the External Data -> Import & Link -> More -> Outlook Folder. So, as per the usual, VBA give you the power to do it all and that is true when interacting with Outlook and Outlook Contacts. Below is the beginning of a procedure to extract any and all information from the Contacts folder.

Continue reading

VBA – Outlook – Work With Search Folders

I was recently helping out in an Experts-Exchange discussion in which the user needed to work with a custom Search Folder they had created.

Now normally, we could simply do something along the line of

Sub EnumerateFolder()
    Dim oOutlook              As Object    'Outlook.Application
    Dim oNameSpace            As Object    'Outlook.Namespace
    Dim oStores               As Object    'Outlook.Stores
    Dim oStore                As Object    'Outlook.Store
    Dim oFolders              As Object    'Outlook.folders
    Dim oFolder               As Object    'Outlook.folder

    On Error Resume Next
    Set oOutlook = GetObject(, "Outlook.Application")        'Bind to existing instance of Outlook
    If Err.Number <> 0 Then        'Could not get instance, so create a new one
        Err.Clear
        Set oOutlook = CreateObject("Outlook.Application")
    End If
    On Error GoTo Error_Handler
    Set oNameSpace = oOutlook.GetNamespace("MAPI")
    Set oStores = oNameSpace.Session.Stores
    For Each oStore In oStores
        Debug.Print oStore.DisplayName, oStore.FilePath, oStore.Class
        Set oRoot = oStore.GetRootFolder
        Debug.Print , oRoot.Name, oRoot.FolderPath
        Call EnumerateFolders(oRoot)
    Next
Error_Handler_Exit:
    On Error Resume Next
    If Not oFolder Is Nothing Then Set oFolder = Nothing
    If Not oFolders Is Nothing Then Set oFolders = Nothing
    If Not oStore Is Nothing Then Set oStore = Nothing
    If Not oStores Is Nothing Then Set oStores = Nothing
    If Not oNameSpace Is Nothing Then Set oNameSpace = Nothing
    If Not oOutlook Is Nothing Then Set oOutlook = Nothing
    Exit Sub

Error_Handler:
    MsgBox "The following error has occurred" & vbCrLf & vbCrLf & _
           "Error Number: " & Err.Number & vbCrLf & _
           "Error Source: EnumerateFolder" & vbCrLf & _
           "Error Description: " & Err.Description & _
           Switch(Erl = 0, "", Erl <> 0, vbCrLf & "Line No: " & Erl) _
           , vbOKOnly + vbCritical, "An Error has Occurred!"
    Resume Error_Handler_Exit
End Sub

Private Sub EnumerateFolders(ByVal oStartFolder As Object)
    'Modified from: https://docs.microsoft.com/en-us/office/vba/api/outlook.stores
    Dim oFolders               As Object 'Outlook.folders
    Dim oFolder                As Object 'Outlook.Folder

    On Error Resume Next

    Set oFolders = oStartFolder.folders

    If oFolders.Count > 0 Then
        For Each oFolder In oFolders
            Debug.Print , oFolder.Name, oFolder.FolderPath, oFolder.Class
            Call EnumerateFolders(oFolder)
        Next
    End If
    
    If Not oFolder Is Nothing Then Set oFolder = Nothing
    If Not oFolders Is Nothing Then Set oFolders = Nothing
End Sub

to enumerate the folders with Outlook, but if you do so, you’ll notice this method does not include such Search Folders!

Continue reading

Windows 10 1809 – Error – Printing

Yes, yet another Windows 10 Bug! It seems to never end. I basically stopped trying to track bugs as I just couldn’t keep up anymore with all the never ending issue with Windows 10 and Office 365 (it could be someone’s full-time job!), but this one directly impacted me when I most needed a functional printer for work and I read many very complex solutions in various forums that I thought I’d quickly share a simpler solution that worked for me. Hopefully this might help someone else out there facing the same issue.

The Problem/Bug

My PC automatically upgraded to Win 10 version 1809 a couple days ago and now I can’t print anymore!

My Printer is still listed and marked as fine, but any print job from any application errs. The Printer status simply states “Error – Printing“. Rebooting does nothing. I tried to find something in the Event Log, but haven’t managed to locate anything relative to printing. There is nothing indicating any error on the printer itself, the red light doesn’t engage and it remain in a ready state, the issue seems to entirely lie with Windows 10.

Continue reading

VBA – WIA – Flip an Image

I was helping out in a forum discussion regarding manipulating images, specifically flipping them and published some of my code there, so I thought I’d share it here for everyone else to benefit from.

Once again, WIA has everything we need to quickly and easily perform this task! WIA offers developers 2 image processing properties: FlipHorizontal and FlipVertical that we need only apply.

Below are a few sample functions illustrating how it can easily be implemented.
 
Continue reading

MSI GP73 8RE-079CA Leopard Misses The Mark

My Mission

I was getting seriously concerned about the longevity of my laptop after 6+ years of constant daily use and decided to venture out and find a new and improved replacement to take me into the future.

My needs were not too extreme, or so I thought.  I wanted

  • A big screen
  • Lots of RAM (to run my VMs smoothly – I currently had 8GB and thought 16GB was the way to go)
  • Lots of Drive Space

So I set out to my local suppliers (BestBuy, Canada Computers, Staples/Bureau en Gros, …) and was floored when none had any that could fit the bill.  They all seemed to be pushing 13″ tablets (I don’t call those laptops!).  So, since no local retailers had anything to offer, the world wide web had been promoted to my new best friend and so the search began.  I spent a lot of time going back and forth (amazon, newegg, …) reviewing dozens of laptops, but spending a lot of time on MSI and ASUS models, just the way my searches kept coming up.  After at least a month of my procrastination, I decided to finally purchase MSI’s GP73 8RE-079CA Leopard which had some impressive stats:

  • CPU: i7-8750H
  • RAM: 16GB
  • HD: 512GB SSD, 1TB HDD
  • Case: Steel (so they say, but in fact it has a plastic bottom which makes it prone to breaking when trying to upgrade/repair the unit!)
  • Ports: HDMI, USB-C, USB 3, Ethernet, …

On paper, it looked like a lean and mean machine!

Within a few days, my box arrived and hours of work began.  Installing Windows, Office, every other programs…  Oh, did I forget the countless Microsoft never ending slew of updates!!!  OMG!

Continue reading