Strings between different templates

U

Ulf Nilsson

Hi,
We have a form where users can open different templates.

When a user clicks on a template, the chosen template opens and I want it to
go to a specific bookmark. To which bookmark it goes to depends on what the
user has chosen in the first form.

In other words: How can I transfer strings between different templates?


/ Ulf
 
J

Jezebel

Your 'other words' seems to be a completely different question. 'Going to a
bookmark' and 'transferring strings' are completely different things (to me,
anyway). Forget your proposed method for a moment: what are you actually
trying to achieve?
 
U

Ulf Nilsson

Sorry for being unclear.
Template A is a long document which is divided into sections. Each section
is a bookmark.

When a user choose a template (which in reality is the name of a bookmark in
Template A), Template A opens. I want Template A to continue to the specific
bookmark.

I know how to make Template A to open, but not how to make Template A to
know which bookmark to user.

/ Ulf
 
J

Jezebel

Is 'template A' really a template, or just a document? If it's a document,
you can use a hyperlink, with the bookmark argument; or

Documents.Open(FileName:=[FileName]).GoTo What:=wdGoToBookmark,
Name:=[BookmarkName]

If it is a template, use

Documents.Add(Template:=[TemplateName]).GoTo What:=wdGoToBookmark,
Name:=[BookmarkName]
 
U

Ulf Nilsson

Thanks!
Is it possible to send a text string for the vba-code in Template A to use?

Jezebel said:
Is 'template A' really a template, or just a document? If it's a document,
you can use a hyperlink, with the bookmark argument; or

Documents.Open(FileName:=[FileName]).GoTo What:=wdGoToBookmark,
Name:=[BookmarkName]

If it is a template, use

Documents.Add(Template:=[TemplateName]).GoTo What:=wdGoToBookmark,
Name:=[BookmarkName]




Ulf Nilsson said:
Sorry for being unclear.
Template A is a long document which is divided into sections. Each section
is a bookmark.

When a user choose a template (which in reality is the name of a bookmark
in
Template A), Template A opens. I want Template A to continue to the
specific
bookmark.

I know how to make Template A to open, but not how to make Template A to
know which bookmark to user.

/ Ulf
 
U

Ulf Nilsson

I'm sorry to tell you that:
Documents.Add(Template:=gsChosenTemplate).GoTo What:=wdGoToBookmark,
Name:=gsChosenTemplateName

It just opens the chosen template and does not go to any bookmark, even
though the bookmark exists in the template.

/ Ulf




Jezebel said:
Is 'template A' really a template, or just a document? If it's a document,
you can use a hyperlink, with the bookmark argument; or

Documents.Open(FileName:=[FileName]).GoTo What:=wdGoToBookmark,
Name:=[BookmarkName]

If it is a template, use

Documents.Add(Template:=[TemplateName]).GoTo What:=wdGoToBookmark,
Name:=[BookmarkName]




Ulf Nilsson said:
Sorry for being unclear.
Template A is a long document which is divided into sections. Each section
is a bookmark.

When a user choose a template (which in reality is the name of a bookmark
in
Template A), Template A opens. I want Template A to continue to the
specific
bookmark.

I know how to make Template A to open, but not how to make Template A to
know which bookmark to user.

/ Ulf
 
C

Charles Kenyon

Rather than creating documents / opening templates, consider using AutoText.
Note, in Word jargon, a "template" is a special kind of document, not a
pattern or a form. http://addbalance.com/usersguide/templates.htm.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide




--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 

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