J
Johnnyboy5
Hi
I have a document with some text, fields, field ref and a table in
it, some of the fields & ref populate a table lower down in the
document and then the macro will copy it a paste it into a new
document which can then be saved on its own.
The main document also has a number of other functions / purposes so I
dont really what to change it.
The problem.
If I put too much text in some of the "fields" when I use the Macro
the "line" number reference is wrong.
I need to know how to select the table and copy it ...or any other
ideas
Thanks
John
This is the macro I was using -
If ActiveDocument.ProtectionType <> wdNoProtection Then
ActiveDocument.Unprotect
End If
Selection.HomeKey Unit:=wdStory
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.MoveUp Unit:=wdLine, Count:=1
Selection.MoveDown Unit:=wdLine, Count:=120
Selection.MoveLeft Unit:=wdCharacter, Count:=6
Selection.MoveDown Unit:=wdLine, Count:=75, Extend:=wdExtend
Selection.Copy
' reprotect without emptying the fields
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, _
Noreset:=True
ChangeFileOpenDirectory "f:\1 CASE NOTES\"
Documents.Open FileName:="""2 blank UA sheet.doc""",
ConfirmConversions:= _
False, ReadOnly:=False, AddToRecentFiles:=False,
PasswordDocument:="", _
PasswordTemplate:="", Revert:=False,
WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto,
XMLTransform:=""
Selection.WholeStory
Selection.Paste
Selection.WholeStory
Selection.Font.Size = 10
Selection.WholeStory
Selection.Fields.Unlink
Selection.HomeKey Unit:=wdStory
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.MoveDown Unit:=wdLine, Count:=1
I have a document with some text, fields, field ref and a table in
it, some of the fields & ref populate a table lower down in the
document and then the macro will copy it a paste it into a new
document which can then be saved on its own.
The main document also has a number of other functions / purposes so I
dont really what to change it.
The problem.
If I put too much text in some of the "fields" when I use the Macro
the "line" number reference is wrong.
I need to know how to select the table and copy it ...or any other
ideas
Thanks
John
This is the macro I was using -
If ActiveDocument.ProtectionType <> wdNoProtection Then
ActiveDocument.Unprotect
End If
Selection.HomeKey Unit:=wdStory
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.MoveUp Unit:=wdLine, Count:=1
Selection.MoveDown Unit:=wdLine, Count:=120
Selection.MoveLeft Unit:=wdCharacter, Count:=6
Selection.MoveDown Unit:=wdLine, Count:=75, Extend:=wdExtend
Selection.Copy
' reprotect without emptying the fields
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, _
Noreset:=True
ChangeFileOpenDirectory "f:\1 CASE NOTES\"
Documents.Open FileName:="""2 blank UA sheet.doc""",
ConfirmConversions:= _
False, ReadOnly:=False, AddToRecentFiles:=False,
PasswordDocument:="", _
PasswordTemplate:="", Revert:=False,
WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto,
XMLTransform:=""
Selection.WholeStory
Selection.Paste
Selection.WholeStory
Selection.Font.Size = 10
Selection.WholeStory
Selection.Fields.Unlink
Selection.HomeKey Unit:=wdStory
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.MoveDown Unit:=wdLine, Count:=1