Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Mar 2008
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    VBA error formfield Word 2003 (English Word 2003)

    Hi lounge,

    Please see attached with error message in 1 page formfield VBA Word 2003 document (should be a .dot). The autotext tables attached to template will not insert (they do, then they don't) and so it goes. Formfields protection is on.
    The code is marked with error with 3 asterisks.

    Getting desperate.
    Attached Files Attached Files

  2. #2
    Silver Lounger
    Join Date
    Jul 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    1,609
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: VBA error formfield Word 2003 (English Word 2003)

    Hi
    I believe that you have two options, either:
    1. <LI>revise the offending line to 'Template name goes here.AutoTextEntries("Autotext entry name goes here").Insert', or
      <LI>insert a line preceding the offending as shown in the attachment
    Attached Images Attached Images
    Regards
    Don

  3. #3
    New Lounger
    Join Date
    Mar 2008
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA error formfield Word 2003 (English Word 2003)

    None of those things work:

    Sub DDAutotext1()

    'DropDown Autotext



    Dim DropResult As String

    ' Get result of the form field.
    DropResult = ActiveDocument.FormFields("Dropdown1").Result

    ' UnProtect the document.
    ActiveDocument.Unprotect

    Call DeleteSubject

    With Selection


    ' Go to location to insert Autotext

    .GoTo What:=wdGoToBookmark, Name:="Table1"

    ' Insert AutoText name chosen from dropdown list
    '.InsertAfter DropResult **This line puts in the selected item


    ' Insert the AutoText
    '.Range.InsertAutoText **THIS LINE just gives error


    .GoTo What:=wdGoToBookmark, Name:="StartHere"






    End With

    ' Re-Protect the document.



    If ActiveDocument.ProtectionType = wdNoProtection Then
    ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
    End If


    End Sub

  4. #4
    Silver Lounger
    Join Date
    Jul 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    1,609
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: VBA error formfield Word 2003 (English Word 2003)

    Sorry; I can't help you.
    Regards
    Don

  5. #5
    New Lounger
    Join Date
    Mar 2008
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA error formfield Word 2003 (English Word 2003)

    Thank you for trying much appreciated.

    I've got form working but not sure it hold up - but for moment it works - but when I make the next adjustment it won't I don't think. But that's for tomorrow not today

    Thanks again. What can I say I got the code off MS website you'd think it would behave better!!!! surely.

    Bye <img src=/S/bingo.gif border=0 alt=bingo width=15 height=22>

Posting Permissions

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