Friday, October 24, 2008

Remove signature from custom Outlook form

Creating custom forms in Outlook is pretty simple, but the problem I ran into is that my signature was being put in the Message body every time. I did a little searching and found the solution to remove the signature from the custom form.

1. Open the form in design mode.
2. Run the form.
3. Delete the signature.
4. Use the "Design This Form" command to open the form again in design mode.
5. Publish the new form, which should no longer have the signature in it.

The original post where I found this is here. They listed something about versioning control, so if that's something you're interested in, check their post. I don't need versioning control so I was able to use the 5 steps above

Excel VB to convert cell values to hyperlinks

Update 2/24/09: I've noticed increased traffic to this post using keywords that make it appear that some of you are just looking how to create a hyperlink in an Excel cell, without the need for any VB code. If that's all you want to do, right-click on the cell you want and select "Hyperlink...". At the top you can enter the text you want to have visible to the user and displayed within the cell, and at the bottom you can enter the actual URL the user will be directed to by clicking on the cell. If you're looking to automatically convert a bunch of cells with URL's into hyperlinks, then go ahead and continue on to the original article.

I was presented with an issue yesterday. A user was getting a .csv export that contained a column with URLs, but those URLs were coming across as plain text in the export, rather than being clickable. They also wanted to hide the URL and display different text in the cell instead. So I did some digging, and some programming, and came up with the following for them:

Function CreateLink() As Integer
Dim row As Integer 'used to track the row we're in

Dim strLink As String 'used to store the URL that already exists as text in a cell
Dim column As String 'used to track the column we're in
Dim Cell As String 'used to combine the row and column into a cell reference value
Dim displayTxt As String 'used to set the text we want the hyperlink to display

displayTxt = "IMAGE" 'hyperlink will always show up as "IMAGE"
column = "G" 'existing text hyperlink values are all in column G
row = 2 'I had a header row so actual values start in row 2
Cell = column & row 'combine row and column in this case to get the Cell = "G2"

While Range(Cell).Value <> "" 'continue looping until the value in the cell is blank
strLink = Range(Cell).Value 'set the hyperlink value to be what's in the cell (G2 first time)

Range(Cell).Hyperlinks.Add _ 'add the hyperlink
Anchor:=Cells(row, column), _ 'sets which cell to add the link in
Address:=strLink, _ 'sets the hyperlink URL
TextToDisplay:=displayTxt 'sets the text to display. We wanted "IMAGE" only

row = row + 1 'go to the next row in the next iteration of the loop
Cell = column & row 'set the new cell value with the new row number
Wend

End Function

In our case, the url text existed in column "G", which is why I was able to set it statically above. Then I wanted to loop through the sheet to get through all the cells in the G column until there weren't any more values, which is where the While loop comes in. As I looped through the cells, I also wanted to convert the value within the cell to be a clickable hyperlink using the text that was already in the cell, and also change the visible text in the cell to read "IMAGE" so that's all the person would see.

I just put a call to this function in the SelectionChange portion of the worksheet properties. After it ran and converted the cells, I removed the VB code and saved the worksheet again. This ran pretty quickly and saved the user from manually going in and changing the display text on all the cells, and from changing the plain text representing the hyperlink to an actual hyperlink

Monday, October 20, 2008

Manage Microsoft Outlook custom forms

If you use custom forms in Microsoft Outlook, you may come to a point where you need to manage the forms that are available. If you need to remove forms, you can do so by going to Tools->Options->Other->Advanced Options->Custom Forms... This will allow you to delete those forms that you have published, but do not want to have available any more. You can also manage forms in the Organizational Forms Library from here too, if you have Owner permissions on the library folder.

Friday, October 17, 2008

Automating Linux processes with 'cron'

If you have been looking to schedule some type of task on your Linux machine, but aren't sure how to do it, there's cron. cron is the Linux task scheduler, and is a very useful tool. My use has been limited to Red Hat, so I can't vouch for the validity of this for other flavors of Linux. If you try it with another version and run into problems, consult the system documentation for cron's usage. In Red Hat, the system cron tasks are found at /etc/crontab. Any user-defined cron tasks are to be placed at /var/spool/cron. There are also more tasks found at /etc/cron.d. Using your favorite text editor, you can create or modify the cron files to include whatever command(s) you want to execute on a schedule. The syntax for a command within a cron file is as follows:

minute hour day month dayofweek command

Where the values correspond to:

minute: any integer from 0 to 59
hour: any integer from 0 to 23
day: any integer from 1 to 31, depending on the month you choose
month: any integer from 1 to 12 (or the short name of the month)
dayofweek: any integer from 0 to 7 where 0 or 7 represents Sunday (or the short name of the week such as sun, mon, and so on)
command: the command to execute

You can also use * as the wildcard to represent all possible combinations. Some examples:

Reboot the machine at 5am on February 7th
0 5 7 2 * /sbin/init 6

Reboot on Mondays at 7:30pm
30 19 * * 1 /sbin/init 6
OR
30 19 * * mon /sbin/init 6

Reboot every hour on the hour
0 * * * * /sbin/init 6

For more information and a more detailed explanation, check out this page.

Thursday, October 16, 2008

Microsoft Diagnostics winmsd command in Vista

For those of you used to going to Start->Run and typing in winmsd to get to the Microsoft Diagnostics application, you may have had a little surprise the first time you tried it in Windows Vista. That's because the command has been changed. The new command in msinfo32, which you can use just the same as you had done with winmsd, allowing you to get to the Microsoft Diagnostics within Windows Vista.

Wednesday, October 15, 2008

Illustrator CS3 printing issue, status bar slow or frozen

I manage ~20 Mac designers, and we're mixed with Intel and PPC machines. They're all running CS3 now, and we recently updated our printer drivers due to some color issues. Things seemed to be ok, but then two of the users on Intel Macs started reporting that every time they printed from Illustrator CS3, the printer would kick out the actual document fine, but that Illustrator would be stuck with a print status bar on the screen and they would have to force quit. If they waited 15-20 minutes it would go away, but they can't wait that long between printing or using Illustrator. If you're running into the same type of problem, I may have a solution for you. I found it in the Adobe forums, and it is definitely not something I would have though of myself. Enable hiding of the dock. That's it. I did it on the machines that were having problems and they started printing fine without the delay. The users in the forum think that there's a problem with the print status bar that now appears under the Illustrator icon in the dock when you print, and that by hiding the dock it doesn't show that icon, which in turn means it doesn't have to do anything with the icon's print status. I was actually pretty amazed that something so minor could cause such problems, and be fixed with such an seemingly unrelated setting. The users I have are all running OS X 10.4.11, printing to a Xerox DocuColor 240 with a Fiery rip. Printing to other printers caused the same problem though, so it was printer independent.

If you were pulling your hair out trying to find a solution to this problem, hopefully this works for you. If you want to read the original post in the Adobe Forums, you can find it here.

Tuesday, October 14, 2008

Adobe Photoshop for free?

Ok, not really. Sorry if you feel misled. However, what I do have is a free, open-source Photoshop alternative that you can download and use as you with. It's called GIMP (GNU Image Manipulation Program) and you can find it at www.gimp.org. I've used it some, and almost anything I can remember reading about it was positive, so give it a try if you're looking for some type of image manipulation program.

How to delete an iPhone 3G application

First of all, you need to go to the main screen on the iPhone where you get your list of icons. Hold your finger on the application icon you want to remove, and after a few seconds all of your icons will start shaking. This means that they're in delete mode. Simply press the icon of the application you want to remove and confirm the removal.

Now that it's off your phone, you'll also want to remove it from your iTunes library. If you leave it in iTunes then it will be reinstalled on your phone every time you synchronize, which I'm going to guess you don't want since you're here looking for instructions on how to uninstall the application. Just go into iTunes, then Applications, find the one you no longer want and delete it

Monday, October 13, 2008

Using C# FileUpload in Visual Studio 2005

I can usually find the right item to use, but not always the correct syntax to use it. I did find the C# syntax for the FileUpload tool pretty quickly though, and thought I'd share.

if (Image1Upload.HasFile)
{
try
{

//change label to show upload starting
statusLbl.Text = "Uploading File " + Image1Upload.FileName;

//get current working directory on server and store as currentPath
String currentPath = Server.MapPath(".")
//create new path by combining current path and upload file name
String uploadPath = Path.Combine(currentPath, Image1Upload.FileName);
//upload file to your desired upload path
Image1Upload.SaveAs(uploadPath);

//change label to show successful upload
statusLbl.Text = "File Successfully Uploaded";
}
catch
{
statusLbl.Text = "Unable to save the file";
}
}
else
{
statusLbl.Text = "You have to select a file to upload";
}


This has two dependencies, which are a FileUpload named Image1Upload, and a Label named statusLbl. Image1Upload is what's actually used for the file, while statusLbl is optional and is just used to display the status to the end user so they know whether the upload worked or not. You can also add folders to the currentPath variable in order to put the uploaded file elsewhere, for example:

//put the file in a folder called images
String currentPath = Server.MapPath(".") + "\\images\\";

You need to use double backslashes because it's the escape character. Also, in order to use the Path.Combine() command, you must include using System.IO; in your project.

The original post, along with VB instructions too, can be found here.

Track Windows Terminal Server users' logon and logoff usage

If you've ever been asked if you can track a user's usage from home, this may be useful. That is assuming that you have your remote users coming in to your system via some type of terminal services login. If you do, you can use simple batch files and group policy to log your user usage.

Create a login.cmd file with the following:

echo logon %username% %computername% %date% %time% >> \\server\folder\audit_logs\%username%.log

That will create a log file in the shared folder location \\server\folder with the given person's username, along with the computer they used to login and the date/time of their access.

You'll also want to create a logoff.cmd file:

echo logoff %username% %computername% %date% %time% >> \\server\folder\audit_logs\%username%.log

This will append a line to the existing log file for that user, with logoff in the beginning rather than logon. That will allow you to distinguish between logons and logoffs.

Keep in mind that the users you want to monitor will need to have write access to the folder where the logs are stored as their accounts will be the ones actually making the changes to the files. You can enable these files through Active Directory group policy. In your group policy, go to User Configuration-> Windows Settings-> Scripts (Logon/Logoff) and then set each to run at the appropriate time.