View Single Post
 
Old 09-25-2019, 12:25 PM
KBeMe KBeMe is offline Windows 10 Office 2016
Novice
 
Join Date: Sep 2019
Posts: 1
KBeMe is on a distinguished road
Default Extracting Numbers from String

I have a User Form where the user enters information that populates a document using Private Sub cmdOK_Click(). From one of the Text Fields that the user inputs data I need to extract the numbers that are entered in the format of ##-#### stripping any other text that is entered and I then I want to be able to do a


ActiveDocument.Bookmarks("CaseNum1").Select
Selection.TypeText


to place the number minus any other characters into the document. All documentation I can find to do something like this is for Excel and does not work in Private Sub cmdOK_Click().
Reply With Quote