Paste clipboard item to field through VBA?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi. I am using Access 2003 and Word 2000...don't ask :) I am copying data from resumes we receive out of Word and pasting into an Access table. I can manually copy 5 or 6 items in Word and they appear in the Office Clipboard, and then manually paste those items into fields in Access. What I would like to know is if there is a way to handle this in VBA - is there? It seems rather silly that I can't set a procedure that pulls these 5 or 6 items (name, address, city, blahblahblah) from Word, and referencing these items in the Clipboard through VBA
Can anyone point me in the right direction

-Jaime
 
Try this link to see if it helps..

http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/dnimo01/html/imo1200.asp

TC.
-----Original Message-----
Hi. I am using Access 2003 and Word 2000...don't ask :) I
am copying data from resumes we receive out of Word and
pasting into an Access table. I can manually copy 5 or 6
items in Word and they appear in the Office Clipboard, and
then manually paste those items into fields in Access.
What I would like to know is if there is a way to handle
this in VBA - is there? It seems rather silly that I can't
set a procedure that pulls these 5 or 6 items (name,
address, city, blahblahblah) from Word, and referencing
these items in the Clipboard through VBA.
 
Thanks for the link, Tony! I'll take a swing at this today
Note to future searchers: Copy & paste both halves of the link on the same address line in your browser. The first half only gets you to the Top level page of the MSDN Library site. :

-Jamie
 
Jaime Nelson said:
Huh. The information from the linked page helped a great deal, and
then I ran into another one of Word 2000's quirks. After creating a
Word template containing fields, as the linked document described, I
tried to automate the field population process. It seems that when
you try to open a new document based on this template containing
fields through a macro, the template itself opens up, causing the
user to mess up the formatting of the fields. However, if I navigate
to the template through Windows Explorer (not through File --> Open
in Word) a new document opens up based on the template, like it is
supposed to. Why is that? Is there a way to programmatically stop the
template from opening as an editable document and instead open
properly as a new document based on the template? Here's some of my
code, to show what is going on.

'This code launches a document called MyWordFormTemplate not Document2
'The template contains formatted fields which will be populated
through VBA or a user
Documents.Open("C:\Temp\MyWordFormTemplate.dot").Activate

I'm no Word maven, but I think you need to use

Documents.Add("C:\Temp\MyWordFormTemplate.dot").Activate

instead of Documents.Open.
 
Whoops! What a noobie's mistake that was! Thanks Dirk. I feel rather sheepish right now

I did find anotherissue, but I will take it over to the Word forum, as my Access problems have been fixed. Thank you all! :)
 
Back
Top