Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Apr 2001
    Location
    Warrington, Cheshire
    Posts
    355
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Word Autoshapes (Eng/Word97/sr2)

    Very happy with the forms layout of a word document but I am trying to add a function to place a circle around a piece of text when clicked.
    The solution I have is to add a label to the document and then place an autoshape over the label with wrapping as none and no fill. The autoshape is then visible or not visible on the labels OnClick event.
    No problems so far with getting that to work and no problem when the form is protected.
    Currently I have 37 "yes" and "no" pieces of text that require the individual autoshape to be visiblenot visible. This far is working OK.
    But, when I save the document as a template that's when it all goes pear shaped.
    When a new document is created based on the template the autoshape naming seems to increment (or in some cases decrement) by 5, so the original shape name of say "Oval 50" is now "Oval 55" and the first five oval names do not exist. Hence, when you click the first text label, the circle appears around the fifth "yes" or "no" text.
    Anyone had this experience before and if so, is there a solution other than not saving as a template?

    Secondly, I also find references to documents in the temp directory which I have to remove from within the vde. Not knowing the reference name before opening the vde is there a way to remove as part of a procedure without removing all of the references?

    TIA

    Alan
    Cheshire
    UK

  2. #2
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Word Autoshapes (Eng/Word97/sr2)

    If you could try to make a small document that has this problem and attach it to a post, it would be a great help. Attach the original document with instructions as to how you save/use the template.

    Also, how are you creating the circles? If you are doing it in VBA, I would try using the Name property to implement a different naming scheme than the one Word uses. If you are creating them manually, then I would write a macro that allows you to change the name, so that you can manually enforce your naming scheme. --Sam
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  3. #3
    3 Star Lounger
    Join Date
    Apr 2001
    Location
    Warrington, Cheshire
    Posts
    355
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Word Autoshapes (Eng/Word97/sr2)

    Word document attached as zip file.
    Zip (38k in size) contains word document with same name - 180kb in size.
    The word document is called ACT1.doc and contains label onclick events for approx 37 labels. Each label calls a sub to reveal or hide the labels associated autoshape.
    The autoshapes are all present in the document but may be hidden or revealed by clicking on the Y or N labels.
    In the word document it all works fine and clicking on the relevant text encircles it with a circle autoshape.
    So far, so good.
    Now save the document as a word template (I use my local drive rather than the workgroup templates). I have used the same filename for my template.
    Using word I then go Filenew and create a new act1 document.
    In this new document when I click on the label text the associated autoshape either does not exist or has been renumbered elsewhere in the document.

    Other than saving the document as a template I will be sending a document to the client as read only and requesting they open the document then save_as each time they want a new document.

    Any helpcorrectionsnew pair of eyes would be much appreciated.
    TIA
    Alan
    Cheshire
    UK
    Attached Files Attached Files

  4. #4
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Word Autoshapes (Eng/Word97/sr2)

    Alan, just testing out the document, before saving it as a template, I noticed that the first 7 Y/N's work OK, but after that things are out of sync. Is it possible that you only tested at the top in the document and then in the middle of the template? HTH --Sam
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  5. #5
    3 Star Lounger
    Join Date
    Apr 2001
    Location
    Warrington, Cheshire
    Posts
    355
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Word Autoshapes (Eng/Word97/sr2)

    Sammy, I ran through all of the YN's before and after testing as template and the autoshapes are definitely 'renumbered' on a template based document. Having tried out the document on a.n.other workstation it appears there is a small irksome problem of "page creep" but this is not too much of an issue at the moment and is separate to the main prob.
    I got opportunity to take your advice and used the same onclick events to rename each autoshape with my own naming (i.e. CircA1; CircB1; CircA2 etcetera depending on which question they refer to). It worked!! The document was saved as a template and the new template based files Autoshapes all behaved as originally intended in the locations as originally placed. It still doesn't explain why the autoshapes are renumbering each time the new document is created but it does mean we now have a workable document. Many thanks for the advice. (I noticed also that by using a msgbox and activedocument.shapes.count I got a result of 78 items, although I can only think of 74 items having been created - 37 labels and 37 autoshapes. Is word mysteriously creating its own shapeslabels I wonder?)
    The only part left to resolve is the 'detachment' of the references in the vde which appear to be the temp files names e.g. ~WD07432
    Regards
    Alan
    Cheshire
    UK

Posting Permissions

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