Visual Studio Code (VSCode) is a great tool for editing Markdown files. It’s not immediately obvious that VSCode comes out of the box with the capability to preview Markdown files and even provide a side by side live preview view so you can see the result as you are modifying the file.
In VSCode opening the file will provide the standard file editing experience (as shown on the right hand side of the image below). Without having to remember VSCode keyboard shortcuts, you can simply right click the markdown file and select Open Preview.
This will result in the preview of the markdown file being opened in a new tab.
We can go one step further using the Split Editor button in VSCode to get both the editing experience and preview side by side.
You now have a live preview, any changes made in the editor (left side) are immediately reflected in the preview (right side)
This is a problem I have come across each time I build a new virtual development machine with Visual Studio on it. The problem has been around for a few years now and I always have to search around for the steps to fix it each time it catches me.
I’ve seen this issue in the following versions of Visual Studio and the resolution is the same and works for them all:
- Visual Studio 2012
- Visual Studio 2015
- Visual Studio 2017
- Visual Studio Code
When using Visual Studio the mouse cursor flickers badly or totally disappears when the mouse pointer is in the code editing area of Visual Studio (as shown in the screenshot below).
Moving the mouse cursor outside of this area makes it visible again, and it seems that the mouse pointer is unaffected when using other applications and on the Windows desktop itself.
I’ve found that the problem is much more prevalent when access Visual Studio on another machine (e.g. virtual development machine) via remote desktop.
Thankfully the solution is quick and simple:
- Open Control Panel | Appearance and Personalization | Personalization | Change mouse pointers
- On the Pointers tab of the dialog change the Scheme to Windows Black (system scheme)
That’s it, your cursor should now be back and stable.
When developing Office Add-ins and using Typescript, I’ve found the Office.js Typescript definition file available at DefinatelyTyped to only support a fraction of the objects and properties that are available within the Office.js library.
To give you an idea of what I mean, here is a list of properties that are available on the Office.context.mailbox.item object (according to the API documentation in the Outlook Dev Center)
And here are all the properties of that same object using the Typescript definition file:
I was left wondering where the rest of the properties were. They simply don’t exist in the Typescript definition file. So this leaves us in a bit of a bind, because we are using Typescript we can’t just reference a property that doesn’t exist in the Typescript definition file (even though we know the property will exist at run-time). The Typescript compiler will do it’s job well and throw up a compile time error that the property does not exist.
Without going to the effort of taking the Office.js Typescript definition file and extending it yourself to start filling it out you may want to consider the following work around.
We can declare an object in Typescript without a specific type by specifying it’s type as any. If we do this to an object within the Office.js library we can get an un-typed handle to the object. As the object in now un-typed, we can call any property of that object we like (whether it exists or not). Below is the code that will give us access to the subject of the email that is not available in the Typescript definition file.
If the property exists at runtime then great, if not then we will get a run-time error. It is definitely a step backwards and is why we use Typescript in the first place!
It would get a bit unwieldy if you used this technique throughout your code, and I’d like to think that as we get updated Office.js Typescript definition files that we can remove this type of code from our project and access the properties in a properly typed way. To isolate your use of this technique to a central location and facilitate removing the code later on, I’d suggest creating a class that takes in the object (e.g. Office.context.mailbox.item) then inside the class it gets the un-typed handle to the item and provides methods or properties that return the missing properties (with the bonus that the values returned can have a type associated with them). Below is an example of a class with static methods that provide typed access to missing properties on a mailbox item.
Hopefully the Office team will see the value in publishing current and complete Typescript definition files so we don’t have to write code like this in future.
Here are 2 techniques for creating views in SharePoint when you want to group on dates. Throughout this article I’ll be using the example of email that have been saved to SharePoint where the email date has been stored in a SharePoint column called “Email Date”. The Email Date is saved with both a date and time component.
Here’s the All Documents view of the library showing the Email Date column
If we try to use the Email Date column to group by in the view
The view creates a group for each different day (the time component is ignored)
2 Level Grouping: by Year and then by Month
This view is going to get very busy with a grouping for each day, so how about we split it up a bit by creating 2 levels of grouping, firstly by year and then by month.
Unfortunately we can’t just use the existing Email Date column to achieve this, instead we will create two calculated columns to use for the groupings (one for year and another for month).
To create the year column:
Create as a calculated column
Set the returned data type as Single line of text (this gives better formatting control and the year will still sort properly as text)
Set the formula to =TEXT([Email Date], “yyyy”)
To create the month column:
Create as a calculated column
Set the returned data type as Single line of text (this gives better formatting control and by padding a single digit month with 0 will still sort properly as text)
Set the formula to =TEXT([Email Date],”mm (mmmm)”)
Now if we create a new view (based on the All Documents view) and add two levels of grouping based on our new calculated columns
Our new view now renders in SharePoint giving collapsible grouping at both the Year and Month levels
This is now a lot easier to navigate and drill down, and it’s quite nice to see the counts against each grouping as well. In this example I set the groups (both Year and Month) to sort in descending order. This means that the latest will be at the top (notice 2016 is above 2015, and within 2016, February is above January).
Faking a 3 Level Grouping: by Year/Month Combined and then by Day
SharePoint has a limitation in that you can only create two levels of grouping. If we want to have a third level (under month) that grouped together all the email from the same day then we can’t just go and add a third level of grouping. What we can do instead though is create a slightly more complex calculated column that combines both the year and month and use it as our top level grouping. So let’s do that now by creating a Year/Month column:
Create as a calculated column
Set the returned data type as Single line of text (this gives better formatting control and we can carefully craft the text so it still sorts year/month properly as text)
Set the formula to =TEXT([Email Date],”yyyy-mm (mmmm)”)
We are also going the need a calculated column to group on the specific day, so I’ll create the Day column
Create as a calculated column
Set the returned data type as Single line of text
Set the formula to =TEXT([Email Date],”dd (ddd, d mmm yyyy)”)
Now we create our new view (based on the All Documents view) and add groupings based on the Year/Month column and the Day column. Again we will sort descending to get the latest at the top.
The resulting SharePoint view gives us the year/month breakdown at the first level and we can then drill down to a specific day within the month.
I’m sure you can now go forward and add your own tweaks and formatting changes to get better date categorized views out of SharePoint.
Microsoft Surface Pro 4 doesn’t have built in LTE capability (at the time of writing this). What this means is that your Surface Pro 4 can’t connect to the internet on its own. It needs to connect to a wireless network/hotspot, or use a USB adaptor to provide access to the internet (e.g. physical Ethernet connection).
I’ve read a few articles dismissing the Surface Pro 4 because the lack of LTE (or SIM card). I don’t really find it an issue, why? Because of a neat little trick that the Surface can do with my Windows Phone.
Most smartphones these days support tethering (also called internet sharing, or wireless hotspot). This effectively shares the internet connection that your phone has with other devices. Other devices connect to your phone (which acts as a wireless hotspot) and then get access to the internet (which you can secure with a password). Ok, boring blurb over, you already knew that you could get out to the internet by using your phone right?
Here’s what you are probably used to:
- Pull out your phone
- Unlock your phone
- Navigate into the phone settings area
- Find the tethering/internet sharing settings
- Turn tethering/internet sharing on
- Now back on your Surface, if you’ve set up the Wi-Fi connection to your phone to auto connect you should find the connection is made automatically after a few seconds and you’re on the internet
But this process is just so clunky and slow.
So here’s the neat trick that your Windows Phone, teamed up with your Surface is capable of:
- Leave your phone alone – in your pocket, bag, backpack, desk drawer (wherever as long as it within a reasonable range)
- On your Surface, simply click on the Wi-Fi icon in the task tray to show any available Wi-Fi connections. You should see your phone listed (even though the tethering is not enabled on your phone). You can see my NOKIA Lumia phone in the list below and it shows as “Mobile hotspot, off”
- Now I just select the NOKIA Lumia option in the list and click Connect
- Without touching my phone, the Surface is able to turn on the hotspot/tethering feature of the phone and connect to it.
I would also suggest changing the connection to your phone to set it as a metered connection. This will prevent Windows from performing costly data transfers such as downloading updates.
So do I care that my Surface Pro 4 doesn’t have LTE (SIM card)? Not at all, because I’ve always got my phone close by and I can now share its internet connection with just 2 clicks. It’s a pretty cool integration that makes a world of difference.
I’ve only tried this on a Surface Pro 4 (Windows 10) and Nokia Lumia 930 (Windows 10), although the articles below suggest that this feature also works on Windows 8.1.
Here’s a quick tip that one of my colleagues showed my this week that makes working with multiple monitors a lot easier. Thanks to @FreeRangeEggs for this tip.
You’ve got 2 windows (A and B) and you want to dock them side by side on monitor 1.
Its easy to dock window A to the left on monitor 1. Just drag the window to the left of the monitor and it will “snap” or dock to the left side and fill up half the screen.
But now if we try to do the same with windows B, instead of docking the the right of monitor 1, the window just glides across onto monitor 2.
So how do we get window B to dock to the right side of monitor 1? First select window B then use the keyboard shortcut WINDOWS KEY + RIGHT ARROW.
Simple as that.
Note: You can also use WINDOWS KEY + LEFT ARROW to dock to the left side of the current monitor. This can help you do the reverse (that is, if you are on monitor 2 and want to dock a window to the left side)
Office 365 and SharePoint work quite nicely when you are working with Microsoft Office file types. Things like Word, Excel and PowerPoint files. Once you really start using SharePoint however, you want to store many more types of files in SharePoint. This is natural and you can actually get the files into SharePoint without too much hassle.
Editing and working on Office file types is pretty good. Just click on the file in SharePoint and you can now choose to do the edits directly in the browser (with online versions of the Office products) or edit the files in the full desktop version of the Office products.
But what’s the story with file types that don’t open in, or are not associated with the Office products?
Well that’s when things get a little clunky, and in this post I’m going to show you how OnePlaceDocs Explorer turns virtually any software application into a “SharePoint” aware application that you can use to open/edit and save files that live in SharePoint. No longer are you just restricted to using the Office application that were designed to work with SharePoint, now you can edit files in any application you want.
So what is OnePlaceDocs Explorer? It is a bit like Windows File Explorer except it is purpose built for looking at SharePoint and Office 365 environments rather than files on your local computer or network.
To give you some orientation, the screenshot below shows OnePlaceDocs Explorer and points out the 3 pane layout which is similar to Windows File Explorer.
Let’s look at a common scenario…
Editing Images Files in SharePoint/Office 365
It’s actually very difficult to edit image files that are stored in SharePoint. If you try to open the file, the web browser simply displays the image in the browser (because it natively knows how to). This doesn’t help you when you want to edit the image though. Your options are to either:
- Download the image from SharePoint to your local computer, edit it in your image editing program of choice, then manually upload the file back to SharePoint replacing the existing file
- Sync the whole library offline via OneDrive and then you can work with the file as though it is a normal file on your desktop. Saving changes to the local file will sync back to SharePoint.
Here’s the OnePlaceDocs Explorer way.
Select the image file and select Open With (from the ribbon or context menu action)
Select any application from the list of applications installed on your computer that recognise this file type. I’ll choose good old Microsoft Paint just to prove that a very basic application that has no interoperability with SharePoint will work fine.
Paint now starts up and the image stored in SharePoint is sitting there ready for me to edit.
I’ll make a few changes and just save using the standard save action in Paint or pressing CTRL+S.
Believe it or not, that is it.
If we return to OnePlaceDocs Explorer we can see in the changes showing in the preview pane.
We can then find the same file in SharePoint
And there’s my modified image.
Editing the file using OnePlaceDocs Explorer really wasn’t any different to opening a file from my local computer. So now you have no excuse for not putting those files in SharePoint where they belong!
This same technique can be used to open any type of file with any installed application. Another common scenario is opening PDF files with Adobe Acrobat or another PDF authoring tool.