Jean-Guy
Mon Jul 10 14:15:26 CDT 2006
RoVo was telling us:
RoVo nous racontait que :
> Hello,
> I am creating a userform that takes a string and adds it to the end
> of a different word file. For example, the current file has a text
> string inputted from the user via the form, and I need to take that
> string, then transfer it over to a existing file that already has text
> in it and paste it at the end. Any help would be appreciated.
Play around with this:
Dim strText As String
Dim docTarget As Document
Dim rgeDocTarget As Range
strText = "This String!"
Set docTarget = Documents.Open("C:\Your_Path\Document_Name.doc")
With docTarget
Set rgeDocTarget = .Range
rgeDocTarget.InsertAfter strText
.Close wdSaveChanges
End With
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site:
http://www.word.mvps.org