Posted by

Comments

# re: Quickly send files to Notepad

Monday, April 10, 2006 2:04 PM by vbullinger

Awesome.  I often find myself cracking open NotePad and dragging a file into an untitled document, which was easy enough.  But this makes it that much easier and I'll be doing this from now on.  Make sure you don't type a space in "SendTo" like I did my first time.  That directory doesn't exist ;)

# re: Quickly send files to Notepad

Tuesday, April 11, 2006 8:22 AM by mhodnick

Thanks for the correction on the "SendTo" folder name.  I'll correct it in the post.

# re: I've lost control of my wallpaper

Wednesday, May 17, 2006 12:09 PM by mhodnick

Since that image probably originated from my personal website, Jake suggested I check my raw website logs to see what IP accessed it.  Unfortunately, my web host deletes logs every Sunday and the image on our domain controller was created before the last set of logs was deleted.  It was a good idea Jake!

# re: I've lost control of my wallpaper

Wednesday, May 17, 2006 1:48 PM by jgood

heh, we tried...

# re: A comment on interviewing

Wednesday, May 31, 2006 3:38 PM by vbullinger

I'll remember to make lots of Office Space references if I'm ever interviewed by you ;)

# re: A comment on interviewing

Thursday, June 01, 2006 6:59 PM by Avonelle Lovhaug

It has been a long time since I interviewed people, but I used to always ask candidates if they had any questions for me, and they almost always said "no". I didn't look very favorably on this - especially since I typically was conducting the technical interview, and their time with me was their best opportunity to find out what it was really like to work at our company. Candidates who could actually ask me thoughtful questions scored much higher marks with me than those who said "uh, no thanks".

Your question is good, and I agree that candidates should be better prepared for it!

# re: A comment on interviewing

Tuesday, June 06, 2006 7:14 AM by mhodnick

Avonelle - I too am surprised when candidates do not ask questions of me.  Before I let them go I always ask if they have any questions, and it's astounding how many people say "no".  When I interviewed for my current job I had a whole list of questions prepared that I wanted to ask!  Candidates better have a few questions to ask when they're about to change their career direction and switch jobs.

# re: A comment on interviewing

Tuesday, June 06, 2006 8:09 AM by jgood

When I was interviewing I like listening to what they have to say about their passions... so I always ask about their favorite classes, favorite things about development, favorite projects.

I love working with passionate people...

# re: See Windows Vista

Tuesday, June 06, 2006 10:44 AM by rmitchell

If you don't click on something right away Tom gets kind of impatient.  Kind of funny...

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Monday, July 31, 2006 2:35 PM by Jerry Meek

Worked perfectly. In fact, I simply used the detect and repair option and Hodnick's suggestion worked. THANK YOU!

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Tuesday, August 01, 2006 8:17 AM by rey

Thank you very much for the clear and great help! it works perfect

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Tuesday, August 01, 2006 9:17 PM by DW

Cool - worked perfectly thanks

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Wednesday, August 02, 2006 1:08 PM by Ben

Mike, you are THE Office STUD!!!  Can't thank you enough....

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Thursday, August 03, 2006 2:43 AM by TheWire

Alternatively, go to C:\Program Files\Common Files\System\MSMAPI\1033 and delete MSMAPI32.dll and restart Outlook. It will automatically reinstall the file for you without needing to run the Office setup.

You just got Wired!

(c) The Wire.

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Thursday, August 03, 2006 10:38 AM by Kyle

Much more help than the "fixmapi.exe" from Microsoft.  Works like a charm -- thanks man.

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Thursday, August 03, 2006 10:56 PM by Francis


Thank you, thank you thank you...for the tip on solving the MAPI32.dll wrong version error after uninstalling Office 2007 .

I had my brains burnt for one week when I could not get into my Outlook at the office, despite following Microsoft's advice to keep on reinstalling outlook.

It fixed my problem IMMEDIATELY.

You saved my life, cyberspace speaking.

# re: I like pair programming, just not with you (know your text editor)

Friday, August 04, 2006 12:14 PM by mhodnick

A friend suggested to me that pair programming can also be a problem when a) the other developer smells and b) the other developer is stupid.

# re: I like pair programming, just not with you (know your text editor)

Friday, August 04, 2006 2:03 PM by bvandervoort

One I find myself using a lot after I found out about it is Ctrl backspace/delete.  It will delete backward/forward to the beginning/end of the word.  So if you have let's say  someObject.somelongwordMethod(), get the cursor in front of the M, hit ctrl backspace, and somelongword is gone.  Much faster than using the mouse to try to highlight what you want to delete.

One that bugs me is when people don't realize shift-tab will go backwards through a tab order.

# re: I like pair programming, just not with you (know your text editor)

Monday, August 07, 2006 3:47 PM by vbullinger

A couple I like:

Alt + Tab: switch applications (code to IE, for example).  I use this all the time.  Then you don't have to scroll your mouse down to the bottom of the screen to switch applications.

In VS:
Ctrl + Space: pull up Intellisense
Shift + Alt + F10 (2005 only): insert a "using" statement when you haven't included something that is required or to create a method stub for a method you just typed that isn't defined.  I.e., you type "bool printed = PrintSomething(int numChars, String stringToPrint);" and you'll see a red mark underlining the last character in what you just typed, indicating that it didn't recognize that method, but is ready to create the stub for you if you press shift + alt + F10.  If you do press that, you'll get a little drop-down.  Press the "generate method stub" option and it will just plop down what is needed.  In this case, it knows that you're setting a boolean to the return value of this method that it's writing the method stub for, so it will know to declare it as "private boolean PrintSomething."  It also knows that you are sending it an integer and a String, in that order, so it will put that in the method declaration, as well.  I.e. "private boolean PrintSomething(int blah, String blah)."  It usually picks odd names for the parameters, though.  It will then put the squiggly brackets - { } - and put one line in the method... which is basically a line that throws an exception saying that the method is not defined.  Can be a decent time saver.  And you won't have to scroll up to put "using System.IO;" at the top if you realize you need to use the FileInfo object or something.

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Tuesday, August 08, 2006 5:40 PM by mike

Thanks for posting this, much apprecaited

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Wednesday, August 09, 2006 6:10 AM by Tom

Dispared to Repaired.  You are the Man!  Deleted MSMAPI32.DLL and the thing fixed itself.  Thanks a million!

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Thursday, August 10, 2006 10:56 PM by Cameron

That was pure genius :)

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Sunday, August 13, 2006 4:14 AM by John

Mike and The Wired... you are FREAKIN' AWESOME! I spent hours on this after uninstalling the 2007 beta and trying to reinstall my old Office 2003 to no avail until I deleted that file (it is now 4am.. time for sleep..).

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Sunday, August 13, 2006 11:45 AM by Alex

Thank you! You're solution actually worked; Microsoft's was completely useless. I just deleted MAPI32.DLL and Office opened immediately.

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Sunday, August 13, 2006 11:38 PM by Robert Gordon

I renamed the MSMAPI32.dll then ran FIXMAPI.EXE from the c:\windows\system32 folder and it fixed this error.

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Monday, August 14, 2006 6:24 PM by Warren

It worked as stated. Fixed Outlook 2003 after having Beta 2007 installed. I wish I could say thank you MIcrosoft...but I can't. Thank you Mike!

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Monday, August 14, 2006 9:19 PM by Backus

Thanks very much.  You just cured a major headache.

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Tuesday, August 15, 2006 9:08 AM by JPI

Can somebody help? My problem is that suddently, one morning, when I tried opening outlook, it shutted dowm immediately. The error report mentionned masmapi32.dll. No way I can keep it opem more thasn a few seconds before it shuts down. Should I delete this file s said abocvve nd reinstall?

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Tuesday, August 15, 2006 11:27 AM by Jamie Lewis

PHEWWW!  MIKE I OWE YOU A BEER MAN!  CHEERS

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Tuesday, August 15, 2006 2:10 PM by Dmitry Grinberg

Great article !
It work and solve the problem of Outlook 2007 and Outlook 2003 coexistance !
10X!

# re: Texture Coordinates and Visuals on 3D surfaces

Wednesday, August 16, 2006 9:08 AM by dreckgos

the visuals drawn canot have events attached can they? i mean... If you put a list on 3d object like this, you won't be able to select items; am I right?

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Wednesday, August 16, 2006 4:21 PM by Richard S

You star!
Better than Microsoft's technical support. Fixed my issue too after installing Off.2007.Beta2

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Thursday, August 17, 2006 9:02 PM by mt

Works perfect :)

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Friday, August 18, 2006 4:12 AM by Allyson

Thank you thank you thank you!!!!!!!! (hugs and kisses)

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Sunday, August 20, 2006 8:54 PM by Jerry

tytyty!!!

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Thursday, August 24, 2006 3:20 PM by ryan

Mike, can't thank you enough.  Do you take paypal? :)

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Saturday, August 26, 2006 3:38 AM by Boris

Thank you! I"ve spent a lot of time to find a proper solution. Where are idiots from Microsoft to help. Microsoft has a stupid old proposal to find.... and replace mapi32.dll in system dir, that dose not work in our situation reinstalling Office 2003 after Office 2007 beta.

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Sunday, August 27, 2006 2:16 AM by Carlos

THANKS A MILLION!!

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Monday, August 28, 2006 9:18 AM by John C

Thank You Mike!

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Monday, August 28, 2006 6:08 PM by Ken S

Thanks!  Fixed my problem....

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Thursday, August 31, 2006 3:43 PM by Jonah

thanks for the fix. It worked perfectly. Many thanks!

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Sunday, September 03, 2006 10:59 PM by bRAD

yES ! fINALLY....WHY DOES MICROSOFT GIVE US THE WRONG INFO !!!!!! ##@$#%^

# re: I've lost control of my wallpaper

Wednesday, September 06, 2006 7:05 AM by free ringtones

<a href='http://www.yahoo.com'></a> http://www.ringtones-dir.com/download/">http://www.ringtones-dir.com/download/ <a href='http://www.ringtones-dir.com'>download ringtones</a>. <a href="http://www.ringtones-dir.com ">nokia ringtones</a>: Best free samsung ringtones, Cingular ringtones and more, Ringtones for free. [url]http://www.ringtones-dir.com/free/[/url] [link=http://www.ringtones-dir.com]ring tones[/link] From site .

# re: I've lost control of my wallpaper

Wednesday, September 06, 2006 7:05 AM by ringtones free

http://www.ringtones-dir.com/get/ ringtones site free. Best free samsung ringtones, Cingular ringtones and more, Ringtones for free. From website .

# re: I've lost control of my wallpaper

Wednesday, September 06, 2006 7:05 AM by tyoz966@lycos.com

funny ringtones

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Thursday, September 07, 2006 1:32 PM by Gareth

Sharp fellas, worked like a charm!!!!!

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Thursday, September 07, 2006 1:59 PM by Michael

Thank u so much - yes all that you need to do is rename the file - but u don't need to reinstall it - just try opening it again and it will work!!!!

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Wednesday, September 13, 2006 4:16 PM by Monty

Great Job, Headache gone, well done mike

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Friday, September 15, 2006 1:37 AM by Richard

Great - worked a treat - thank you.

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Saturday, September 16, 2006 3:23 PM by Yama Kamyar

I did the following after uninstalling OL2007 I reinstalled OL2003. Then I went to Windows/System32 folder and renamed MAPI32.dll to MAPI_OLD.dll then in that same folder there is an executable called FIXMAPI.exe. I run the executable by double-clicking on it. Then I restarted WinXP Pro.

Fixed the problems.

Hope this helps...

Yama

# re: Create zip/compressed folders with Powershell

Monday, September 18, 2006 3:21 PM by Karsten Januszewski

Hmm, the first sample, where you ls, only seems to grab the first file and doesn't walk each file.  Any ideas?

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Monday, September 25, 2006 2:17 AM by Joe

THanks - worked perfectly

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Friday, September 29, 2006 3:55 AM by Badger

Brilliant

Thanks

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Monday, October 02, 2006 9:15 PM by henry

when u open the mapi_old.dll it says something about how this helps run the operating system. It asks u  if you want to continue and if u do u open it with..... What do u open it with? And also what do you mean when u say that u restarted WinXP Pro.

# re: VS .Net Solution Size and ReSharper

Tuesday, October 03, 2006 8:45 AM by Vince Bullinger

That was a very poor design decision by ReSharper.  There's no way that they wouldn't have thought of that.  They're assuming that they're application is more important than intellisense... I doubt anyone would agree with them.

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Tuesday, October 03, 2006 10:59 PM by Dee

YOU ARE A GOD!!!

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Thursday, October 05, 2006 1:04 PM by Justin

Thank You Sooooooooooooooo Much!

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Wednesday, October 11, 2006 8:16 PM by Peter

Fantastic. The trick worked for me too. Just had to rename the file, as it didn't allow me to delete it - really great.

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Tuesday, October 17, 2006 12:02 PM by sogal

THANKS THANKS THANKS
i had to uninstall 2007 beta - HORRIBLE hated it slow as molasses and
well nevermind

so i needed to reinstall 2003 - and get to my emails - i had been using thunderbird - but miss my outlook - so now i am set to go

thanks again!

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Sunday, October 22, 2006 1:41 PM by Shefaet

Just use Outlook for syncing my Gmail contacts with my PDA, but was annoyed to get the same error.

Worked like a charm, thanks!

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Monday, October 23, 2006 3:47 PM by Dave

Mike - you saved my ass.  Thanks!

# re: I like pair programming, just not with you (know your text editor)

Wednesday, October 25, 2006 3:26 PM by Tim

This may not be a keyboard shortcut, but it's helpful nonetheless, and apparently not that realized since most people here don't know about it.  If you want to open a file rather than relying on the editor's open dialog if you have the folder open in Explorer, just start dragging the icon for it, alt-tab to the editor, and drop it in the editor.  I normally keep Explorer open and navigate my files with it so it's usually open to whatever project I'm working on.  It's way faster to just drag and drop than deal with the open dialog.  Plus, I did this while some people were watching me solve some problem and they were like, "How'd you open that file so fast!"  Yes, you can double-click a file too in Explorer, but depending on your file associatons the file may not open in the program you want.

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Friday, October 27, 2006 8:59 PM by Nick

Thanks I wish I would have found this earlier on this week.

YOU ROCK

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Monday, October 30, 2006 4:13 PM by Ian

Sweet- four hours of my life wasted until I found this- nice one!

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Thursday, November 02, 2006 8:06 AM by Simon

Mike,
Can't thank you enough. Have wasted hours on this problem!

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Friday, November 03, 2006 2:54 PM by Alan S

What a star - thanks. Cured my problem after 3 hours wasted re-installing everything.

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Friday, November 03, 2006 6:44 PM by GregL

Wish it were this easy for me (I would have been done one day ago).  Like others, I have tried uninstalling/reinstalling Outlook 2003, renaming MSMAPI32.dll, run Fixmapi.exe, uninstalling Outlook 2003, then installing Outlook 2007 (after all the foregoing), then get error OLMAPI32.dll.  I believe the problem is somehow related to Microsoft Office Document Image Writer.  When I tried to do a restore I noted that "Printer Driver Microsoft Office Document Image Writer Installed" (MODIW) at a time about 7 minutes after the time my Outlook.ost and Personal.pst files were last updated.  Outlook stopped working shortly thereafter.  I have uninstalled MODIW several times but it keeps coming back.

None of the suggestions to run Installer Cleanup Utility, Custom Maintenance Wizard, Removal Wizard and other MS Office Resource Tools have had any effect.
It is obvious that getting completely rid of Outlook (either version) for a clean reinstallation is impossible.  Any suggestions to the contrary are welcome.

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Tuesday, November 07, 2006 12:17 AM by D C WIENS

Thanks for the tip!   Outlook 2003 stopped working after I uninstalled Thunderbird 1.5.  Renamed the .dll file, restarted Outlook, and it fixed itself.  You guys saved me lots of time.

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Sunday, November 12, 2006 2:19 AM by Rob Bell

Thanks and thanks again.

I spent 4 days trying to fix this and every query led me to try and fix mapi32.dll which was obviously the wrong approach. Like you I found 2007 wanting hence my reason to uninstall.

What is it with MS that they get a simple thing like giving the wrong message wrong!

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Sunday, November 12, 2006 6:47 AM by Alec McNaughton

I fixed the problem by deleting all versions of mapi32.dll files except the following:
C:\i386/mapi32.dll   110KB 8/4/2004
C:\Windows\System32\mapi32.dll  110 KB 8/4/2004
C:\Program Files\Microsoft Office\Office12\OLMAPI32.DLL 2,916 KB 8/24/2006
C:\Program Files\Common Files\System\MSMAPI\1033\MSMAPI32.DLL 49 KB 8/24/2006
Note: these dlls are on the technical refresh to Office 2007

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Wednesday, November 15, 2006 8:57 AM by Dan Swayze

I can access Outlook now, but not reply or send messages. Did anyone else have this problem?

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Friday, November 17, 2006 1:37 PM by R3M!X

Hello living beings out there,

I had the exact same problem described above but thanks to my pal Mike here, in one day i solved it ! I'm so gratefull that i'd like to add something to Mike's tutorial that really can save precious time:

....
The actual dll that is causing the problem is MSMAPI32.dll, which is located at C:\Program Files\Common Files\System\MSMAPI\1033. Simply rename this file to something else (e.g. MSMAPI32_OLD.dll), ...
••• AND TRY TO OPEN OUTLOOK WITH UR CD IN THE DRIVE OR YOUR ISO MOUNTED !  This will avoid reinstallation and will just replace the dll  (ó.Ò,')  so no more of the following: •••
reinstall Office 2003, and...
••• But only: •••
Outlook 2003 should work perfectly after that.....

It works perfectly! Goodluck to you all & greetz from Brussels (capitol of Belgium)  ;-)

Cya,
R3M!X

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Saturday, November 18, 2006 1:53 PM by Alf

Shame on the MS guys for giving out such a crap error message. Good tip, saved a lot of frustration. Thanks!

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Monday, November 27, 2006 11:34 AM by Tom V.

Many thanks to you, Mike, for this brilliant, but alas, so simple a solution.
So much frustration involved, and just confusing suggestions from Microsoft.

(Just curious: How did you find the solution?)

Best regards
TomV.

# re: MAPI32.dll wrong version error after uninstalling Office 2007

Wednesday, November 29, 2006 5:08 AM by Rajeev Gautam

Thanks Man, You are rocking. The solution was awesome. i spent 6 hours on this. But simply by renaming the file MSMapi.dll solves the problem.



Thanks a lot

# PowerShell: Zip up a folder and email it

Wednesday, November 29, 2006 11:49 AM by Mike Hodnick

Here's a quick little PowerShell script you can use in conjunction with Out-Zip to zip up a folder on...

# PowerShell News and Examples HQ &raquo; Blog Archive &raquo; Create zip/compressed folders with Powershell

# PowerShell News and Examples HQ &raquo; Blog Archive &raquo; Zip up a folder and email it

# re: PowerShell: Zip up a folder and email it

Tuesday, December 26, 2006 8:13 AM by Rich Whiting

Mike,

Are you sure your zip-email script works?  I have added it to my profile as follows (where <???> represents my company server, hidden here for privacy/security reasons):

function test-it {
$sender = rwhiting@<mycompanyserver>.com
$recipient = rwhiting@<mycompanyserver>.com
$server = exchange2.<mycompanyserver>.com
$targetFolder = c:\MyFolder
$file = c:\MyZipFile.zip

if ( [System.IO.File]::Exists($file) ) {
 remove-item -force $file
}

gi $targetFolder | out-zip $file $_
$subject = "Sending a File " + [System.DateTime]::Now
$body = "I'm sending a file!"
$msg = new-object System.Net.Mail.MailMessage $sender, $recipient, $subject, $body
$attachment = new-object System.Net.Mail.Attachment $file
$msg.Attachments.Add($attachment)
$client = new-object System.Net.Mail.SmtpClient $server
$client.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials
$client.Send($msg)
}

function out-zip {
$path = $args[0]
$files = $input

if (-not $path.EndsWith('.zip')) {$path += '.zip'}

if (-not (test-path $path)) {
 set-content $path ("PK" + [char]5 + [char]6 + ("$([char]0)" * 18))
}

$zipfile = (new-object -com shell.application).NameSpace($path)
$files | foreach {$zipfile.CopyHere($_.fullname) }
}

When I execute "test-it" within PowerShell 1.0, I get a series of error messages:


"The term 'rwhiting@<myserver>.com' is not recognized as a cmdlet, function, operable program, or script file. Verify the term and try again."

I get a similar message for "exchange2.<myserver>.com", "rwhiting@<myserver>.com", "MyFolder", and "c:\MyZipFile.zip".

And also (among others): "New-Object: Constructor not found. Cannot find an appropriate constructor for type System.Net.Mail.Attachment."

Am I doing something wrong, even though I basically cut-and-pasted the script?

# re: PowerShell: Zip up a folder and email it

Tuesday, December 26, 2006 8:47 AM by Rich Whiting

Update on above question ...

When I add quotes around each of the literal string values:

    $sender =" rwhiting@<mycompanyserver>.com"
    $recipient =" rwhiting@<mycompanyserver>.com"
    $server =" exchange2.<mycompanyserver>.com"
    $targetFolder = "c:\MyFolder"
    $file =" c:\MyZipFile.zip"

I get fewer error messages, but still this one:

    New-Object: Exception calling ".ctor" with "1" argument(s): "Could not find file 'c:\MyZipFile.zip'."

even though the file DOES exist. Why can't PowerShell see it?

# re: PowerShell: Zip up a folder and email it

Tuesday, December 26, 2006 10:18 AM by Rich Whiting

Further update ...

I had to change this line:

    $client.Credentials = new-object system.net.networkcredential("rwhiting","<mypassword>")

Now the script works fine when I enter it INTERACTIVELY, LINE-BY-LINE in PowerShell. But when I execute it AS A FUNCTION, it still does NOT work, but returns the same old error:

    New-Object: Exception calling ".ctor" with "1" argument(s): "Could not find file 'c:\MyZipFile.zip'."

Why does this script work when entered line-by-line interactively in PowerShell, but NOT when run as a function? What am I missing?

Thanks,

# re: PowerShell: Zip up a folder and email it

Tuesday, December 26, 2006 1:27 PM by Rich Whiting

Solution ...

Okay, I figured it out. The line correction is:

    [System.Net.Mail.Attachment] $attachment = new-object System.Net.Mail.Attachment $file

It is necessary to cast the $attachment variable to type System.Net.Mail.Attachment, since new-object (in this instance) returns a REFERENCE to an object of that type, not an ACTUAL OBJECT of the type. But $msg.Attachments.Add($attachment) requires an actual object. Hence the need for the cast.

# re: PowerShell: Zip up a folder and email it

Thursday, December 28, 2006 8:12 AM by mhodnick

heh, glad you figured it out Rich.  Sorry I wasn't able to respond over the holidays.  

# re: VS .Net Solution Size and ReSharper

Tuesday, February 13, 2007 10:25 AM by gestibar

nice :)
;))

# re: ASP .Net Caching API Tips

Tuesday, February 13, 2007 4:52 PM by Jason

Very Helpful!!

Cache.Insert("Customer" + customer.CustomerID.ToString(), customerValue);

makes so much sense.

# re: Texture Coordinates and Visuals on 3D surfaces

Wednesday, March 07, 2007 12:38 PM by Kurt

This looks like a great way to add special effects such as zooming, lighting, and tilting to a 2D game. However, as dreckgos points out, it would only work if the game doesn't require point-and-click type stuff on the game board (e.g, it uses the keyboard or relies on a different panel to host the interactive controls).

There is a workaround that I found, however, from the WPF team: http://blogs.msdn.com/wpf3d/archive/2006/12/12/interacting-with-2d-on-3d-in-wpf.aspx

# WPF 3D - Blender Helps You Getting Productive

Monday, April 16, 2007 11:12 AM by Come Get Some...Thoughts On Software Technology

The last few days I played around with the 3d capabilities of the Windows Presentation Foundation (WPF).

# re: Texture Coordinates and Visuals on 3D surfaces

Monday, April 16, 2007 3:25 PM by mhodnick

The 3DTools components will take care of being able to interact with 2D visuals on 3D:

http://www.codeplex.com/3DTools

# PowerShell: Zip up a folder and email it

Thursday, May 31, 2007 8:42 AM by Mike Hodnick

Here's a quick little PowerShell script you can use in conjunction with Out-Zip to zip up a folder on

# PowerShell Script: Zip up a folder and email it at ps&gt; get-content

# PowerShell Script: Zip up a folder and email it at ps&gt; get-content

# WPF 3D: Google maps on a sphere, or &#8216;The World&#8217; &laquo; Hungry for Knowledge

Pingback from  WPF 3D: Google maps on a sphere, or &#8216;The World&#8217; &laquo; Hungry for Knowledge