Set all expressions to constant values

I'd like a journal to go through each component in the assembly and set each expression to a constant (removing any formulas if they exist). I see some issues with string expressions, so if possible I would want to restrict it to only change numeric expressions (skip "strings" for example). If you specifically help me with a function for going through the expressions of the work part I should be able to piece that into your recursive journal. Thank You.

The code below was adapted from the article:
http://nxjournaling.com/content/expressions-query-existing-expressions

Here are some more articles about working with expressions that may be of use:
http://nxjournaling.com/content/expressions-creating-expressions-no-units

http://nxjournaling.com/content/expressions-create-expression-units

Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UF

Module Module1

Dim theSession As Session = Session.GetSession()
Dim theUfSession As UFSession = UFSession.GetUFSession()

Dim theUI As UI = UI.GetUI()
Dim lw As ListingWindow = theSession.ListingWindow

Sub Main()

Dim markId1 As Session.UndoMarkId
markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "replace expression formula")

lw.Open()

For Each temp As Expression In theSession.Parts.Work.Expressions
'lw.WriteLine("name: " & temp.Name)
'lw.WriteLine("type: " & temp.Type)
'lw.WriteLine("edit locked? " & temp.IsNoEdit.ToString)
'lw.WriteLine("locked by user? " & temp.IsUserLocked.ToString)
'lw.WriteLine("right hand side: " & temp.RightHandSide)
'lw.WriteLine("equation: " & temp.Equation)

If temp.Type = "Number" Then
Dim expValue As Double
expValue = temp.GetValueUsingUnits(Expression.UnitsOption.Expression)
'lw.WriteLine("expression value: " & expValue.ToString)

Try
If Not temp.IsNoEdit Then
'expression is not locked
temp.RightHandSide = expValue.ToString
Else
'expression is locked for editing
lw.WriteLine("expression '" & temp.Name & "' is locked and cannot be edited")
End If
Catch ex As NXException
lw.WriteLine("Error while processing expression: " & temp.Name)

End Try
End If

Next

lw.Close()

End Sub

Public Function GetUnloadOption(ByVal dummy As String) As Integer

'Unloads the image immediately after execution within NX
GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately

End Function

End Module