Search Results

Search found 1127 results on 46 pages for 'macro'.

Page 10/46 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • bold small caps with mathpazo

    - by user312728
    The bold small caps don't work with mathpazo font. I am a issue with this macro for take in upper case a bold text : the text is never in upper case. \documentclass{minimal} \usepackage[sc,osf]{mathpazo} \newcommand\normal{\fontseries{\ifx\f@series\bfdefault\then m \fi}\selectfont} \makeatletter \DeclareRobustCommand{\mytextsc}[1]{% \ifx\f@series\bfdefault% \uppercase{#1}% \else {\scshape #1}% \fi } \makeatother \begin{document} \textbf{This is a bold \mytextsc{upper case} text.} This is a \mytextsc{small caps} text. \end{document}

    Read the article

  • Visual Studio Property Page Inherit Macros From Other Projects

    - by James
    So I am having a very difficult time finding a solution to this problem. Is there any way that I can inherit macros from another project. For example, for the post build I would like to use the macro for the RemoteMachine address that is located in one project in all the other projects. I was thinking something like (ProjectContainingMacro.$RemoteMachine) ... does anyone have any suggestions?

    Read the article

  • C-macro: set a register field defined by a bit-mask to a given value

    - by geschema
    I've got 32-bit registers with field defined as bit-masks, e.g. #define BM_TEST_FIELD 0x000F0000 I need a macro that allows me to set a field (defined by its bit-mask) of a register (defined by its address) to a given value. Here's what I came up with: #include <stdio.h> #include <assert.h> typedef unsigned int u32; /* * Set a given field defined by a bit-mask MASK of a 32-bit register at address * ADDR to a value VALUE. */ #define SET_REGISTER_FIELD(ADDR, MASK, VALUE) \ { \ u32 mask=(MASK); u32 value=(VALUE); \ u32 mem_reg = *(volatile u32*)(ADDR); /* Get current register value */ \ assert((MASK) != 0); /* Null masks are not supported */ \ while(0 == (mask & 0x01)) /* Shift the value to the left until */ \ { /* it aligns with the bit field */ \ mask = mask >> 1; value = value << 1; \ } \ mem_reg &= ~(MASK); /* Clear previous register field value */ \ mem_reg |= value; /* Update register field with new value */ \ *(volatile u32*)(ADDR) = mem_reg; /* Update actual register */ \ } /* Test case */ #define BM_TEST_FIELD 0x000F0000 int main() { u32 reg = 0x12345678; printf("Register before: 0x%.8X\n", reg);/* should be 0x12345678 */ SET_REGISTER_FIELD(&reg, BM_TEST_FIELD, 0xA); printf("Register after: 0x%.8X\n", reg); /* should be 0x123A5678 */ return 0; } Is there a simpler way to do it?

    Read the article

  • macro collapse all in solution visual studio 2010

    - by rod
    Hi All, I found the CollapseAll macro online that has worked for me in vs2005 and vs2008. However, this half way works in vs2010. It looks like it only collapses the top nodes and not any subnodes that may be expanded? any ideas? Thanks, rod. Sub CollapseAll() ' Get the the Solution Explorer tree Dim UIHSolutionExplorer As UIHierarchy UIHSolutionExplorer = DTE.Windows.Item(Constants.vsext_wk_SProjectWindow).Object() ' Check if there is any open solution If (UIHSolutionExplorer.UIHierarchyItems.Count = 0) Then ' MsgBox("Nothing to collapse. You must have an open solution.") Return End If ' Get the top node (the name of the solution) Dim UIHSolutionRootNode As UIHierarchyItem UIHSolutionRootNode = UIHSolutionExplorer.UIHierarchyItems.Item(1) UIHSolutionRootNode.DTE.SuppressUI = True ' Collapse each project node Dim UIHItem As UIHierarchyItem For Each UIHItem In UIHSolutionRootNode.UIHierarchyItems 'UIHItem.UIHierarchyItems.Expanded = False If UIHItem.UIHierarchyItems.Expanded Then Collapse(UIHItem) End If Next ' Select the solution node, or else when you click ' on the solution window ' scrollbar, it will synchronize the open document ' with the tree and pop ' out the corresponding node which is probably not what you want. UIHSolutionRootNode.Select(vsUISelectionType.vsUISelectionTypeSelect) UIHSolutionRootNode.DTE.SuppressUI = False End Sub Private Sub Collapse(ByVal item As UIHierarchyItem) For Each eitem As UIHierarchyItem In item.UIHierarchyItems If eitem.UIHierarchyItems.Expanded AndAlso eitem.UIHierarchyItems.Count > 0 Then Collapse(eitem) End If Next item.UIHierarchyItems.Expanded = False End Sub End Module

    Read the article

  • Using twig variable to dynamically call an imported macro sub-function

    - by Chausser
    I am attempting if use a variable to call a specific macro name. I have a macros file that is being imported {% import 'form-elements.html.twig' as forms %} Now in that file there are all the form element macros: text, textarea, select, radio etc. I have an array variable that gets passed in that has an elements in it: $elements = array( array( 'type'=>'text, 'value'=>'some value', 'atts'=>null, ), array( 'type'=>'text, 'value'=>'some other value', 'atts'=>null, ), ); {{ elements }} what im trying to do is generate those elements from the macros. they work just fine when called by name: {{ forms.text(element.0.name,element.0.value,element.0.atts) }} However what i want to do is something like this: {% for element in elements %} {{ forms[element.type](element.name,element.value,element.atts) }} {% endfor %} I have tried the following all resulting in the same error: {{ forms["'"..element.type.."'"](element.name,element.value,element.atts) }} {{ forms.(element.type)(element.name,element.value,element.atts) }} {{ forms.{element.type}(element.name,element.value,element.atts) }} This unfortunately throws the following error: Fatal error: Uncaught exception 'LogicException' with message 'Attribute "value" does not exist for Node "Twig_Node_Expression_GetAttr".' in Twig\Environment.php on line 541 Any help or advice on a solution or a better schema to use would be very helpful.

    Read the article

  • C++ Macro Arithmetric

    - by anon
    I have to do with Macros (it's macros calling macros; so templates are out of the question). Here's what I want: foo(3, a, b1, c1) --> foo1(a, b1, c1); foo(5, a, b1, c1, b2, c2) -> foo2(a, b1, c1, b2, c2); foo(7, a, b1, c1, b2, c2, b3, c3) -> foo3(a, b1, c1, b2, c2, b3, c3); So basically, what I want is to be able to execute the "function" n - (n-1)/2 at macro expansion time. Is this possible? Thanks! [PS, if you dislike my questions; I support your right to downvote; my worst question so far is only -17, so maybe we can break that record; however, please let me know why my question is technically invalid.] Thanks EDIT: Foo takes a variable # of arguments, of the form: foo(N, a1, b1, a2, b2, ... a_N, b_N) -> foo##N(a1, b1, a2, b2, ... a_N, b_N);

    Read the article

  • Macro not declared in this scope

    - by NmdMystery
    I'm using a preprocessor #define macro to count the number of functions in a header file: #define __INDEX -1 //First group of functions void func1(void); #define __FUNC1_INDEX __INDEX + 1 void func2(void); #define __FUNC2_INDEX __FUNC1_INDEX + 1 #undef __INDEX #define __INDEX __FUNC2_INDEX //Second group of functions void func3(void); #define __FUNC3_INDEX __INDEX + 1 void func4(void); #define __FUNC4_INDEX __FUNC3_INDEX + 1 #undef __INDEX #define __INDEX __FUNC4_INDEX //Third group of functions void func5(void); #define __FUNC5_INDEX __INDEX + 1 void func6(void); #define __FUNC6_INDEX __FUNC5_INDEX + 1 #undef __INDEX #define __INDEX __FUNC6_INDEX #define __NUM_FUNCTIONS __INDEX + 1 The preprocessor gets through the first two sets of functions just fine, but when it reaches the line: #define __FUNC5_INDEX __INDEX + 1 I get a "not defined in this scope" error for __INDEX. What makes this really confusing is the fact that the same exact thing is done [successfully] in the second group of functions; __FUNC3_INDEX takes on the value of __INDEX + 1. There's no typos anywhere, as far as I can tell... what's the problem? I'm using g++ 4.8.

    Read the article

  • How to implement lambda as a function called "lambda" in Clojure?

    - by dirtyvagabond
    I'd like to be able to define lambdas using common Lisp syntax, in Clojure. For example: (lambda (myarg) (some-functions-that-refer-to myarg)) This needs to result in the same as: #(some-functions-that-refer-to %) In my case, I know I'll always have exactly one arg, so perhaps that simplifies things. (But it can be called anything -- "myarg" or whatever.) I suspect a workable solution is to "(defmacro lambda ...". If so, I'm not sure of the best way to proceed. How to cleanly translate the arg name to %? And how to end up with the correct function? Or, is there a simpler solution than writing my own macro that actually re-implements Clojure's... lambda?

    Read the article

  • The way to find out whole picture width in PGF (Latex)

    - by drasto
    I've got a latex macro that draws a picture using PGF and Tikz according to given parameters. The width of picture drawn depends on these parameters. PGF automatically calculates the resulting width of any picture drawn so the user does not have to set it explicitly(like for example when using latex build in picture environment). However I need to know the width of picture that will be drawn. Of cause I could calculate it as the PGF does but this is going to be quite some work(a lot of if statements...). Is there a way to ask PGF what is the width of picture that is to be drawn (some command I expect)? Either inside tikzpicture environment or just after it? Thanks for help.

    Read the article

  • #if 0 as a define

    - by valerio
    I need a way to define a FLAGS_IF macro (or equivalent) such that FLAGS_IF(expression) <block_of_code> FLAGS_ENDIF when compiling in debug (e.g. with a specific compiler switch) compiles to if (MyFunction(expression)) { <block_of_code> } whereas in release does not result in any instruction, just as it was like this #if 0 <block_of_code> #endif In my ignorance on the matter of c/c++ preprocessors i can't think of any naive way (since #define FLAGS_IF(x) #if 0 does not even compile) of doing this, can you help? I need a solution that: Does not get messed up if */ is present inside <block_of_code> Is sure to generate 0 instructions in release even inside inline functions at any depth (i guess this excludes if (false){<block_of_code>} right?) Is standard compliant if possible Thank you

    Read the article

  • getting the heading of a selected text in word

    - by Thunder
    Hi, I am working With Microsoft Word VBA,macros. My question : Is there way to get sub-topic and master-topic that precedes a selected body text ? Here is an example: Master topic (level 1) sub-topic 1 (level 2) body text a body text b body text c sub-topic 2 (level 2) body text d body text e Other MISC topics (level 2) body text f body text g body text h Here if 'bodytext e' is selected I would like to run a macro and get the result as 'Master topic:sub-topic 1' I have tried with range,parent ,Scope.Information(wdActiveEndSectionNumber) etc but nothing seem to work!!! Thanks in Advance

    Read the article

  • Controlling symbol generation in Clojure macros

    - by mikera
    I'm trying (as a self-learning exercise) to create a Clojure macro that will generate code to apply a function to a sequence of integers and sum the result, e.g. f(0) + f(1) + f(2) + f(3) This is my attempt: (defmacro testsum [func n] `(fn [x#] (+ ~@( map (fn [i] `(~func x#)) (range n))))) However something seems to go wrong with the x# gensym and I end up with two different versions of x and hence the function doesn't work: (macroexpand '(testsum inc 3)) gives: (fn* ([x__809__auto__] (clojure.core/+ (inc x__808__auto__) (inc x__808__auto__) (inc x__808__auto__)))) This is pretty much exactly what I want apart from the different 809 and 808 versions of x..... What am I doing wrong? I thought that the auto gensym was meant to create a single unique symbol for exactly this kind of purpose? Is there a better way of doing this?

    Read the article

  • Why won't this compile and how can it be implemented so that it does?

    - by George Edison
    Here is some C++ code I'm playing around with: #include <iostream> #include <vector> #define IN , #define FOREACH(x,y) for(unsigned int i=0;i<y.size();i++) { x=y[i]; #define ENDFOREACH } using namespace std; int main() { vector<int> ints; ints.push_back(3); ints.push_back(4); ints.push_back(5); ints.push_back(6); FOREACH(int item IN ints) cout << item; ENDFOREACH return 0; } However, I get an error: macro "FOREACH" requires 2 arguments, but only 1 given The code compiles if I change the IN to a comma. How can I get the IN to take the place of a comma?

    Read the article

  • Is there a way to convert code to a string and vice versa in Python?

    - by Dragos Toader
    The original question was: Is there a way to declare macros in Python as they are declared in C: #define OBJWITHSIZE(_x) (sizeof _x)/(sizeof _x[0]) Here's what I'm trying to find out: Is there a way to avoid code duplication in Python? In one part of a program I'm writing, I have a function: def replaceProgramFilesPath(filenameBr): def getProgramFilesPath(): import os return os.environ.get("PROGRAMFILES") + chr(92) return filenameBr.replace("<ProgramFilesPath>",getProgramFilesPath() ) In another part, I've got this code embedded in a string that will later be output to a python file that will itself be run: """ def replaceProgramFilesPath(filenameBr): def getProgramFilesPath(): import os return os.environ.get("PROGRAMFILES") + chr(92) return filenameBr.replace("<ProgramFilesPath>",getProgramFilesPath() ) """ How can I build a "macro" that will avoid this duplication?

    Read the article

  • how to get the exact mouse click position with support for variable screen resolution ?

    - by javadahut
    I'm writing a simple macro program: you record your mouse or keyboard movements, you save the file, and the program will run it for you on your pc computer. however, the situation is, what if the file is run on a laptop where the resolution is smaller? what if the file is to be run on a web server where there is no monitor ? ie) the button is clicked at position (x,y): 300,520 but the button will be at another location in a different monitor resolution. How would you approach this problem ?

    Read the article

  • Automating Firefox configuration settings

    - by Richard100
    Hi All, During web development work, I need to be able to quickly switch various config settings in Firefox. In particular I need to be able to: 1) Switch off cookies 2) Switch off javascript 3) Switch my user agent (I have the user-agent switcher add-on installed) and then back again. Instead of doing this manually, it would be great if i could add a "macro" button to my toolbar that I could simply click to toggle the three settings above. Anyone know if this is possible? Btw - Firefox Profiles doesn't really cut it. You can't dynamically switch profiles within a specific Firefox instance, which I need to be able to do. Btw2 - I got excited when i saw Greasemonkey, Chicken Foot, but it looks like these can only automate browsing/DOM tasks, and not with firefox configuration settings. Thanks Richard.

    Read the article

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

    - by John M
    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 want Excel to recalculate all formulas when this workbook is opened?". The user can then select Yes/No and then the file will save. How do I disable the messagebox from appearing? The default answer would be 'No'. My code for saving: Sub saveAs_97_2003_Workbook(tempFilePath As String, tempFileName As String) Dim Destwb As Workbook Dim SaveFormat As Long 'Remember the users setting SaveFormat = Application.DefaultSaveFormat 'Set it to the 97-2003 file format Application.DefaultSaveFormat = 56 ActiveSheet.Copy Set Destwb = ActiveWorkbook Destwb.CheckCompatibility = False With Destwb .SaveAs tempFilePath & tempFileName & ".xls", FileFormat:=56 .Close SaveChanges:=False End With 'Set DefaultSaveFormat back to the users setting Application.DefaultSaveFormat = SaveFormat End Sub

    Read the article

  • How to pass argument to a Microsoft Word macro ?

    - by Nam Gi VU
    I need to run a macro in Word with a parameter. I've tried to declare a parameter for the module in the VB Macro Editor but it doesn't work - the macro will be invisible in the macro list when I do so. I don't know how to do this and whether it is posible to do so or not in MS Word 2007. Please help.

    Read the article

  • Handling macro redefinition without modifying .h files ... C / C++ language

    - by user310119
    Background: Let assume that I have two header files a.h and b.h. a.h contains: #define VAR 1 b.h contains: #define VAR 2 Note: The name of both of the macro is same. Let say I have some file myFile.c which includes both of the header files i.e. a.h and b.h. When I try to access VAR, I get a redefinition error of VAR. In order to resolve this problem, I inserted #ifndef VAR statement in both a.h and b.h files to prevent this error. a.h file becomes #ifndef VAR #define VAR 1 #endif b.h file becomes #ifndef VAR #define VAR 2 #endif Note: The header file can contain multiple macros, not just one macro. Problem: Let's assume that a.h and b.h files are obtained from third party library. These files don't contain #ifndef VAR statement. I am not allowed to change their header files. Can I resolve macro 'VAR' redefinition error in myFile.c or myFile.cpp file which uses VAR macro? I know I #undef VAR can be used to undefine a macro VAR. How can I selectively include VAR later in my program? i.e. on line 10 of myFile.c code I should be able to refer to VAR definition from a.h file, on line 15 of my code I should be able to refer to VAR from b.h file and on line 18 again I should be able to refer to VAR from a.h file. In short, am I able to do macro polymorphism ? Given a name of header file, it should refer to macro definition present in that file. I thought of using namespace trick to resolve an issue. Define first header file in namespace first and second header file in namespace second. I tried defining two namespaces. First namespace contains #include a.h and second namespace contains b.h. However, namespace trick does not work with macro. When I tried to access firstns::VAR, compiler reports an error message. Can you please suggest some way?

    Read the article

  • Word Macros Problem: MsgBox function appears to lock all open windows of word

    - by amby
    I have some Macros that run in Word. We are migrating to Office 2007. Problem: the MsgBox function appears to lock all open windows of word. Any Ideas on how to get around that? (It is a macro that walks a user through a bunch of prompts for information that they enter into user forms and or MsgBoxes.) The error says: The command cannot be completed because a dialog box is open. Click OK then close all open dialog boxes to continue. Is there any way to have each window of word act independently of each other? The problem is that the information is frequently cut and pasted from other open word documents, and this doesn't work as the MsgBox locks control of ALL windows of Word 2007. The macros are pretty simple, but if you want to see the code, I will certainly post it. Basically, the old version of office let you go between windows, while 2007, that we are migrating to does not. I have run all the updates I could find. Any help would be greatly appreciated.

    Read the article

  • How to fill in Different String Values in Different Cells in Excel 2007 VBA marcos

    - by user325160
    Hello everyone, So I am trying to fill in Values "A-Z, 0-9" in a 2007 excel macro in four different locations (I am trying to put A-Z and 0-9 in cells: a1 to d9, e1 to h9, a10 to d18, and e10 to h18). So far I have the code: Sub TwoDArrays() Dim Matrix(9, 4) As Variant Dim Matrix2(9, 4) As Variant Dim Matrix3(9, 4) As Variant Dim Matrix4(9, 4) As Variant Matrix(1, 1) = "A" Matrix(1, 2) = "B" Matrix(1, 3) = "C" Matrix(1, 4) = "D" Matrix(2, 1) = "E" Matrix(2, 2) = "F" Matrix(2, 3) = "G" Matrix(2, 4) = "H" Matrix(3, 1) = "I" Matrix(3, 2) = "J" Matrix(3, 3) = "K" Matrix(3, 4) = "L" Matrix(4, 1) = "M" Matrix(4, 2) = "N" Matrix(4, 3) = "O" Matrix(4, 4) = "P" Matrix(5, 1) = "Q" Matrix(5, 2) = "R" Matrix(5, 3) = "S" Matrix(5, 4) = "T" Matrix(6, 1) = "U" Matrix(6, 2) = "V" Matrix(6, 3) = "W" Matrix(6, 4) = "X" Matrix(7, 1) = "Y" Matrix(7, 2) = "Z" Matrix(7, 3) = "0" Matrix(7, 4) = "1" Matrix(8, 1) = "2" Matrix(8, 2) = "3" Matrix(8, 3) = "4" Matrix(8, 4) = "5" Matrix(9, 1) = "6" Matrix(9, 2) = "7" Matrix(9, 3) = "8" Matrix(9, 4) = "9" Matrix2(1, 1) = "A" Matrix2(1, 2) = "B" Matrix2(1, 3) = "C" Matrix2(1, 4) = "D" Matrix2(2, 1) = "E" Matrix2(2, 2) = "F" Matrix2(2, 3) = "G" Matrix2(2, 4) = "H" Matrix2(3, 1) = "I" Matrix2(3, 2) = "J" Matrix2(3, 3) = "K" Matrix2(3, 4) = "L" Matrix2(4, 1) = "M" Matrix2(4, 2) = "N" Matrix2(4, 3) = "O" Matrix2(4, 4) = "P" Matrix2(5, 1) = "Q" Matrix2(5, 2) = "R" Matrix2(5, 3) = "S" Matrix2(5, 4) = "T" Matrix2(6, 1) = "U" Matrix2(6, 2) = "V" Matrix2(6, 3) = "W" Matrix2(6, 4) = "X" Matrix2(7, 1) = "Y" Matrix2(7, 2) = "Z" Matrix2(7, 3) = "0" Matrix2(7, 4) = "1" Matrix2(8, 1) = "2" Matrix2(8, 2) = "3" Matrix2(8, 3) = "4" Matrix2(8, 4) = "5" Matrix2(9, 1) = "6" Matrix2(9, 2) = "7" Matrix2(9, 3) = "8" Matrix2(9, 4) = "9" Matrix3(1, 1) = "A" Matrix3(1, 2) = "B" Matrix3(1, 3) = "C" Matrix3(1, 4) = "D" Matrix3(2, 1) = "E" Matrix3(2, 2) = "F" Matrix3(2, 3) = "G" Matrix3(2, 4) = "H" Matrix3(3, 1) = "I" Matrix3(3, 2) = "J" Matrix3(3, 3) = "K" Matrix3(3, 4) = "L" Matrix3(4, 1) = "M" Matrix3(4, 2) = "N" Matrix3(4, 3) = "O" Matrix3(4, 4) = "P" Matrix3(5, 1) = "Q" Matrix3(5, 2) = "R" Matrix3(5, 3) = "S" Matrix3(5, 4) = "T" Matrix3(6, 1) = "U" Matrix3(6, 2) = "V" Matrix3(6, 3) = "W" Matrix3(6, 4) = "X" Matrix3(7, 1) = "Y" Matrix3(7, 2) = "Z" Matrix3(7, 3) = "0" Matrix3(7, 4) = "1" Matrix3(8, 1) = "2" Matrix3(8, 2) = "3" Matrix3(8, 3) = "4" Matrix3(8, 4) = "5" Matrix3(9, 1) = "6" Matrix3(9, 2) = "7" Matrix3(9, 3) = "8" Matrix3(9, 4) = "9" Matrix4(1, 1) = "A" Matrix4(1, 2) = "B" Matrix4(1, 3) = "C" Matrix4(1, 4) = "D" Matrix4(2, 1) = "E" Matrix4(2, 2) = "F" Matrix4(2, 3) = "G" Matrix4(2, 4) = "H" Matrix4(3, 1) = "I" Matrix4(3, 2) = "J" Matrix4(3, 3) = "K" Matrix4(3, 4) = "L" Matrix4(4, 1) = "M" Matrix4(4, 2) = "N" Matrix4(4, 3) = "O" Matrix4(4, 4) = "P" Matrix4(5, 1) = "Q" Matrix4(5, 2) = "R" Matrix4(5, 3) = "S" Matrix4(5, 4) = "T" Matrix4(6, 1) = "U" Matrix4(6, 2) = "V" Matrix4(6, 3) = "W" Matrix4(6, 4) = "X" Matrix4(7, 1) = "Y" Matrix4(7, 2) = "Z" Matrix4(7, 3) = "0" Matrix4(7, 4) = "1" Matrix4(8, 1) = "2" Matrix4(8, 2) = "3" Matrix4(8, 3) = "4" Matrix4(8, 4) = "5" Matrix4(9, 1) = "6" Matrix4(9, 2) = "7" Matrix4(9, 3) = "8" Matrix4(9, 4) = "9" For i = 1 To 9 For j = 1 To 4 Cells(i, j) = Matrix(i, j) Next j Next i 'For i = 1 To 9 'For j = 1 To 4 ' Range("a1:d1", "a1:a10").Value = Matrix(i, j) 'Application.WorksheetFunction.Transpose (Matrix) 'Next j 'Next i End Sub However, at the top for loop where it does not use the Range function with the cells, I can only do this for cells a1:d9 (a1 to d9) and if I use the second for loop with the range, get the value 9 appearing in every cell from a1 to d9. So is there a way to make it so that I can get the values A-Z and 0-9 in the other cells I specified above? Thank you.

    Read the article

  • How to import a macro file (previously exported as .bas file) to Microsoft Word using command line?

    - by Nam Gi VU
    I'm writing a command-line program that has a step in which I need to replace text in a Word file. The replacing task is accomplished using Word macro. What I need to do now is to call this macro from command-line. At the moment we can do this by using the -mMacroName parameter of 'winword.exe', i.e. \winword.exe -mMacroName. But this need the macro to be already available as a global macro. Since I need to run the program on another computer, I need to import the above replacing macro programatically... and I don't know how to do this. Please help.

    Read the article

  • Returning pointer to a certain value in a macro?

    - by Andrei Ciobanu
    Is it possible to write a macro that has a type and a value as its input parameters (MACRO(type,value)), and returns a valid pointer to a location that holds the submitted value. This macro should perform like the following function, but in a more generic manner: int *val_to_ptr(int val){ int *r = NULL; r = nm_malloc(sizeof(*r)); *r = val; return r; } Where nm_malloc() is a failsafe malloc. The Macro usage should be compatible with this usage: printf("%d",*MACRO(int,5)); Is it possible to achieve that ?

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >