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. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 15 Times in 15 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.

  4. #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
  •