Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2006

Tip: Looking for answers? Try searching our database.

Autotext code not working all of a sudden!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mark - 16 Mar 2006 22:08 GMT
I have autotext stored in aglobal template which I callupon from code stored
in that global template and place it in the current document:

    Selection.EndKey Unit:=wdStory ' goto end of document
   ThisDocument.AttachedTemplate.AutoTextEntries(sMG12).Insert Where _
       :=Selection.Range, RichText:=True  'Insert autotext entry

For some strange reason, this has stopped working, can anyone assist me with
a solution, please?

Signature

Mark

Charles Kenyon - 16 Mar 2006 23:15 GMT
ThisDocument is the document which holds your code, probably a template.
Unless it is the same template that holds your AutoText your code isn't
likely to work. The attached template for a template is the template itself
as far as I have been able to tell.

When you say it has stopped working, what has stopped? Does it go to the end
of your document? Does it give you an error message?

If the name of the AutoTextEntry is MG12 I would include it in quotation
marks.
Signature

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

See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!
--------- --------- --------- --------- --------- ---------
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.

>I have autotext stored in aglobal template which I callupon from code
>stored
[quoted text clipped - 7 lines]
> with
> a solution, please?
Mark - 16 Mar 2006 23:57 GMT
Hi Charles,

The autotext is held in this template.

The MG12 is a defined string with loads of variations so the code in the
document that calls the code in the template with the autotext sets the
string first.

The error code I am now getting is: Run time error 32809 Application-defined
or object defined error.

Mark

> ThisDocument is the document which holds your code, probably a template.
> Unless it is the same template that holds your AutoText your code isn't
[quoted text clipped - 17 lines]
> > with
> > a solution, please?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.