karlmcauley Posted March 30, 2007 Posted March 30, 2007 Hello,I have a form, created via VBA, which opens as soon as a user opens the word document (2003).As i am new to this method of transfering user input i was wondering how the heck do i transfer the user input from the form to the activedocument, and at certain locations in that document.I have tried creating bookmarks and referencing them (which i can do) but i cant seem to insert user inputted text from the form at this location.I have tried Selection.TypeText cust_name.Text but this just inserts the text wherever the selection is and not at a specified location.Is there a method to use which specifies an exact location and then inserts new text to that location in the active document?I am now pulling my hair out with this so any help will be great.Thanks in advanceKarl
karlmcauley Posted March 30, 2007 Author Posted March 30, 2007 Hello,Just found a way that works for me.Set myrange = ActiveDocument.Content With myrange.Find .ClearFormatting .Replacement.ClearFormatting .Text = "whatevere text to find on doc" .Replacement.Text = textbox1.Text .Execute Replace:=wdReplaceAll End WithPerhaps not the best but it works.Cheers
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now