Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Get text from form into Word 2010 Document via VBA in .Doc - can't use .Docx 500pnts

Posted on 2014-09-11
2
Medium Priority
?
375 Views
Last Modified: 2014-09-18
Ok,

So ideally what I want to do is have a form with text boxes which a user will fill out when they click the "OK" button the macro should do the following

Copy text string from the text box on the form and paste the value at a book mark in the document.

For example Form1.Text Box with value of "Pat" the macro needs to go to to bookmark FName and paste the content from Form1.Text Box ie "Pat"...

Or I just need to know how to get the value of variable to paste into a document at a certain bookmark...
0
Comment
Question by:ise438
2 Comments
 
LVL 77

Accepted Solution

by:
GrahamSkan earned 2000 total points
ID: 40318182
Try this to start with:
Sub CommandButton1_Click()
     ActiveDocument.BookMarks("Pat").Range.Text  = UserForm1.TextBox1.Text
End Sub

Open in new window

0
 

Author Closing Comment

by:ise438
ID: 40329928
Worked a treat thank you...
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.
Suggested Courses

569 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question