Monday, April 21, 2014
Best Wishes over the Holiday Season

I had a wonderful time getting together with my family in Boston for the holidays. The only minor disappointment was we spent a few days in Vermont and there was literally no snow - so no skiing unfortunately.
I am pretty excited. I got a MAC laptop for Christmas and feel like I am back in kindergarten learning how to scroll and select data. I also got the Mac version of Office so that should be interesting. I will let you know how this goes.
The Mac laptop has some great features that I am looking forward to playing with. Luckily I have my daughter as the resident Mac guru. It seems that with this I am reverting back to shortcut keys to do everything. The command key is constantly in use. When I tweeted about my laptop and commented about learning how to right-click, I had a couple of people tweet me back to see how to do it.
To right-click on a Mac laptop, put two fingers - your index and forefinger -slightly apart on the track pad area and then press down with your forefinger.
Year End is almost upon us. Yikes! Enjoy the rest of the week.
Thursday, April 17, 2014
The remote server returned an error 407 Proxy Authentication Required
- Imports System.Configuration
- Imports System.IO
- Imports System.Net
- Imports System.Text
- Public Class Form1
- Dim InstallerSite As String
- Dim UploadFile As String
- Dim MyProxy As New WebProxy
- Dim ProxyPresent As Boolean
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- InitializeGlobals()
- txtResult.Text = GetFile()
- End Sub
- Private Sub InitializeGlobals()
- InstallerSite = CType(ConfigurationManager.AppSettings("InstallerSite"), String)
- UploadFile = CType(ConfigurationManager.AppSettings("UploadFile"), String)
- ' Case for when a Proxy is present.
- ProxyPresent = CType(ConfigurationManager.AppSettings("ProxyPresent"), Boolean)
- Dim ProxyUrl As String = CType(ConfigurationManager.AppSettings("ProxyUrl"), String)
- Dim ProxyDomain As String = CType(ConfigurationManager.AppSettings("ProxyDomain"), String)
- Dim ProxyUserName As String = CType(ConfigurationManager.AppSettings("ProxyUserName"), String)
- Dim ProxyPassword As String = CType(ConfigurationManager.AppSettings("ProxyPassword"), String)
- Dim credentials As New System.Net.NetworkCredential(ProxyUserName, ProxyPassword, ProxyDomain)
- MyProxy.Address = New Uri(ProxyUrl)
- MyProxy.Credentials = credentials
- End Sub
- Private Function GetFile() As String
- Dim result As String = String.Empty
- Try
- Dim request As HttpWebRequest
- Dim response As HttpWebResponse
- request = WebRequest.Create(InstallerSite & UploadFile)
- If ProxyPresent = True Then
- request.Proxy = MyProxy
- End If
- response = request.GetResponse()
- Dim responseStream As Stream = response.GetResponseStream()
- Dim buffer(10) As Byte
- Dim bytesToRead As Integer = CInt(buffer.Length)
- Dim bytesRead As Integer = 0
- While bytesToRead > 0
- Dim i As Integer = responseStream.Read(buffer, bytesRead, bytesToRead)
- If i = 0 Then
- Exit While
- End If
- bytesRead += i
- bytesToRead -= i
- End While
- result = Encoding.ASCII.GetChars(buffer)
- Catch ex As Exception
- result = ex.Message
- End Try
- Return result
- End Function
- End Class
It turned out they needed to enter the IP address for their proxy domain not just the domain name.
Sort Columns of the Table using Word VBA
Sort Word Table columns using Word VBA
The following function uses Selection.Sort, you can try alternative methods if selection is not possible / permissible
Function SortTable()
ActiveDocument.Tables(1).Select()
Selection.Sort(ExcludeHeader:=True, FieldNumber:="Column 1", SortFieldType _
:=wdSortFieldAlphanumeric, SortOrder:=wdSortOrderAscending, FieldNumber2 _
:="", SortFieldType2:=wdSortFieldAlphanumeric, SortOrder2:= _
wdSortOrderAscending, FieldNumber3:="", SortFieldType3:= _
wdSortFieldAlphanumeric, SortOrder3:=wdSortOrderAscending, Separator:= _
wdSortSeparateByTabs, SortColumn:=False, CaseSensitive:=False, LanguageID _
:=wdEnglishUS)
Selection.MoveRight(Unit:=wdCharacter, Count:=1)
End Function
The above uses as three column table. Please customize it for your use
See also:
How to use .Net Array.Sort Function in VBA
Case in-sensitive comparison
Friday, April 11, 2014
How to Measure the Rank of a Website
The ranking of a website depends on several factors. It depends on Google Page Rank (known as PR), Alexa Traffic Rank, Complete Rank and so many. And to check the ranking status, there are thousands of extension available for internet browsers.
- First, make sure you are using Google Chrome or Firefox.
- If you are a chrome user then click here. And Firefox users can use this link.
- Chrome users will get several toolbars with Web Rank SEO. You can choose either the first one or any other toolbar as you like and then hit on Add to Chrome. And Firefox users should click on Add to Firefox button.
- Then click on install. Firefox should be restarted. But chrome doesnt need to be restarted.
- Now you are almost done. Chrome users must see this like an icon at the upper right corner. And Firefox users will get it like a horizontal bar.