+ Reply to Thread
Results 1 to 3 of 3

Trouble looping through content control blocks in MS Word to then export to Excel

  1. #1
    Registered User
    Join Date
    04-08-2020
    Location
    San Diego, California
    MS-Off Ver
    MS 365 on a Mac
    Posts
    2

    Trouble looping through content control blocks in MS Word to then export to Excel

    Hello all,

    I am attempting to write a macro that will allow me to type data in MS Word using content control blocks (ccblocks) in groups of 25. I then want to extract that data and import in into Excel in the next available or empty row. I then want to move to the next 25 cc blocks in the word document, etc.

    I have partial success and I can accomplish my objective but the loop is not efficient and will not allow me automatically loop through groups of 25 blocks. I have to manually type in the number of blocks I want to loop through (using For i = 1 to 25, etc.) instead of just detecting the next 25 blocks. (these will always be in groups of 25 cc blocks). I at times might have hundreds or a thousand rows filled in the excel document so manually writing each set of blocks to loop through isn't efficient.

    What I currently have, I map to and open a word document from excel, this is necessary when working off my excel template.

    Please Login or Register  to view this content.
    Any assistance would be greatly appreciated. P.S. Im working with Office 365 on a MacBook Pro.

    Thank you

    /r
    mascon
    Last edited by mascon; 04-09-2020 at 11:28 AM. Reason: Missing code tags, clarity.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,444

    Re: Trouble looping through content control blocks in MS Word to then export to Excel

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    I did it for you this time. Please read forum rules. Thanks

  3. #3
    Registered User
    Join Date
    04-08-2020
    Location
    San Diego, California
    MS-Off Ver
    MS 365 on a Mac
    Posts
    2

    Re: Trouble looping through content control blocks in MS Word to then export to Excel

    Thank you for pointing out my error of not using tags. I will ensure it doesn't happen again.

    Thanks

    mascon

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Count checked fieldform and content control boxes from word using excel
    By morganhughes360 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-04-2015, 06:39 AM
  2. Excel Populating Microsoft Word Content Control DropDownList
    By Shanewjj in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-23-2014, 03:31 PM
  3. [SOLVED] Pull data to Word control content from Excel spreadsheet
    By coopman64 in forum Excel General
    Replies: 2
    Last Post: 06-30-2014, 10:05 PM
  4. Replies: 0
    Last Post: 07-02-2013, 08:40 AM
  5. VBA/Word picture content control causing unreadable content
    By atycks in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-15-2013, 04:51 PM
  6. Control word from vba/excel - export multiple oleobjects to word
    By mathengineer in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-17-2012, 11:09 AM
  7. Replies: 4
    Last Post: 12-17-2007, 08:11 AM

Tags for this Thread

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