Evolution Mail - Check Junk Failed - error message.
Fix by marking an email as junk, then go to the junk folder and mark as not junk.
Thursday, December 04, 2008
Thursday, November 13, 2008
Thursday, June 12, 2008
Adding a button to Outlook Addon
Private Sub AddToolbar()
Try
Dim objBar As Office.CommandBar
OL = Me.Application
objBar = OL.ActiveExplorer.CommandBars.Item("Standard")
objButton = objBar.Controls.Add(, , , 1, True)
With objButton
.Picture = getImage()
.Mask = getImage()
.TooltipText = "eConfirm"
.Caption = "eConfirm"
.Style = msoButtonIconAndCaption ' msoButtonIcon
End With
Catch ex As System.Exception
MsgBox("Failed to add button" & ex.ToString())
End Try
End Sub
Private Sub objButton_Click(ByVal Ctrl As Office.CommandBarButton, _
ByRef CancelDefault As Boolean) Handles objButton.Click
MsgBox("Hello World")
End Sub
Tuesday, June 10, 2008
Editing webserver files in Ubuntu (LAMP)
Quick post as this was a great tip to avoid using SUDO constantly.
If you change the owner of the files in the webserver path to be the current user then you don't need to do SUDO gedit filename everytime you want to edit a file! :)
If you change the owner of the files in the webserver path to be the current user then you don't need to do SUDO gedit filename everytime you want to edit a file! :)
Creating Outlook Addon not easy due to security model!
11-June-2008
10am
Wow, who would have thought it would be so hard to write an add on to outlook. (And the code I want to write is only about 10 lines!!!!) But deploying this so it will run without the Windows security model getting in the way has taken many hours of my time already! If only I could get on with writing code. (frustrated).
But, as of writing this, Microsoft has made it so hard to deploy an outlook addon that I've almost given up. A brief glance though Part 1 and Part 2 of these documents will give you an idea about why deploying an outlook addon is difficult for Outlook 2003.
But, get a load of this next document for deploying addons for Outlook 2007. The screen shots and file locations are different than my standard install of VS2008, and searching for the sample files mentioned in the document bring up no results.
Well back to it, if I can get this done in under a day I'll be happy, but I'm dubious.
1:45pm
Kevin Farley puts it well: "... the mysterious "COM object could not load" error that befuddles all of us ..."
1:51pm
Same article: "... I was getting the "runtime error: addin can not be loaded" error ... I wasted one whole day to figure out the problem" ~ S.S. Ahmed
2:01pm
And another: "Someone like me new to VSTO and new to .NET and Outlook programming has a mountain to climb to write even the simplest add-in." ~ banjaxed
ColinJMcGrath oh... It's been a long hard day.
3:15pm
Christopher Green writes "Assuming you have wronged someone and karma has dictated you will write an Office Add-in"
3:48pm
Still struggling. Now I can't find the PIAs in Visual Studio prerequisites!! :( Seems the recommended solution is to re-install Office...
3:53pm
F!@k that didn't work.
4:35pm Still can't find the prerequisites, select Microsoft Office 2003 Primary Interop Assemblies and Microsoft Visual Studio Tools for Office Runtime, and cant work out how to install them.
5:12pm
Well, I finally got the security model to work, albiet I skipped the bit about prerequisites (figured out later 5:49pm) and installed the addon and it said Hello World, amazing, only 6 hours or so, and silly me, I thought that was it, but no, the security model holds more lovely surprises in store. So I start to modify a few settings and reinstall it, and it says, sorry, you cant reinstall, already installed. Ok, so I try to uninstall, sorry you can't uninstall, the security model can't be found. Hmm, I can't install a new copy and I can't uninstall the old copy. Microsoft you guys are playing games with me right?
5:49pm
Prerequsites: If you installed the sample solution from the walkthrough,you will have a directory like "C:\Program files\Microsoft Visual Studio 2005 Tools for Office SE Resources\VSTO2005SE Windows Installer Sample\packages\Office2007PIA" on your harddisk. In this directory the package files for the prerequisites definition files are stored. You will also have a directory like: "C:\Program files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages" Here are the standard Package definition files. If you copy over the directories from the sample to the standard directory -> you will have it here.
Lets see eh... Far out, I'm having a win. Why wouldn't they just say that in the walkthrough? Fkn MS. Oh, part 1, well why didn't they say?
12-June-2008
Ok, I'm at it again this morning. Last night I finally got the addon to load in outlook and output Hello World! But going back though the walkthough I thought I'd try and at least finish off some of the major items such as addin the prerequsites. I found that I'd actually installed the wrong version of the VSTO tools!!! I had the original version, not Version 3 So I couldn't work out why I didn't have half the files like ComponentCheck.cpp!
What are the parameters is in your Custom Install Action
2:15pm
From Forum answer about custom actions In the walkthrough custom actions:
/assemblyName="OutlookAddin.dll" /targetDir="[TARGETDIR]\" /solutionCodeGroupName="MyCompanyName.OutlookAddin" /solutionCodeGroupDescription="Code group for OutlookAddin" /assemblyCodeGroupName="OutlookAddin" /assemblyCodeGroupDescription="Code group for OutlookAddin" /allUsers=[ALLUSERS]
The CodeGroupName is "MyCompanyName.OutlookAddin", make sure to change companyname to your company name!! This whole string must exactly be the same in Install, Rollback and Uninstall actions of your setup project.
Recommend Revo Uninstaller if you have the above problem where you can't install or uninstall.
Limitations of the Setup Project
The default Setup project has several limitations:
* By default, the Setup project does not set the security policy. The add-in assembly and any referenced assemblies must be granted full trust for the add-in to run. You can add a step to the Setup project to configure the security policy, or an administrator can set the appropriate security policy. For more information, see Security Requirements to Run Office Solutions (2003 System).
* By default, the Setup project does not check for, or install, the Visual Studio Tools for Office runtime and the primary interop assembly (PIA) for the Microsoft Office application. If these components are not installed on the end user computer, the add-in will not run. For more information about the prerequisites, see How to: Prepare End User Computers to Run Office Solutions (2003 System).
Yeah right: "Security policy can be easily deployed in a Windows Installer"
10am
Wow, who would have thought it would be so hard to write an add on to outlook. (And the code I want to write is only about 10 lines!!!!) But deploying this so it will run without the Windows security model getting in the way has taken many hours of my time already! If only I could get on with writing code. (frustrated).
But, as of writing this, Microsoft has made it so hard to deploy an outlook addon that I've almost given up. A brief glance though Part 1 and Part 2 of these documents will give you an idea about why deploying an outlook addon is difficult for Outlook 2003.
But, get a load of this next document for deploying addons for Outlook 2007. The screen shots and file locations are different than my standard install of VS2008, and searching for the sample files mentioned in the document bring up no results.
Well back to it, if I can get this done in under a day I'll be happy, but I'm dubious.
1:45pm
Kevin Farley puts it well: "... the mysterious "COM object could not load" error that befuddles all of us ..."
1:51pm
Same article: "... I was getting the "runtime error: addin can not be loaded" error ... I wasted one whole day to figure out the problem" ~ S.S. Ahmed
2:01pm
And another: "Someone like me new to VSTO and new to .NET and Outlook programming has a mountain to climb to write even the simplest add-in." ~ banjaxed
ColinJMcGrath oh... It's been a long hard day.
3:15pm
Christopher Green writes "Assuming you have wronged someone and karma has dictated you will write an Office Add-in"
3:48pm
Still struggling. Now I can't find the PIAs in Visual Studio prerequisites!! :( Seems the recommended solution is to re-install Office...
3:53pm
F!@k that didn't work.
4:35pm Still can't find the prerequisites, select Microsoft Office 2003 Primary Interop Assemblies and Microsoft Visual Studio Tools for Office Runtime, and cant work out how to install them.
5:12pm
Well, I finally got the security model to work, albiet I skipped the bit about prerequisites (figured out later 5:49pm) and installed the addon and it said Hello World, amazing, only 6 hours or so, and silly me, I thought that was it, but no, the security model holds more lovely surprises in store. So I start to modify a few settings and reinstall it, and it says, sorry, you cant reinstall, already installed. Ok, so I try to uninstall, sorry you can't uninstall, the security model can't be found. Hmm, I can't install a new copy and I can't uninstall the old copy. Microsoft you guys are playing games with me right?
5:49pm
Prerequsites: If you installed the sample solution from the walkthrough,you will have a directory like "C:\Program files\Microsoft Visual Studio 2005 Tools for Office SE Resources\VSTO2005SE Windows Installer Sample\packages\Office2007PIA" on your harddisk. In this directory the package files for the prerequisites definition files are stored. You will also have a directory like: "C:\Program files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages" Here are the standard Package definition files. If you copy over the directories from the sample to the standard directory -> you will have it here.
Lets see eh... Far out, I'm having a win. Why wouldn't they just say that in the walkthrough? Fkn MS. Oh, part 1, well why didn't they say?
12-June-2008
Ok, I'm at it again this morning. Last night I finally got the addon to load in outlook and output Hello World! But going back though the walkthough I thought I'd try and at least finish off some of the major items such as addin the prerequsites. I found that I'd actually installed the wrong version of the VSTO tools!!! I had the original version, not Version 3 So I couldn't work out why I didn't have half the files like ComponentCheck.cpp!
What are the parameters is in your Custom Install Action
2:15pm
From Forum answer about custom actions In the walkthrough custom actions:
/assemblyName="OutlookAddin.dll" /targetDir="[TARGETDIR]\" /solutionCodeGroupName="MyCompanyName.OutlookAddin" /solutionCodeGroupDescription="Code group for OutlookAddin" /assemblyCodeGroupName="OutlookAddin" /assemblyCodeGroupDescription="Code group for OutlookAddin" /allUsers=[ALLUSERS]
The CodeGroupName is "MyCompanyName.OutlookAddin", make sure to change companyname to your company name!! This whole string must exactly be the same in Install, Rollback and Uninstall actions of your setup project.
Recommend Revo Uninstaller if you have the above problem where you can't install or uninstall.
Limitations of the Setup Project
The default Setup project has several limitations:
* By default, the Setup project does not set the security policy. The add-in assembly and any referenced assemblies must be granted full trust for the add-in to run. You can add a step to the Setup project to configure the security policy, or an administrator can set the appropriate security policy. For more information, see Security Requirements to Run Office Solutions (2003 System).
* By default, the Setup project does not check for, or install, the Visual Studio Tools for Office runtime and the primary interop assembly (PIA) for the Microsoft Office application. If these components are not installed on the end user computer, the add-in will not run. For more information about the prerequisites, see How to: Prepare End User Computers to Run Office Solutions (2003 System).
Yeah right: "Security policy can be easily deployed in a Windows Installer"
Friday, April 25, 2008
How to get a unix timestamp timezone adjusted from VBScript clientside
Hi All,
As usual timezones are the bane of my life, here is another few hours that I'll never get back.
---
How to get a Unix timestamp timezone adjusted from VBScript (clientside, not ASP)
So you are using VBScript (again, not ASP, i.e. there is no IIS web server) and you want to pass a timezone adjusted unix timestamp to a server side script such as PHP.
You can not use Session.LCID because you are not using ASP, so you need to look at the local PC to determine the timezone.
First step is to retrieve timezone from the registry of the local machine. Now of course this assumes that the local machine has the correct time and timezone information, but then you are writing a client side script so that's a problem for your client, right?
function UDate(oldDate)
Dim od
Dim atb
Dim oShell
Dim offsetMin
Dim nd
od = oldDate
set oShell = CreateObject("WScript.Shell")
atb = "HKEY_LOCAL_MACHINE\System\CurrentControlSet\" &_
"Control\TimeZoneInformation\ActiveTimeBias"
offsetMin = oShell.RegRead(atb)
nd = dateadd("n", offsetMin, od)
UDate = DateDiff("s", "01/01/1970 00:00:00", nd)
end function
---
Regards, Simon Hutchison
http://www.econfirm.com.au/
As usual timezones are the bane of my life, here is another few hours that I'll never get back.
---
How to get a Unix timestamp timezone adjusted from VBScript (clientside, not ASP)
So you are using VBScript (again, not ASP, i.e. there is no IIS web server) and you want to pass a timezone adjusted unix timestamp to a server side script such as PHP.
You can not use Session.LCID because you are not using ASP, so you need to look at the local PC to determine the timezone.
First step is to retrieve timezone from the registry of the local machine. Now of course this assumes that the local machine has the correct time and timezone information, but then you are writing a client side script so that's a problem for your client, right?
function UDate(oldDate)
Dim od
Dim atb
Dim oShell
Dim offsetMin
Dim nd
od = oldDate
set oShell = CreateObject("WScript.Shell")
atb = "HKEY_LOCAL_MACHINE\System\CurrentControlSet\" &_
"Control\TimeZoneInformation\ActiveTimeBias"
offsetMin = oShell.RegRead(atb)
nd = dateadd("n", offsetMin, od)
UDate = DateDiff("s", "01/01/1970 00:00:00", nd)
end function
---
Regards, Simon Hutchison
http://www.econfirm.com.au/
Saturday, March 01, 2008
PHP timezones explained
---------------------
PHP timezones example
written by Simon Hutchison - http://www.econfirm.com.au/
---------------------
date_default_timezone_set("Australia/Sydney")
Sun, 02 Mar 2008 14:57:11 +1100
date_default_timezone_set("Australia/Perth")
Sun, 02 Mar 2008 12:57:11 +0900
---------------------
The comments in this example assumes server is Sydney time.
---------------------
Demonstrating that timezone is not important for mktime(), date("U") and time().
Get GMT 0. Uses the server time to adjust to GMT 0 so need to ensure server time is correct for these functions to be accurate.
date_default_timezone_set("Australia/Perth")
mktime() : 1204430231
date("u") : 1204430231
time() : 1204430231
date_default_timezone_set("Australia/Sydney")
mktime() : 1204430231
date("u") : 1204430231
time() : 1204430231
---------------------
Now that we know this we can use these functions to compare to other GMT 0 adjusted times.
Demonstrating that timezone is critical for date("date format string") and strtotime("date string")
because it takes a user string from anywhere in the world!!
date_default_timezone_set("Australia/Sydney")
The next values of time() and strtotime will be very close (within a second) because both the default timezone and the server time is Sydney.
strtotime(): 1204426991
time() : 1204430231 just after the strtotime converted date/time
date("r") : Sun, 02 Mar 2008 14:57:11 +1100
date_default_timezone_set("Australia/Perth")
The next values of time() and strtotime will be about two hours apart because the default timezone is Perth and the server time is Sydney.
strtotime(): 1204434191
time() : 1204430231 about two hours before the strtotime converted date/time for Perth time. (Remember the server is in Sydney)
date("r") : Sun, 02 Mar 2008 12:57:11 +0900
This means that mktime() can be used to compare any normalised (strtotime with timezone set) time
Normalise all incomming user dates using strtotime with date_default_timezone_set set correctly.
---------------------
PHP timezones example
written by Simon Hutchison - http://www.econfirm.com.au/
---------------------
date_default_timezone_set("Australia/Sydney")
Sun, 02 Mar 2008 14:57:11 +1100
date_default_timezone_set("Australia/Perth")
Sun, 02 Mar 2008 12:57:11 +0900
---------------------
The comments in this example assumes server is Sydney time.
---------------------
Demonstrating that timezone is not important for mktime(), date("U") and time().
Get GMT 0. Uses the server time to adjust to GMT 0 so need to ensure server time is correct for these functions to be accurate.
date_default_timezone_set("Australia/Perth")
mktime() : 1204430231
date("u") : 1204430231
time() : 1204430231
date_default_timezone_set("Australia/Sydney")
mktime() : 1204430231
date("u") : 1204430231
time() : 1204430231
---------------------
Now that we know this we can use these functions to compare to other GMT 0 adjusted times.
Demonstrating that timezone is critical for date("date format string") and strtotime("date string")
because it takes a user string from anywhere in the world!!
date_default_timezone_set("Australia/Sydney")
The next values of time() and strtotime will be very close (within a second) because both the default timezone and the server time is Sydney.
strtotime(): 1204426991
time() : 1204430231 just after the strtotime converted date/time
date("r") : Sun, 02 Mar 2008 14:57:11 +1100
date_default_timezone_set("Australia/Perth")
The next values of time() and strtotime will be about two hours apart because the default timezone is Perth and the server time is Sydney.
strtotime(): 1204434191
time() : 1204430231 about two hours before the strtotime converted date/time for Perth time. (Remember the server is in Sydney)
date("r") : Sun, 02 Mar 2008 12:57:11 +0900
This means that mktime() can be used to compare any normalised (strtotime with timezone set) time
Normalise all incomming user dates using strtotime with date_default_timezone_set set correctly.
---------------------
Tuesday, August 07, 2007
Subscribe to:
Posts (Atom)

