WordBasic

H

Helen Walters

Although a proficient Word user I'm new to WordBasic. Here's what I need - is
it unrealistic? - and can you direct me to a more appropriate site if
necessary.

1. An autoopen macro which will unprotect the form, then select a section,
then add it to the AutoText entry list with a name, then protect the form
again.

2. On clicking a command button - for it to unprotect the document again,
then go to an existing bookmark, insert the said autotext entry, and then
reprotect the document.

Will be glad of help please.
Helen

2. An autoclose macro which will go to the AutoText entries and remove the
entry from the list.

I've looked at the Help files, and borrowed a book on Visual Basic, but
frankly I'm too inexperienced in code to benefit, unless I take months....
 
W

Word Heretic

G'day "Helen Walters" <[email protected]>,

Go straight to word.mvps.org/FAQs/index.htm and ENJOY :)

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


Helen Walters reckoned:
 
H

Helmut Weber

Hi Helen,

by the way,
the time of WordBasic ended in 1997, I think.
Then it was Visual Basic for Applications, VBA, or WordVBA,
which might be outdated soon. Seems Visual Studio for Office
will take over.
Just in case you might not find the information you need,
when searching for WordBasic.
1. An autoopen macro which will unprotect the form, then select a section,
then add it to the AutoText entry list with a name, then protect the form
again.

2. On clicking a command button - for it to unprotect the document again,
then go to an existing bookmark, insert the said autotext entry, and then
reprotect the document.

2. An autoclose macro which will go to the AutoText entries and remove the
entry from the list.

Can all be done.
First, I think, you don't need the autotext at all.
You may set the text of a bookmark to a range,
which defines some text elsewhere in the doc.

Have a look at this one, omitting unprotect
and protect for simplicity. Not to mention
different kinds of bookmarks, [...] vs. |

Sub autoopen()
Dim rTmp1 As Range
Dim rTmp2 As Range
Set rTmp1 = ActiveDocument.Range(0, 10)
' a bookmark of kind [...]
Set rTmp2 = ActiveDocument.Bookmarks("Mark01").Range
rTmp2.Text = rTmp1.Text
' bookmark vanishes, has to be redefined, if necessary
rTmp2.Bookmarks.Add Name:="Mark01", Range:=rTmp2
End Sub

HTH

Greetings from Bavaria, Germany

Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
http://word.mvps.org/
 

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