macros

How to call a Macro in Microsoft Word 2003

I need to reinforce the structure of a Microsoft Word document. EG: Style Question here blah blah blah Style Answer Here blah blahblah The enforcement here would be the "Answer" style cannot be placed unless there is a "Question" style above it. To do this I would use a Macro, so ideally I would like to call my Macro everytime the doc...

Beginner at Common Lisp: Macro Question For Defining Packages on the Fly

Still struggling to understand what best practices are with respect to macros. I'm attempting to write a macro which defines packages on the fly. (defmacro def-dynamic-package (name) `(defpackage ,(intern (string-upcase name) "KEYWORD") (:use :common-lisp))) This works fine only for expressions such as: (def-dynamic-package "...

Passing parameter to VBA Macro

I am trying to run a macro when I double click on Visio shapes. I want to pass the shape object to the VBA macro so that I could do something in the macro depending on the id of the Shape object. Is it possible to pass the parameter to VBA macro. If yes, please let me know how? Thanks. ...

Splitting word documents with macros

I have a word document that starts with a table of context. I need to break up the document into sections based on the table of context. The table of context has a section title and section number. How can I use macros to split the document based on the section numbers/ name? ...

Visual Studio: MyMacros won't show up in Tools > Options > Environ. > keyboard

I have a macro that I wrote to just help me with my unit testing (it was derived from other macros that just add underscores to the name of the method as you write it,), and when I go to Tool > Options > Environment > and then keyboard to assign a shortcut to it, it not anywhere to be found, none of the "MyMacros" default section is ther...

Macro/Scripting language for non-developers with a simple GUI-based editor

Hello, We wish to provide people to be able to add some logic to their accounts(say, given a few arguments, how to compute a particular result). So, essentially, this would be tantamount to writing simple business rules with support for conditionals and expressions. However, the challenge is to provide them a simple online editor where ...

Macro Replacement during Code Generation

Presently I have a some legacy code, which generates the op code. If the code has more number of macros then the code generation takes so much of time (In terms of hours!!). I have gone through the logic, they are handling the macro by searching for it and doing a replace of each variable in it some thing like inlining. Is there a way th...

Word macro accessing contents of custom dictionary?

I need to create a way of checking various codes in a Word document. These codes are usually a letter followed by a hyphen and 5 digits, eg M-81406. We need to check that these pre-defined codes have been typed in correctly (there is a pre-determined list of several thousand codes). We cannot use normal Word spell checking as you cannot ...

JEdit Macro - Open and Save File

I have a JEdit (BeanShell) macro which opens a specific file then immediately saves the file to my c:\temp folder (so that I don't accidentally update the real file). Here is the bean shell code: logFilePath = "c:\\temp\\aj.txt"; jEdit.openFile( view , logFilePath ); _buffer = jEdit.getBuffer(logFilePath); _buffer.save(view,"c:\\tem...

Any way to run a macro (in an open VS instance) from the command line?

I typically run a script each night that updates my code from SVN, then builds it. The last few days I have a long debug run I'd like to start at night so it can go through the hour or two it takes to hit the error before I come in the next morning. The way I've done this so far is to VPN in later in the evening to start the run. Is the...

nested preprocessor macro

I would like to do the equivalent of the following: #define print_max(TYPE) \ # ifdef TYPE##_MAX \ printf("%lld\n", TYPE##_MAX); \ # endif print_max(INT); Now the #ifdef or any nested preprocessor directive is not allowed as far as I can see in a function macro. Any ideas? Update: So it seems like this is not possible. Even a...

Post Build Events Customization In Visual Studio

Hi Is there a way to customize the post build event macros, I would like to move the new assembly to a sub folder in the same directory named by the version of the assembly i.e. copy $(TargetDir)$(TargetFileName) $(TargetDir)$(ASSEMBLYVERSION)\$(TargetFileName) However there is no such 'macro'. Sort of building a executable to get ver...

C++ format macro / inline ostringstream

I'm trying to write a macro that would allow me to do something like: FORMAT(a << "b" << c << d), and the result would be a string -- the same as creating an ostringstream, inserting a...d, and returning .str(). Something like: string f(){ ostringstream o; o << a << "b" << c << d; return o.str() } Essentially, FORMAT(a << "b" ...

Is there an eclipse plugin for developing in m4?

Googling has turned up little to nothing. I need to develop some heavy stuff in m4 and I'd love to do it in my favorite environment with all the bells and whistles thereof. There are packages for running m4 on just about every platform, such as windows. So I know at the very least I can create a default project and test from the CLI. B...

Tricks for generating SQL statements in Excel

Do you have any tricks for generating SQL statements, mainly INSERTs, in Excel for various data import scenarios? I'm really getting tired of writing formulas with like ="INSERT INTO Table (ID, Name) VALUES (" & C2 & ", '" & D2 & "')" ...

Are all macros evil?

In my experience, not all macros have been evil. Along the course of my career, macros have been useful in a limited context. In MFC, message crackers provided a concise DSL-like description for message maps. Type-agnostic macros provided useful utility functions for a pre-template versions of C++, albeit dangerous. However, I have seen...

Word 2008 macro to SVN ADD current document

I want to invoke "svn add" on the current Word 2008 document. I've got a shell script that'll svn commit it later. I don't want that shell script to indiscriminately svn add files so I'd like to be able to do it from a button in Word 2008 tied a macro or appleScript. ...

Good Programming Practices for Macro Definitions (#define) in C

For example, never define a macro like this: #define DANGER 60 + 2 This can potentially be dangerous when we do an operation like this: int wrong_value = DANGER * 2; // Expecting 124 Instead, define like this because you don't know how the user of the macro may use it: #define HARMLESS (60 + 2) The example is trivial, but that p...

Any have a Visual Studio shortcut/macro for toggling break on handled/unhandled exceptions?

I've been trying to write a macro do do the equivalent of Hitting Ctrl+Alt+E to bring up the Exceptions window Toggling the textbox in the 'thrown' column for 'Common Language Runtime Exceptions' Hitting OK If I record this, it records only a single line of macro code which doesn't do anything. Anyone know how to do this? ...

sql query causing error 2950

Hello, This SQL query was generated by Microsoft Access 2003, and works fine when run, but fails when trying to run from a Macro. Is there any obvious error within the query, or any reason it would not work? SELECT tblAuction.article_no, tblAuction.article_name, tblAuction.subtitle, tblAuction.current_bid, tblAuction.start_price, tblAu...