How to change the variable content?

dear,

if my type “2016/17” in my input dialog, and it will replace text in my word file. However, what expression should I put if I want to show “2015/16” or “2017/18” based on my input dialog? thanks~

maybe someone has a better idea but the way i see is to use some variables to store each number:

var year = CInt(“2016/17”.split(“/”)(0))
var month = CInt(“2016/17”.split(“/”)(1))

then to write upwards / downwards values you would use:

newText = (year - 1).toString + “/” + (month - 1).toString

1 Like

dear,

thanks for your reply. however, when I input your CInt expression, it shows blue !!. and what I would do is to extract string variable from OCR PDF and then convert string “2016/17” to your expression. thank you~

hi,

try this:

CInt(“2016/17”.split("/“c)(0)).ToString
CInt(“2016/17”.split(”/"c)(1)).ToString

Hello!

Here’s my solution. (Download the xaml file).

changeVariableContent.xaml (7.1 KB)

Regards,

1 Like