title: Word 2007 VBA to insert text
body: <p>I want to insert text with custom formatting, then change the font style back to what it was before the code was run.</p>
  
  <pre><code>Dim myText As String
  Dim oldFont As Object
  'Save old font    
  Set oldFont = Selection.Font 
  
  'Insert text with custom font
  myText = "CUSTOM STRING"
  Selection.Font.Name = "Comic Sans MS"
  Selection.Font.Size = 26
  Selection.Font.Bold = True
  Selection.TypeText (myText)
  
  'Revert font back to original
  Set Selection.Font = oldFont
  </code></pre>
  
  <p>Can anyone explain a way to do what I'm looking for?</p>
  
  <p>Edit: I should have been more specific. If I am typing text, I have a certain formatting that I am typing in that is shown on the Home Tab (eg. Comic Sans Ms, Size 22, Bold). When I insert text with the code, this changes the formatting that I am typing with, so if I continue typing it will be in the NEW font type, not the Comic Sans MS. I am trying to make it so if I continue typing after I have inserted the text via VBA code, it will retain my old formatting.</p>