Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Update and assign variable in Macro

Hi

I woud like to increment a variable 'vIncr' in Macro definition and assign the resulting value to another variable 'vLatest'. Please help me in achieving this. Thanks in advance...

4 Replies
marcus_sommer

Try this:

var = ActiveDocument.Variables("var1").GetContent.String

ActiveDocument.Variables("var2").SetContent var, true

- Marcus

Not applicable
Author

Hi Marcus

I want to first increment the value of variable before assigning it to another variable. Main question is : how to increment the value of variable by 1.

marcus_sommer

var = ActiveDocument.Variables("var1").GetContent.String

var = var + 1

ActiveDocument.Variables("var2").SetContent var, true

- Marcus

Not applicable
Author

Great.. Thanks Marcus