Sorry... We won't write code "for" you in here -- that's paid-for work.
We "would" send you code that would do this if we had it around (maybe
someone has...) but I doubt if anyone has suitable code.
I have, but it's written in VBA for the PC and could not be expected to work
on the Mac.
If you would like to post the code you have written so far (as plain text!!)
someone may agree to show you how to modify it to do what you want.
However, you have only 1,500 documents to do. In the time it would take you
to write code to do this, you would have done the job by hand. If you were
to start the VBA Macro recorder, then step through doing ONE document, stop
the macro recorder and post the result that it recorded here, I could help
you.
Come to think of it, let me be a little more helpful than that
Here is code that I recorded with the Word macro recorder that will do
exactly as you want (it assumes that the Source document contains ONLY the
text you want to add, and that when you Unprotect the document the cursor is
already in the correct place).
Making a macro to process all the files in a directory is quite advanced
coding: instead, double-click the files in the Finder one by one, and start
your Macro recording with the target file already open on the screen.
Edit the code below as needed Remove the first two statements if the file
is already open on the screen).
This article will help:
http://www.word.mvps.org/macwordnew/installmacromaccontent.htm
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 11 September 2005 by John McGhie
'
ChangeFileOpenDirectory "John
ocuments:MVP:"
Documents.Open FileName:="John
ocuments:MVP
ocument.doc", _
ConfirmConversions:=True, ReadOnly:=False, AddToRecentFiles:=False,
_
PasswordDocument:="", PasswordTemplate:="", Revert:=False, _
WritePasswordDocument:="", WritePasswordTemplate:="", Format:= _
wdOpenFormatAuto
ActiveDocument.Protect Password:="", NoReset:=False, Type:= _
wdNoProtection
ActiveDocument.Unprotect
ChangeFileOpenDirectory "John
ocuments:MVP:"
Documents.Open FileName:="John
ocuments:MVP:Source.doc", _
ConfirmConversions:=True, ReadOnly:=False, AddToRecentFiles:=False,
_
PasswordDocument:="", PasswordTemplate:="", Revert:=False, _
WritePasswordDocument:="", WritePasswordTemplate:="", Format:= _
wdOpenFormatAuto
Selection.WholeStory
Selection.Copy
ActiveWindow.Close
Selection.PasteAndFormat (wdPasteDefault)
ActiveDocument.Protect Password:="", NoReset:=False, Type:= _
wdAllowOnlyRevisions
ActiveDocument.Save
ActiveWindow.Close
End Sub
Cheers
Hi, I have about 1500 word docs that I have to open> unprotect> insert
two pages from another word doc at the beginning> protect> save> close
I haven't gotten very far with the dictionary. I'd like it to be a
subroutine if possible.
Thanks a lot for your help all.
--
Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.
John McGhie <
[email protected]>
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 4 1209 1410