Jump to content
Macro Express Forums

Run Macro in variable


Recommended Posts

I have the simplest macro which I'm trying to run from a variable.

 

Here's the one-line macro"

Text Box Display: abc

(a header of abc, the contents of def)

 

Here's its Direct Editor representation:

<TEXT BOX DISPLAY Title="abc" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang3081{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 def\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/>

But placing this in T[1], then running the macro in T[1], results in a text box with a header of abc and contents of

tf1nsinsicpg1252eff0eflang3081onttbl0nilcharset0 Tahoma;1nil Tahoma;iewkind4c1ard0s16 def1 ar

 

???

 

BTW, the example in the help file talks about separator characters, then goes on to provide an example which seems entirely lacking in said separator characters!

 

Any ideas please?

Link to comment
Share on other sites

I have the simplest macro which I'm trying to run from a variable.

 

Here's the one-line macro"

Text Box Display: abc

(a header of abc, the contents of def)

 

Here's its Direct Editor representation:

<TEXT BOX DISPLAY Title="abc" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang3081{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 def\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/>

But placing this in T[1], then running the macro in T[1], results in a text box with a header of abc and contents of

tf1nsinsicpg1252eff0eflang3081onttbl0nilcharset0 Tahoma;1nil Tahoma;iewkind4c1ard0s16 def1 ar

 

???

 

BTW, the example in the help file talks about separator characters, then goes on to provide an example which seems entirely lacking in said separator characters!

 

Any ideas please?

 

I bet it will come down to the syntax of the commands you've used, particularly the Run Macro in Variable, but you haven't posted that.

 

Edit:

 

As I suspected, the code needs an obscure change to this:

<TEXT BOX DISPLAY Title="abc" Content="{\\\\rtf1\\\\ansi\\\\ansicpg1252\\\\deff0\\\\deflang3081{\\\\fonttbl{\\\\f0\\\\fnil\\\\fcharset0 Tahoma;}{\\\\f1\\\\fnil Tahoma;}}\\r\\n\\\\viewkind4\\\\uc1\\\\pard\\\\f0\\\\fs16 def\\\\f1 \\r\\n\\\\par }\\r\\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\\x00" Delay="0"/>

 

The macro then produces the correct result.

 

Unfortunately the Help is a bit thin, so this was largely a matter of trial/error. After reading the table under:

This table shows several other substitutions for characters that cannot be added directly to a macro command:

I tried (amongst many other things!) changing all instances of '\' to '\\', which happily gave the proper result.

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...