Results 1 to 7 of 7
  1. #1
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Shape Trouble (Word 97SR2)

    This code used to work fine.

    Dim DraftBox as Shape
    Set DraftBox = ActiveDocument.Shapes.AddTextbox(msoTextOrientatio nHorizontal, 25, 25, 180, 80) 'Left, Top, Width, Height

    But now I get Type Mismatch. What am I missing now?

    Could somebody test this and set me right?
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  2. #2
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Shape Trouble (Word 97SR2)

    I'm using Word 2000- it works OK for me. Sorry, I can't check out 97.
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

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

    Re: Shape Trouble (Word 97SR2)

    It works fine in my Word 97 SR2. Perhaps you have conflicting references (more than one library with a Shape object). Try

    Dim DraftBox As Word.Shape

    (You could use the Object Browser to check if more than one Shape object is defined)

  4. #4
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Shape Trouble (Word 97SR2)

    Why do I get the bizarre stuff?

    Since posting I've installed Office XP and Office 11 (beta) on a test PC.

    Same message "Type mismatch" on this line:

    Set RABox = ActiveDocument.Shapes.AddTextbox(msoTextOrientatio nHorizontal, 45, 15, 200, 70, 1) 'Left, Top, Width, Height

    I tried Word.Shape. No help, but show good thinking. Is this not extremely weird or what?

    Maybe it's something in Windows. All my desktops are Win2k, SP3. IE 6 SP1. What are you running on?
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  5. #5
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Shape Trouble (Word 97SR2)

    Geoff,
    Thanks for testing. See my response to Hans. Please.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

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

    Re: Shape Trouble (Word 97SR2)

    The code still works fine on Win2K/Off2k, WinXP/Off2K, and Win98/Off97. There must be something you're not telling us. <img src=/S/scold.gif border=0 alt=scold width=50 height=15> What has happened to your machine since the last time it worked? See if you admin didn't add some "security" patch.
    <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>

  7. #7
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Shape Trouble (Word 97SR2)

    I am such an idiot... I have told a falsehood. <img src=/S/liar.gif border=0 alt=liar width=25 height=22>

    First I posted this:
    Set DraftBox = ActiveDocument.Shapes.AddTextbox(msoTextOrientatio nHorizontal, 25, 25, 180, 80)
    (which indeed does work FINE -- oh my.....)

    thinking it was the same construction as this which I posted second:
    Set RABox = ActiveDocument.Shapes.AddTextbox(msoTextOrientatio nHorizontal, 45, 15, 200, 70, 1)

    which does not work because (as I have just discovered) that 1 is not a valid Anchor parameter. That
    must be range object.

    How that 1 got in there is a mystery (and embarrassment) to me.

    Sorry.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

Posting Permissions

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