P
Peter KNAP
Hi.
I am trying to create form for submission of applications where all used
forms are in one document in separate sections. After user open template of
this document macro asks him through UserForms what kind of application is he
asking for. Then he is asked to fill in the appropriate boxes in UserForms
and at the end only filed section is shown. Problem for me is that with
filled form also template document stays open.
I tried to write macro for closing source template document:
ActiveDcument.Close
but since template is actually active document last part of my macro:
Dim i As Long
i = 5
Dim source As Document, target As Document
Set source = ActiveDocument
Set target = Documents.Add
target.Range.FormattedText = source.Sections(i).Range.FormattedText
did not work because active document was no longer open then.
How could I solve this problem? I want user to see just UserForms and at the
end just part of the document he will print.
I am trying to create form for submission of applications where all used
forms are in one document in separate sections. After user open template of
this document macro asks him through UserForms what kind of application is he
asking for. Then he is asked to fill in the appropriate boxes in UserForms
and at the end only filed section is shown. Problem for me is that with
filled form also template document stays open.
I tried to write macro for closing source template document:
ActiveDcument.Close
but since template is actually active document last part of my macro:
Dim i As Long
i = 5
Dim source As Document, target As Document
Set source = ActiveDocument
Set target = Documents.Add
target.Range.FormattedText = source.Sections(i).Range.FormattedText
did not work because active document was no longer open then.
How could I solve this problem? I want user to see just UserForms and at the
end just part of the document he will print.