+ Reply to Thread
Results 1 to 13 of 13

Is Shape a textbox

  1. #1
    Registered User
    Join Date
    02-08-2004
    Posts
    23

    Is Shape a textbox

    Hi,

    Is it possible to find out if the selected item is a textbox through VB?

    Thanks!

  2. #2
    Registered User
    Join Date
    04-01-2008
    Posts
    54

    More clarity required

    Hi Sanjay,

    Can you please let me know your requirement Exaclty what are you expecting

  3. #3
    Registered User
    Join Date
    02-08-2004
    Posts
    23
    kamal,

    Thanks for replying, I have a routing that goes through all items on a page and changes the colour, but before chnaging the colour I would like to know if the selected item is a textbox or a drawig shape like a box, circle etc, if it a textbox I would only like to change the colour of the text not the fill border colour etc.

    Hope that's clearer!

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Sanjay,

    Here is VBA macro that will identify what a shape is.

    Return Shape Type Macro
    Please Login or Register  to view this content.
    Adding the Macro
    1. Copy the macro above pressing the keys CTRL+C
    2. Open your workbook
    3. Press the keys ALT+F11 to open the Visual Basic Editor
    4. Press the keys ALT+I to activate the Insert menu
    5. Press M to insert a Standard Module
    6. Paste the code by pressing the keys CTRL+V
    7. Make any custom changes to the macro if needed at this time
    8. Save the Macro by pressing the keys CTRL+S
    9. Press the keys ALT+Q to exit the Editor, and return to Excel.

    Code Usage Example
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  5. #5
    Registered User
    Join Date
    02-08-2004
    Posts
    23
    Leith,

    Thanks for the script I'll keep this in my repository, when I have group of items - I am returned with Autoshape - is there a way to identify each item in a group?

    Regards,

    Sanj

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Sanjay,

    If a Shape is comprised of other shapes or you have manually grouped shapes together you can. I would need to know more about the shapes in question. Can you post a workbook I could look at?

    Sincerely,
    Leith Ross

  7. #7
    Registered User
    Join Date
    02-08-2004
    Posts
    23
    Leith,

    Here is the link to a the sample document:

    PHP Code: 
    https://share.acrobat.com/adc/document.do?docid=c5a26702-034e-11dd-ba0b-339832c00dc6 
    The problem lies as the groups vary and will be added / removed by the user.

    Thanks for looking at this for me.

    Regards,

    Sanj

  8. #8
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Sanjay,

    Are these symbols being created by the user or a program? Are these being drawn on the Excel worksheet or imported?

    Thanks,
    Leith Ross

  9. #9
    Registered User
    Join Date
    02-08-2004
    Posts
    23
    Leith,

    They are created by the user in Excel - I reference them in a macro via the shape name s_1 etc

    Regards,

    Sanj

  10. #10
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Sanjay,

    Do you have a workbook will a few of these shapes on worksheet I could review?

    Sincerely,
    Leith Ross

  11. #11
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Sanjay,

    Never mind. It finally downloaded from the site.

    Sincerely,
    Leith Ross

  12. #12
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Sanjay,

    Here is macro that will return the count of Text Boxes in the Shape. You will have to supply the group object name in the code. The example uses "s_79".
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  13. #13
    Registered User
    Join Date
    02-08-2004
    Posts
    23
    Leith,

    Got it, your code makes sense now - thanks for taking time out to help me out.

    Regards,

    Sanj

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1