Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    May 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,

    I am looking for some help on VBA code to count the number of command button clicks in a word doc and export the final count to a excel spreadsheet.

    Any help would be appreciated.

    Thanks and regards,
    Ananta

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    [quote name='Ananta' post='774047' date='06-May-2009 23:40']I am looking for some help on VBA code to count the number of command button clicks in a word doc and export the final count to a excel spreadsheet.[/quote]
    Word supports internal Document Variables as a potential place to store a running count of clicks. Do you intend for the user to click the buttons and export his or her own results, or will data need to be gathered from multiple users? I ask because the option to remove private data on save may create complications for storing clicks in the document itself.

  3. #3
    Silver Lounger
    Join Date
    Jul 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    1,609
    Thanks
    0
    Thanked 1 Time in 1 Post
    [quote name='Ananta' post='774047' date='07-May-2009 02:40']Hi,

    I am looking for some help on VBA code to count the number of command button clicks in a word doc and export the final count to a excel spreadsheet.

    Any help would be appreciated.

    Thanks and regards,
    Ananta[/quote]

    The attached file provides a working example roughly along the lines identified by Jefferson. It creates a csv file which Excel can open. Note that you will have to set the filespec constant in the Document_Close procedure to a viable pathname.
    Attached Files Attached Files
    Regards
    Don

Posting Permissions

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