fumei
Mon Sep 24 14:37:46 CDT 2007
rman220 wrote:
>I am in desperate need of help. I need to create a macro that will copy
>specific strings of text from a word document to a word form. The document
>that the info is being pulled from is constantly being writen over w/ new
>information, but the information I need is always in the same location within
>the document. I have created a macro in our mainframe that copies data I
>need and pastes it as a laundry list on document zzz. From there I need that
>info to be placed into form aaa. The form is protected except for certan
>fields and I am pulling my hair out not getting anywhere. Please help me.
>
>Thanks,
>
>Ryan
Can you be a bit more specific? "specific strings of text from a word
document to a word form." That sounds like two different documents. Yes?
document zzz is a different document from "form" aaa.
form aaa is still a document...yes?
Are these formfields? If they are, then you simply make their .Result be
whatever you want.
If you have both documents open, then i suggest making each one a document
object. This is just to give you an idea. You would have to be actually
specific in order for me to be specific.
Dim SourceDoc As Document
Dim ResultDoc As Document
Set SourceDoc = your document zzz
Set ResultDoc = your "form" aaa
ResultDoc.Formfields("Yadda").Result = SourceDoc.Paragraphs(3).Range.Text
This would make the formfield "Yadda" in ResultDoc (form aaa) = the text of
paragraph 3 in SourceDoc (doc zzz)
Other than that, you are going to have to be clear and detailed in your
question.
--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/word-programming/200709/1