macros

Macro Program/application

Hello, I wan't to create a c# application which simplifies the life of a writer by using macros. I know this tool already exists in well-known programs such as Word or OpenOffice. However, I want to add this extra 'tool' (the macro program) to a main program I've already done. So, what this program should do is replace keybindings for s...

Word macro to extract lists

Hello, I've been following this forum for a while. Some of the answers were great. First time I am posting a question here. I am trying to extract lists (bulleted, numbered) from word document. I looked around, I got upto getting the paragraphs from Word using a macro. How do I get to the lists? Also, I want to extract them out as t...

Access 2007, VBA, a tiny project for a school, and the Trust Center

A friend asked for my help putting together an Access database for a small department at a university. It tracks medical info on some animals. The problem is that to make the application easy enough to use, we had to write some VBA code to glue different forms together. When we open the database (or a new, updated version of the database...

Macro recursive expansion to a sequence

Is it possible to define a C/C++ macro "BUILD(a, i)" which expands to "x[0], x[1], x[2], ..., x[i]" ? Like in #define BUILD(x, 0) x[0] #define BUILD(x, 1) x[0], x[1] #define BUILD(x, 2) x[0], x[1], x[2] ... Thanks! Edit: It seems BOOST_PP_ENUM_PARAMS could do the job. I suppose I could just #include boost, but I'm interested in know...

Applying filter based upon ActiveCell on a different Worksheet

Hello, The following VBA code sits in a worksheet called "SCU" and the cell "C4" is the information I would like to filter on. When double clicking on "C4" this takes us through to the "Account Data" sheet and attempts to filter on the active cell, however as it's on a separate worksheet I get the wrong data in the filter (Not "C4" in...

replay a vim macro until end of buffer

I want to run a macro I just recorded in register "x" on every single line of an open buffer, from my cursor to end of the buffer, in vim. How do I do that? I know I can replay the macro n times: 15@x ...or just hold down @ until I reach the the last line, but I want to just hit a few keystrokes and be done with it. Thanks in advanc...

VBA Macro protection

I have written a VBA macro to do some stuff in Excel, and I want to know if the following is possible. How do I protect a Macro so that no matter who uses the spreadsheet, they cannot edit the code. (IF they press ALT F11 and pull up the macro Edit button options need to be greyed out, even if the macro has been selected).? Also is it ...

Visual Studio macros: WindowActivated handler turns clicks into double clicks

If I add a WindowEvents_WindowActivated handler to my Visual Studio 2005 Macros EnvironmentEvents module, I get a weird side-effect: when I click from one window to another in Visual Studio, that click is treated as a double click. So for instance, I put the focus in an editor window and click a file in Solution Explorer, and the file o...

(emulated) Macros in Haskell?

Hi. A person on Reddit has brought this code to my attention: main = do let ns = [print 1, print 2, print 3] sequence_ ns sequence_ $ reverse ns sequence_ $ tail ns ++ [head ns] head ns What's going on here is we have an array of operations that we can do stuff with, like reverse or get its tail or head. Awesome. What I w...

Excel - "File Not Found: VBA6.DLL"

I have an Excel 2007 Sheet with Macros. When I click on a button, it immediately pops up an error "File Not Found: VBA6.DLL" Problem is, I have been using this sheet forever, and never seen this problem before. I did make some very very minor changes to the Macro code. And, I have 2 other sheets with identical macro code which I made t...

How do I implement no-op macro (or template) in C++?

How do I implement no-op macro in C++? #include <iostream> #ifdef NOOP #define conditional_noop(x) what goes here? #else #define conditional_noop(x) std::cout << (x) #endif int main() { conditional_noop(123); } I want this to do nothing when NOOP is defined and print "123", when NOOP is...

Eval not working on unexpanded macro quote

In common lisp I can do this: src-> (defmacro macro-hello () `"hello") (eval '(macro-hello)) no problem. In clojure: (defmacro macro-hello [] `"hello") (eval '(macro-hello)) gives me an error. Have I done something wrong? Clojure Error: Exception in thread "main" java.lang.Exception: Unable to resolve symbol: macro-hello i...

C sizeof equivalent for macros

So I'm optimizing some code by unrolling some loops (yes, I know that I should rely on my compiler to do this for me, but I'm not working with my choice of compilers) and I wanted to do so somewhat gracefully so that, in case my data size changes due to some edits in the future, the code will degrade elegantly. Something like: typedef ...

Multiplying and adding images with CImg In C++

Hello I am trying to find C in the following function in CImg C=B*L+(1-B)S Where C, L and S are all RGB images of the same size (and B is a single channel grayscale matte) I cannot figure out how to loop over the pixels. I've seen code like: cimg_forXYZ(S,x,y,z) {... } But I have never see than kind of syntax before, could it be ...

Clojure macro to create a synonym for a function

Probably an easy one for anyone who actually knows how to write macros in any Lisp. I want to be able to define synonyms for function names. I've been copy-and-paste hacking core.clj to do this, but I don't want to be such a dunce forever! It seems obvious a macro that rewrites the call to a synoym-function into a call to the original...

Using shoulda macros with RSpec

I'm trying to use the shoulda macros within RSpec and am having some problems. I've done the following: spec_helper.rb: require 'shoulda/active_record/macros' Spec::Runner.configure do |config| ... config.include(Shoulda::ActiveRecord::Macros, :type => :model) spec/models/foo_spec.rb: describe Foo do it { should_have_i...

define a synonym for a Clojure macro

So following on from http://stackoverflow.com/questions/1315099/clojure-macro-to-create-a-synonym-for-a-function , I discovered that def can't be used to define a synonym for a macro. Below are examples I tried that Clojure doesn't allow. ;(def def-function defn) ;(def case cond) ;(def function fn) Is it possible to define synonyms/al...

openoffice calc macro for CSV saving

Given: I recorded a simple macro in Openoffice to save my worksheet as a CSV file. Here it is. sub toCSV dim document as object dim dispatcher as object document = ThisComponent.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") dim args1(2) as new com.sun.star.beans.PropertyValue args1(0).N...

How can I control "View Whitespace between pages" in MS Word using VBA/Macros?

Is it possible to control the Tools->Options->View->"View Whitespace between pages" through VBA/Macros? Thanks. ...

How to create a script/macro on windows XP?

hi there*.sh im not really feeling home in the windows world but at the moment i have to use a laptop with windows xp installed on it... the point is, that i do not have administrator privileges. Im currently working on a grails application and therefore I have to set the JAVA_HOME and GRAILS_HOME eacht time, I start the machine... Could...