You will need to do something like this:
Code:
p.SetScreenOrientation(0) 'Landscape
p.SetScreenOrientation(1) 'Portrait
p.SetScreenOrientation(-1) 'Both
You can put the line you need on a button or something, say you want to change to Portrait when clicking on a button, so, you should do this:
Code:
Sub Button1_Click
Dim p As Phone
p.SetScreenOrientation(1)
End Sub