Opening a Number of Templates as Documents

C

Craig

I want to create a macro that can open 6 templates but have them open as a
document.

I tried some things with the Documents.open cmd but I still only managed to
open them as templates.

Any suggestions would be greatly appreciated
Craig
 
D

Doug Robbins - Word MVP

Use:

Documents.Add "template"

--
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
 
D

Doug Robbins - Word MVP

That will open the template file itself. To create a document from the
template, you would use

Documents.Add "C:\Full Path\To\Template.dot"

--
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
 
T

Tony Jollans

I can't tell from the question whether he wants to open the templates or
create new documents based on them. You're probably right, but one of us has
given what he wants for sure :)
 
C

Craig

Thanks

I did want to create a new document from the template.

(sorry for the delay)

Craig
 
C

Craig

Second Part to this:

How can I now get the document to connect to the source for a mail merge.
It seems to have lost all of the information (but not in the template)

Thanks

Craig
 
D

Doug Robbins - Word MVP

When I run the following command:

Documents.Add "C:\Full Path\To\Template.dot"

where Template.dot is a mailmerge main document, which has a datasource
attached to it and which has been saved as a template, the new document also
has that datasource attached to it and contains the mergefields that were in
the template so that all that has to be done is to execute the mailmerge.

--
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
 
C

Craig

I am unable to get the document to read from the data source.

If open up the template I get the datasource confirmation box :

"Opening this document will run the following SQL Command:
SELECT*FROM .....
Data from your database will be placed in the document. Do you want to
continue?"

But I do not get this option when opening the file from the macro:
Documents.Add

Any suggestions

Craig
 
D

Doug Robbins - Word MVP

See the following Knowledge Base article:

"Opening This Will Run the Following SQL Command" Message When You Open a
Word Document - 825765 at:

http://support.microsoft.com?kbid=825765 test

--
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
 

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

Top