Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Jun 2007
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Send as Attachment Modifying Control Numbers (Word 2003 sp2)

    I have a Word document containing buttons which I open and delete specific objects in a separate module via -

    Dim myShape As Shape
    * * *With ActiveDocument
    * * * * * *For Each myShape In .Shapes
    * * * * * * * * *If myShape.Name = "Control 7" Or _
    * * * * * * * * * * * *myShape.Name = "Control 11" Then
    * * * * * * * * * * * *myShape.Delete
    * * * * * * * * * End If
    * * * * * *Next myShape
    * * *End With

    It works fine when folks create an email via Outlook and add document as an attachment, BUT
    when they do File>Send To>Mail Recipient as Attachment the wrong shapes are deleted when I
    run the module to delete.

    It's as if the document is going through a recompile and the controls are being renumbered.

    I can disable the menu option, but is there any way to prevent this?

    Thanks,
    Al

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 18 Times in 18 Posts

    Re: Send as Attachment Modifying Control Numbers (Word 2003 sp2)

    You could name the controls explicitly. You can then use

    ActiveDocuments.Shapes("MyShape").Delete

    instead of looping through the Shapes collection.

  3. #3
    Lounger
    Join Date
    Jun 2007
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Send as Attachment Modifying Control Numbers (Word 2003 sp2)

    Thanks,
    Al

Posting Permissions

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