macros

How can I mix optional keyword arguments with the & rest stuff?

I have a macro that takes a body: (defmacro blah [& body] (dostuffwithbody)) But I'd like to add an optional keyword argument to it as well, so when called it could look like either of these: (blah :specialthingy 0 body morebody lotsofbody) (blah body morebody lotsofboy) How can I do that? Note that I'm using Clojure 1.2, so I'm al...

Outlook 2007 Script that sends new form email when a message is dragged and dropped into a folder

Is it possible to write a script that will allow Outlook to automatically send out a new email to a distribution list when you drag and drop and previously opened email into a specified folder? The rules only let you apply them to received and sent messages. They do not allow you to apply it to anything that is dragged and dropped after...

Macro to alert me when a cell changes value -- popup alert - EXCEL

Hey gurus, I am looking to create a macro to alert me when a cell's value changes. The cells in this particular column can have values of either "OVER" or "UNDER". I would like to write code to alert me via a popup (Message: "Cell A crosses under(over)") when the value changes. Thanks, patrick ...

Visual Studio (2010): Is there a shortcut key to toggle all open tool windows?

Is there a way to hide/show all open tool windows in Visual Studio 2010? I'm aware that I can use Shift+Alt+F10 to go into full screen mode, but that doesn't help me much. I'm interested primarily because I'm data copying from PDF tables to an XML document using Windows 7's Win+/ side-by-side windows feature (which is why full screen ...

bitfield mask calculation macro

We have a set of C macros, here, for using the preprocessor to do bitfield operations, and we run into warnings when attempting to use these macros in visual studio. The problem can be demonstrated very easily: #define BITFIELD_WIDTHMASK(Width) \ ((Width) >= 32 ? ~0x0ul : (1ul << (Width)) - 1) unsigned long foo(void) { return ...

How to open a document in a VS2008 macro?

I recorded a temporary macro in VS2008, in order to find out how to open a particular document so I can then edit it. Unfortunately, the macro doesn't work when run. I am guessing that this is because the macro works with the DTE.ActiveWindow object, and when I recorded the macro this is different than when the macro is re-run. When r...

VBA - Prevent Excel 2007 from showing a defined names message box?

I am working on a Excel 2007 workbook that will contain a macro to save the current sheet (a template) as a PDF file (no problem) a Excel 97-2003 file (problem) When saving the Excel file a messagebox appears asking about "Defined names of formulas in this workbook may display different values when they are recalculated...Do you wa...

Setting "Picture Position" in Word 2007 Macro?

I've got a macro to past an image from the clipboard, resize it, and set the Text wrapping to TopBottom. However, I still need to be able to modify the alignment properties as you can on the "Picture Position" tab of the "Advanced Layout" dialog (you can get to that dialog if you select the picture, right click, choose "Text Wrapping" -...

How do I use macros for the command line arguments for debugging a .NET project?

In the Visual Studio Debug property page (for a .NET 4 project) I want to be able to specify macros, e.g. $(OutDir), like I can in the Build Events. But it doesn't work, the macros aren't replaced. Is it just not supported? Is there a work around? ...

Visual Studio 2010 Macro - Reporting Progress

I have just discovered macros in Visual Studio and I can't be happier. Well... I have my complaints but... you know ;) A few of my macros are taking quite a while to complete and I am looking for a way to track progress. I build a log file during most of my macro processes but I have not found a good way to report progress without paus...

Change case of argument provided to C preprocessor macro

I'm fairly new to the C preprocessor. Is it possible to change the case of an argument provided to a function-like #define? For example, I want to write test(size) and then involve "Size" in the resulting replacement. ...

open word template and run autonew from c#

Hi I can open a .dot template from a hyperlink fine, but it opens read-only and does not run the autonew macro. Is there a setting or something obvious Im missing? thanks DD ...

Modifiers in Makefile rule's dependency list

The problem is fairly simple. I am trying to write a rule, that given the name of the required file will be able to tailor its dependencies. Let's say I have two programs: calc_foo and calc_bar and they generate a file with output dependent on the parameter. My target would have a name 'target_*_*'; for example, 'target_foo_1' would be...

define macro in C won't work

I'm trying to make a macro in C that can tell if a char is a hex number ( 0-9 a-z A-Z) #define _hex(x) (((x) >= "0" && (x) <= "9" )||( (x) >= "a" && (x) <= "z") || ((x) >= "A" && (x) <= "Z") ? "true" : "false") This what I've come up with but it won't work with a loop like this char a; for(a = "a" ; a < "z";a++){ printf...

running excel macro from another workbook

I have a macro that is on a server. I need to be able to run it from different workstations that connect to this server. Currently I am doing: Application.Run ("L:\database\lcmsmacro\macro1.xlsm!macro_name") The error message I am getting is "The macro may not be available in this workbook #1004" I have already made sure that my se...

Excel Macros - Too many line continuations

Hi, I have a "large" sql query (like 200 lines)... dim query as string query = "..................................." & _ "..................................." & _ .... Like a lot lines later... "..................................." function query,"sheet 1" When i do this, excel says "Too many line continuat...

why should i use single quotes for application.run in excel?

i have this: Application.Run ("'L:\database\lcmsmacro\macro1.xlsm'!macro_name") why should i use the single quotes? does it not recognize the backslash? ...

10 users need to be able to run the same macro in excel

i have a server where resides an excel macro there will be about 10 users on 10 different workstations that will need to run that macro on their own worksheets. how do i run the macro from a centralized location by multiple users who want to run it on their own worksheets? the reason i need it centralized is because the macro will nee...

creating an excel add-in

can someone please get me started on the following: i would like to package an excel macro as an add-in to excel. the macro will reside on a central computer, where 10 other computers will connect to. how do i create an add-in that will be constantly updated ? ...

running a macro from an add-in

i have an add-in called book1. inside the addin there is a module called module1 which has a sub called addin1 i would like to run the macro addin1 from a different workbook i am trying to call this macro like this: Call Addin1 but that's not working and i tried: Call book1.xlam.Module1.AddIn1 which is not working either does a...