Showing posts from January, 2014

Parsing Word Document XML via MsXml in VBA

An old friend ping me because while having some success loading word documents saved as xml in his VBA routines in word, he was having massive problems getting XPATH to work. I resolved the basic issue and then asked him to give me his hardest issue for me to show some example code for. I think that the last time that I did this was a few years ago, MsXml was (and is) a bit lame compared to later implementations, so his troubles were very reasonable to have.   Declaring name spaces You can’t use XPath on a document with namespaces without providing the name spaces. The process is pretty simple, just convert the namespaces declare at the top of the XML document to a VB String. There happen to be many of them in a word xml document..   Dim domPrefix As String domPrefix = "xmlns:wpc='' " domPrefix = domPrefix + "xmlns:mc='

Merging two AspNet Profiles–more complex then one would think!

During recent code revision, a developer accidentally removed in Web.Config, the applicationName on the SQLProfileProvider element. The consequence became apparent when support started to report customers saved-reports-definitions(which was stored here) had disappeared. < add name ="ErrorProfileProvider" connectionStringName ="LocalSQLServer" type ="System.Web.Profile.SqlProfileProvider" /> The problem was identified, but there was a second problem… We had a significant number of new customers that also saved reports-definitions to this error profile provider. A simple switch back by adding the applicationName would mean that these reports-definitions would disappear (which customer support did not want to see happen to new customers – a rather bad experience). My initial take was “Oh, I have used multiple membership providers in one web application in the past, so we just need to use the same pattern…” Oops that pattern did not w