A
alisam
I haven't written a macro before and I can see parts of macros that I need
but don't know how to connect all of them together. Can anyone help?
I have a protected form. In separate Sections I use a REF field to link to
the Form Bookmark.
I wish to select protected Sections 10 and 11 and I found the macro below.
The full macro will need to:
1) Select Sections 10 and 11 which contain REF fields linked to bookmarks in
my Form
2) Convert the fields to Text via a ctrl shift F9
3) Copy the Sections 10 and 11
4) Open a new document and paste in sections 10 and 11 (with headers/footers)
5) The icing on the cake would be to generate the file name from 2 REF
fields which are linked to the 2 Bookmarks in the Form. The path will be
fixed and the filename will be in the format T12345_ABC.doc where T12345 is a
task no. and ABC is the client code.
6) Can I then back out any changes the macro may have made so if the
original document is accidently saved, there will be no damage done.
I can then add the macro to the tool bar, because I will then use the above
macro to generate another word document from another section i.e. section 12.
With ActiveDocument
.Range(.Sections(10).Range.Start, .Sections(11).Range.End).Select
Selection.Copy
End With
but don't know how to connect all of them together. Can anyone help?
I have a protected form. In separate Sections I use a REF field to link to
the Form Bookmark.
I wish to select protected Sections 10 and 11 and I found the macro below.
The full macro will need to:
1) Select Sections 10 and 11 which contain REF fields linked to bookmarks in
my Form
2) Convert the fields to Text via a ctrl shift F9
3) Copy the Sections 10 and 11
4) Open a new document and paste in sections 10 and 11 (with headers/footers)
5) The icing on the cake would be to generate the file name from 2 REF
fields which are linked to the 2 Bookmarks in the Form. The path will be
fixed and the filename will be in the format T12345_ABC.doc where T12345 is a
task no. and ABC is the client code.
6) Can I then back out any changes the macro may have made so if the
original document is accidently saved, there will be no damage done.
I can then add the macro to the tool bar, because I will then use the above
macro to generate another word document from another section i.e. section 12.
With ActiveDocument
.Range(.Sections(10).Range.Start, .Sections(11).Range.End).Select
Selection.Copy
End With