AyeSee
08-13-2010, 12:19 PM
Hello,
I'm writing some code that will read a number in my word document and that will write down on the next line "negative " if the word is negative, and write nothing is the word is positive. Currently, the result I am getting is always negative whether the number is positive or negative.
To do so, I used the Selection and wdextend to get the whole number and then I use this code :
Dim ga As Double
If ga <= 0 Then
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.TypeText Text:="negative "
Else
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.TypeText Text:=""
End If
Does anyone understand why it never captures handles it properly? Many thanks for any kind of help
Alex
I'm writing some code that will read a number in my word document and that will write down on the next line "negative " if the word is negative, and write nothing is the word is positive. Currently, the result I am getting is always negative whether the number is positive or negative.
To do so, I used the Selection and wdextend to get the whole number and then I use this code :
Dim ga As Double
If ga <= 0 Then
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.TypeText Text:="negative "
Else
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.TypeText Text:=""
End If
Does anyone understand why it never captures handles it properly? Many thanks for any kind of help
Alex