Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » Visual Basic for Applications

Post new topic   Reply to topic
Using vb to copy and paste from word
View previous topic :: View next topic  
Author Message
Chris X1
Newbie


Joined: 10 Jan 2004
Posts: 1

PostPosted: Jan 10th, 2004 09:36 AM    Post subject: Using vb to copy and paste from word Reply with quote

Hello all
I am creating a database program and a feature will be to mail merge from microsoft word. The idea is to have the user write a letter and this would be copied into a variable in visual basic, here i can write code to place in names etc, the finalised letter then needs to be pasted back into word (either the original document or a new one, it does not matter). I can manipulate the letter myself, however, how do you copy and paste the letter into a visual basic variable? And how will i then be able to paste it back into word using vb?

Thanks for any help
Back to top
View user's profile Send private message
P.T.A.M.
Administrator


Joined: 08 Oct 2003
Posts: 752
Location: Greece

PostPosted: Jan 10th, 2004 04:00 PM    Post subject: Reply with quote

I suppose that with the [api]FindWindow[/api] and [api]FindWindowEx[/api] APIs you could get the handle of word. Then maybe with the [api]GetWindowText[/api] you could get the text and store it in a variable Wink
_________________
No one is completely useless. They can at least be an example of what to avoid.
Back to top
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
Andir
Centurion


Joined: 21 Dec 2003
Posts: 184
Location: Chicago Area

PostPosted: Jan 10th, 2004 07:57 PM    Post subject: Reply with quote

I think with the VBA code you wouldn't need to do that. As far as mail merge, I remember going to school and they tried to teach me how to do that without code. I can tell you it's possible, but I'm going to be away from a PC for about a week, so I won't get to try till I get back. Sorry :/
_________________
If you happen to see little people sitting on your desk...don't tell anyone or they might think your crazy too.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » Visual Basic for Applications All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic