Showing posts with label Office. Show all posts
Showing posts with label Office. Show all posts

Tuesday, August 12, 2008

Favorite Shortcut Keys

Like most developers, I make extensive use of shortcut keys. However, I seem to only have the mental capacity to remember 20-30 at one time. So, I have a tendency switch them in and out of my regular rotation depending upon what type of project I am working on. Here are the ones that I get the most use out of:

Visual Studio
(Note: some of these are different dependent upon your installation settings)
Control + g : Goto line number
Shift + Alt + Enter : Toggle full screen mode
Control + Space : Launch intellisense
Tab : Accept intellisense selection
F5 : Start debugging
F6 : Build
F10 : Step Over
F11 : Step Into

Windows
Windows Key + f : Search for documents
Windows Key + r : Run
Windows Key + m : Show the desktop (minimize all applications)
Alt + Tab : Toggle between applications

Most applications
Control + s : Save
Control + c : Copy
Control + v : Paste
Control + z : Undo
Control + n : New document
Control + x : Cut
Control + a : Select all
Control + h : Replace
Control + f : Find
Control + Tab - Toggle between documents

Tuesday, August 5, 2008

Accessing the Office Ribbon from VBA

Yesterday I received this email from a co-worker (who shall remain anonymous):

1. Open an instance of Word 2007 to find the msoId of the button you’d like to press. You can find this by going to Office Button Word Options Customize to view a list of commands which correspond to buttons.

2. Hover over the name of the command and you’ll see a tooltip; for example, the tooltip for the Save command when selected from the “Popular Commands” list says “Popular Commands Save (FileSave)”. The part in parentheses is the msoId. (Note: You may have to select the name of a tab in the “Choose commands from:” list box to find the button you’re looking for.)

3. In your code, call Word.Application.CommandBars.ExecuteMso with the msoId and you can invoke the button.

Note: The steps above also apply to Excel.

Code Example to demonstrate how to press FileSave in Word 2007

[VBA]
Sub PressThisRibbonBarButton()
On Error Resume Next
If Word.Application.Documents.Count = 0 Then Exit Sub
' Press the Save button Word.Application.CommandBars.ExecuteMso "FileSave"
End Sub


I haven’t worked with the Office 2007 API yet, but I thought this seemed like a good tip that was worth posting here. However, today I was researching something else, and discovered a post on the Interwoven Devnet forums by someone named jny. It looks like the previously mentioned co-worker was trying to pull a fast one, and borrow jny’s post. Anyway, I still thought this was helpful, so thanks to jny from the Interwoven forums for the helpful tip.

Tuesday, June 3, 2008

Disabling Word as Outlook's email editor

By default, Microsoft Outlook uses Word to edit email messages. This is a nice feature because it offers enhanced editing capabilities over the basic email editor. However, if you are using an under-powered machine like I had at my last employer, you really want to cut down on memory usage and don’t want Word running just so you can send a quick email. When this is the case, you can stop Outlook from using Word to edit emails, by opening Tools -> Options, clicking the “Mail Format” tab, and deselecting the option “Use Microsoft Office Word 2003 to edit e-mail messages”.

This isn’t a revolutionary tip, but it’s something that I hadn’t thought to look for and would have been very useful when I was stuck on an old machine.

Thursday, May 22, 2008

Saving money on gas

Like a lot of people, I have a lengthy commute to work. As the price of gasoline continues to rise I have been thinking a lot about ways to save money on fuel. My wife and I have been carpooling to work, which means we can drive either her vehicle or mine. Hers is an SUV, and mine is something a little sportier. Mine gets better MPG, but runs on premium so it costs more to fill up. Neither one is cheap to drive, so we have thought about buying a third vehicle to be our work commuter. But, what would be the best option? We have considered buying a new compact, a new hybrid, a used sedan, or possibly buying a used diesel car and converting it to run on waste vegetable oil. Each of these choices has a wide variety of costs involved and offers different benefits. To weigh out the options, I put together an Excel spreadsheet that compares the cost of fuel for each vehicle, and how long it would take to recoup the costs of purchasing another vehicle. I thought spreadsheet might be helpful for others, so it is available for download here.




Just fill in the shaded cells with your vehicle choices, and compare the results. The other cells contain formulas that can be edited if you want to make the calculations based on different assumptions.


There are other expenses to consider such as insurance, and maintenance, but I think this is a good start.