Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    England
    Posts
    569
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Macro Autotext woes...

    Hi,

    I have recorded a table & some text to an Autotext entry.
    When I manually insert the entry, it looks perfect.
    Then I record a macro to do the same - when I execute the macro, the Styles are lost! So I get plain text instead of Heading 1...

    Pls. advise; thanks.

    m.q.

  2. #2
    KTYorke
    Guest

    Re: Macro Autotext woes...

    I've done the same and it works just fine... so it is possible...
    What I did was to record the text only as autotext.
    Then I recorded -adding the table, applying the style and then inserting the autotext- in the macro itself.
    I'm not so hot with VBA code but by doing the above I have a line in the macro:
    <hr>Selection.Style = ActiveDocument.Styles("Table Text")<hr>
    hope that helps...
    have fun

  3. #3
    JustCallMeAl
    Guest

    Re: Macro Autotext woes...

    Do you know how to edit a macro?

    If so, please supply the line which inserts the autotext.

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

    Re: Macro Autotext woes...

    If you, for example, recorded a macro of inserting the "Ladies and Gentlemen:" autotext entry from Normal.dot, the relevant code you'd get would be:

    NormalTemplate.AutoTextEntries("Ladies and Gentlemen:").Insert Where:= _
    Selection.Range

    What's missing from the recorded code is a reference to the RichText property; just amend the line of code eg.:

    NormalTemplate.AutoTextEntries("Ladies and Gentlemen:").Insert Where:= _
    Selection.Range, RichText:=True

    (this is probably what Al was intending to lead you to<g>)

  5. #5
    JustCallMeAl
    Guest

    Re: Macro Autotext woes...

    Yup.

Posting Permissions

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