27 June 2011

How to use Office 2007 Automation in Windows 2008 service

Using office automation on windows server 2008.


This issue bugged me for over a day and thought I would share it. Thanks Simone Malvassori

http://emalvass.blogspot.com/2010/01/how-to-use-office-2007-automation-in.html

In summary:



  • for x64 system is necessary to create the following folder:
    C:\Windows\SysWOW64\config\systemprofile\Desktop

  • for x86 system:
    C:\Windows\System32\config\systemprofile\Desktop

4 December 2010

Multiplication without the multiplication operator (*)

I was asked 2 days ago how to you create a multiplication function without using the multiplication operator?

Eesh, a bit of head scratching and then a while after these were the possibilities
  1. Use a while loop to iterate over one of the values
  2. Use a for loop to iterate over one over the values
  3. Use recursion to call yourself until a drop-out condition occurs
Other things to think about
  1. Negative numbers. If one number is negative then the returning value will be negative. If both are negative or both positive then return positive
  2. Iterate over the smallest number to be more efficient

Change feature id in VSeWSS

Change feature id in VSeWSS

Problem
I tried changing the feature id in the feature.xml file in the WSP view but it created a new feature. This is a bug or part of some of the VSeWSS issues. When I refreshed the WSP view it created a new feature with the original name and a “_1” after it.

Solution
To stop this from happening change the feature id in the solution.xml, in the hidden pkg folder and change the feature id in the generated feature.xml file is the WSP view. That should do it

30 July 2009

Get Byte Array using Enterprise Library

It took me a while to figure this out so I thought I would post the solution here. I needed to get a blob out of the database and assign it to a byte[] in my object

Solution

//initialise the byte[] and get its size
byte[]
byteArray = new byte[(dr.GetBytes(dr.GetOrdinal("File"), 0, null, 0, int.MaxValue))];
//Assign bytes to byte array
dr.GetBytes(dr.GetOrdinal("File"), 0, byteArray, 0, byteArray.Length);
//Assign Value
file.FileByte = byteArray;

Enjoy

25 July 2009

SharePoint 2007 & .Net 3.5 SP1

Problem

“The Registry Records Center could not be found or accessed”

Last week I was working on a few problems we were having with SharePoint and Office 2007. One of those problems happened all of a sudden and the Send to Records Centre stopped working. The error we were getting was The Registry Records Center could not be found or accessed. Registry being the name of our Records Centre.

I was told that an emergency service pack needed to be installed for .Net Framework 2.0 to resolve some of our issues but nothing was mentioned about .Net 3.5 and SP1

It turns out that after installing .Net 3.5 all seems to be well in the SharePoint space, but installing 3.5 SP1 breaks the Send to Records functionality.
I can across this blog entry by Aghy: http://dotneteers.net/blogs/aghy/archive/2008/10/31/moss-2007-and-net-framework-3-5-sp1.aspx

Solution

I created a .reg file described in the kb and all my problems went away, well at least this one. You can download the file here

It seems that it is the loopback check that .NET 3.5 SP1 introduces that is causing a problem. The solution is described in the MS kb 896861

KB description
You receive error 401.1 when you browse a Web site that uses Integrated Authentication and is hosted on IIS 5.1 or IIS 6 http://support.microsoft.com/kb/896861

The file contents are:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa]
"DisableLoopbackCheck"=dword:00000001

Silent

I have been silent for a while. I have been completing my MSc in computer science at Birkbeck which I found out I passed, what a huge relief.

I still have a SaaS project using WCF and Silverlight that I working on to hand in to seal the deal. It is coming along nicely and I will post parts of the project here and some cool things I have learned. The new part of the framework, WCF, that I have not used before is super cool & powerful

22 April 2009

2007 Office System Driver and 64 bit architecture

I wrote a spread sheet upload component for our web application at work. We have now decided to move to 64 bit architecture and an upgrade from .Net Framework 2.0 to 3.5.

On the initial analysis of this migration we realised that the 2007 Office System Driver used does not support 64 bit

Solution:
So I did a bit of research and it turns out that the solution is to compile you application in 32 bit mode, which sux for us as we can’t utilise the 64 bit

To compile you applications in 32 bit do the following:

1. Open menu "Build/Configuration Manager..."
2. Select "" in the "Active solution platform:" combobox
3. Select "x86" and click ok.

With regards from Walter Wang [MSFT]

There does not seem to be a planned release for a 64 bit version

Tags
2007 Office System Driver: Data Connectivity Components 64 bit
Access Database Engine
Microsoft.ACE.OLEDB.12.0