Results 1 to 4 of 4
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    range defiend insert autotext entry?

    in word97 - VBA

    I have a range defined & insert autotext entry in range.
    However I feel theres a much better way of handling or inserting autotext entries in ranges.

    Has anyone coded for this before?
    If so how have you handled?

    TIA Diana

  2. #2
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,853
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: range defiend insert autotext entry?

    How have you done it? I would normally use a bookmark and insert into the bookmark. It all depends on what you need the document to be capable of later.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  3. #3
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: range defiend insert autotext entry?

    I defined a range being current section header
    the variable 'strHeader1stPage' stores the autotext entry to be inserted into current header.
    I insert the text(autotext entry name) into the header range
    then I select & then insert autotext entry.

    Because I've used the select statement in the code - it wouldnt have mattered if I defined a range - is that right?

    code below:
    'define a range to only include autotext entry name
    rngHeader.Text = strHeader1stPage
    rngHeader.Select
    rngHeader.InsertAutotext

    cheers Diana

  4. #4
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: range defiend insert autotext entry?

    Hi Diana,

    I think the problem ties in with what's being discussed in the other thread about inserting autotext:

    Because you're using the InsertAutotext method, you're needing to select the portion of the header range that represents the autotext name.

    The more precise approach would be to use the method that was arrived at in the other thread, since it doesn't require you to do a select before inserting the autotext.

    See <A target="_blank" HREF=http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Cat=&Board=vb&Number=18205&page=0& view=expanded&sb=5#Post18205>this post</A>.

    Hope this helps,
    Gary

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •