macros

excel 2007 macro select records

I would like to write a macro in vb to select all rows where values in column B contain the characters 'via'. This is my first attempt at macros and not too sure how to begin. ...

Activating text editing macros on Netbeans

This question was asked on Super User but I didn't get any response so I moved it here...I believe it is relevant and important... I've been using Netbeans on Mac OS X for sometime it has some really good features but it doesn't support most of the macros and that sucks. I'm not only talking about complicated emacs macros but even the mo...

VBA Macro -- How can I access the clipboard?

Hello all. I'm new to programming, so this is (hopefully) a simple question. I'm catching cut, copy, and paste operations in Microsoft Word via macros -- currently, messages like "PASTE!" pop up when a paste operation takes place, etc. However, when these messages pop up, the actions themselves do not take place. For example, if I have ...

Word VBA Macro -- Write multiple items to a txt file?

Hello all, I'm working on a project to store what a user cuts/copies/pastes within a Word document, and am using the VBA macros to accomplish this. Here's a snippet from the paste macro: Open "C:\Temp\HoldPastes.txt" For Output As #1 Write #1, "TestTestTest." Write #1, Selection Close #1 I'd like HoldPastes.txt to h...

Trigger MS Word macro after save event

My MS Word 2007 template has a footer with the filename in it. The user is going to open the template and do a "Save As..." to make their document. I want the filename shown in the footer to update immediately to the new filename. Is there an AfterSaveEvent or something that I can use as a hook to start my VBA script that does the upda...

How can I print a variable name and its value without typing the name twice?

When you are debugging, it's very useful to do this: var = calc() print("var:", var) Is there any language where this is easy to do? In C and C++ you can use the stringify macro operator # and in Ruby I found this question: http://stackoverflow.com/questions/2603617/ruby-print-the-variable-name-and-then-its-value The solution that u...

How to build Excel macro

Hi, Need help. I have created the below as a macro so that a user can extract the info by clicking a single button:- Sub Sales() Dim StrSQl As String Con = "Provider=IBMDA400;Data Source=XXX.XXX.XXX.XXX;User Id=yyyy;Password=zzzz" Set Db = CreateObject("ADODB.Connection") Set rs = CreateObject("ADODB.recordset") Db.connectionSTring ...

C preprocessor macros: check if token was declared

This is for the C preprocessor experts: How can I declare an enum with a list of some identifiers and later during the switch-statement check if an identifier was included in the list? Example of what I need: typedef enum { e1, e2, e3, e4, e5, e6 } e; e x; switch (x) { #if DECLARED_IN_ENUM (e1) case e1 : ... #endif /* etc. */ } ...

Resharper template macro for method return type

I can't seem to find a way to insert the method return type in a Resharper 5 macro. Can this be done? For example, I have the following template: Contract.Ensure(Contract.Result<$RESULTTYPE$>() != null); I would like $REUSLTTYPE$ to be automatically filled with the data type of the current method, but I can't find a macro that woul...

Open office macro function to get a font color.

I am using the BASIC macro language for open office. There is a nice function cell.getValue() that gets the value of the cell. However, I can't find a function that gets the font color of the text in the cell, in numerical RGB format. ...

Writing a macro in Perl

open $FP, '>', $outfile or die $outfile." Cannot open file for writing\n"; I have this statement a lot of times in my code. I want to keep the format same for all of those statements, so that when something is changed, it is only changed at one place. In Perl, how should I go about resolving this situation? Should I use macros or func...

How to build Excel macro with date range

Hi, I hv created a From Date & To Date in excel (Sheet1). Under cell A3, I hv From Date :: 01-01-2010 and cell A4 To Date :: 31-08-2010. How do I link the Date Range to the below macro:- Sub Sales() Dim StrSQl As String Con = "Provider=IBMDA400;Data Source=XXX.XXX.XXX.XXX;User Id=yyyy;Password=zzzz" Set Db = CreateObject("ADODB.Con...

dotCMS: how to paginate content in a list?

Hi All, I am working on a dotCMS project where we are writing HTML, Javascript and Velocity - but no Java (there has been no need yet). In dotCMS, I need to traverse two relationships to come up with a list of all items of Structure C related to an instance Structure A where Structure A relates to Structure C which relates to Structure...

How to find out cl.exe's builtuin macros

Does anyone know how could I find out which are cl.exe's builtin/predefined macros? For example for gcc the following command line will list all the compiler's builtin macros gcc -dM -E - </dev/null EDIT: I'm interested in a way similar to gcc's that is "ask the actual compiler". Thanks ...

Is this a valid macro in C?

If I use the macro: #define AND in the following way: if(...) { ... } elseANDif(...) { ... } What output does the preprocessor produce? Edit: I intend to use: #define TEST(params) if(...){...}else the ... in if(...) is a complicated expression using params the ... in {...} performs some operations & is independent of param...

New Line in velocity set directive

How do you append a newline in velocity template using set? This does not work. #(set $some = "$a \n $b") Prints literally \n. Doing this also does not work : VelocityContext context = new VelocityContext(); context.put("esc", new EscapeTool()); Velocity.evaluate(context, writer, "LOG", template); ...

Possible to determine if an Word doc or Excel spreadsheet has a macro included?

When reading the binary of a Word or Excel doc into memory, is it possible to inspect the data to determine if a macro is built-in to it? ...

Apply-recur macro in Clojure

I'm not very familiar with Clojure/Lisp macros. I would like to write apply-recur macro which would have same meaning as (apply recur ...) I guess there is no real need for such macro but I think it's a good exercise. So I'm asking for your solution. ...

Can I fire an Outlook 2003 macro when the user creates a new blank message

Hi, All I've found so far are events that get fired when the user receives a message, or hits the send button, but nothing that gets fired when the user first creates a blank, new email before setting the TO field and writing the message etc. Is there any way to do that? Cheers, Dave --Trindaz on Fedang #outlook-2003-macros ...

How can I solve a system of linear equations in Excel

Hi, I am having some trouble finding a solution for a system of equations using excel. The system is of the form Ax=b, with A a matrix and x and b vectors. Obviously, the goal is to find x. The system does not necessarily have the same number of equations and unknowns. An exact solution is not always possible. Therefor I want to find t...