Help with Macros and Templates

  • Thread starter Thread starter confused
  • Start date Start date
C

confused

I have a 2 template that gets populated by VB code; I want to open
template A then using windows run macro call template B and have
template B inserted as the first page of the template A. I can not
seem to get this to work. My data in template B gets put into
template A right in the middle of my Table of Contents.
 
I have a 2 template that gets populated by VB code; I want to open
template A then using windows run macro call template B and have
template B inserted as the first page of the template A. I can not
seem to get this to work. My data in template B gets put into
template A right in the middle of my Table of Contents.

Why don;t you just make a new Template C that combined A and B? Seems a
lot simpler and would take about 10 seconds.
 
Why don;t you just make a new Template C that combined A and B? Seems a
lot simpler and would take about 10 seconds.

I am doing something wrong, because I cant get this to work, is there
an article that you can point me to?
Is this something like a mater document?
 
I am doing something wrong, because I cant get this to work, is there
an article that you can point me to?
Is this something like a mater document?

I forgot to include that both templates have their own Header and
Footer, which I need to keep from losing those.
I have tried to use a master document, but I lose the header and
footer from template a when I try putting template b in front (which
is what I want to do)
 
You would have to show us the code.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

I am doing something wrong, because I cant get this to work, is there
an article that you can point me to?
Is this something like a mater document?

I forgot to include that both templates have their own Header and
Footer, which I need to keep from losing those.
I have tried to use a master document, but I lose the header and
footer from template a when I try putting template b in front (which
is what I want to do)
 
You would have to show us the code.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP


I forgot to include that both templates have their own Header and
Footer, which I need to keep from losing those.
I have tried to use a master document, but I lose the header and
footer from template a when I try putting template b in front (which
is what I want to do)- Hide quoted text -

- Show quoted text -

Not sure what code you want to see the code behind the coverpage.dot
or all the code in the DocLiB.dll
I have made serveral attempts and when I open the template 'B' and
want to insert template 'A' behind it, my headings in template 'A' are
no longer there on template 'A' I now have the heading from template
'B'

I really don't have any idea how to fix this.
 
The code that does the insertion of one "template" into the other.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

You would have to show us the code.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP


I forgot to include that both templates have their own Header and
Footer, which I need to keep from losing those.
I have tried to use a master document, but I lose the header and
footer from template a when I try putting template b in front (which
is what I want to do)- Hide quoted text -

- Show quoted text -

Not sure what code you want to see the code behind the coverpage.dot
or all the code in the DocLiB.dll
I have made serveral attempts and when I open the template 'B' and
want to insert template 'A' behind it, my headings in template 'A' are
no longer there on template 'A' I now have the heading from template
'B'

I really don't have any idea how to fix this.
 
The code that does the insertion of one "template" into the other.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP


You would have to show us the code.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
"confused" <[email protected]> wrote in message
Not sure what code you want to see the code behind the coverpage.dot
or all the code in the DocLiB.dll
I have made serveral attempts and when I open the template 'B' and
want to insert template 'A' behind it, my headings in template 'A' are
no longer there on template 'A' I now have the heading from template
'B'

I really don't have any idea how to fix this.- Hide quoted text -

- Show quoted text -

Hello;
I finally got the code to work (template "A" inserted into template
"B") , only problem now is pagenation, is there some way to code
opening template "A" in readonly mode then insert into template "B?
When the data is inserted the toc pagenation is off.
Below is how I am inserting template "A" into template "B"

Public Sub Fill(ByRef cW As cWord)
Dim sDoc$, sRoot$, s$

sRoot = (gstrDir & gstrDept & "\Template\")
s = Dir(sRoot, vbNormal)
sDoc = sRoot & s

If sDoc <> "" Then
DoEvents
nW.GotoBookMark "NewPage"
nW.InsertFile sDoc
End If

End Sub
 
The code that does the insertion of one "template" into the other.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
You would have to show us the code.
--
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP





Hello;
I finally got the code to work (template "A" inserted into template
"B") , only problem now is pagenation, is there some way to code
opening template "A" in readonly mode then insert into template "B?
When the data is inserted the toc pagenation is off.
Below is how I am inserting template "A" into template "B"

Public Sub Fill(ByRef cW As cWord)
Dim sDoc$, sRoot$, s$

sRoot = (gstrDir & gstrDept & "\Template\")
s = Dir(sRoot, vbNormal)
sDoc = sRoot & s

If sDoc <> "" Then
    DoEvents
    nW.GotoBookMark "NewPage"
    nW.InsertFile sDoc
End If

End Sub- Hide quoted text -

- Show quoted text -

I got the page renumbering to work, need to tweek the page renumbering
function created; template "A" has 3 first pages and I need to keep
those headers and footer; when template "A" in inserted into template
"B", the headers and footer of the 3 different first pages, keep
changing to template "B" header and footer.
Well thanks for the help, I will just keep working on this on my own.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top