Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-09-2014, 07:31 AM
shanemarkley shanemarkley is offline Macro to pull data out of a Word table Windows 7 64bit Macro to pull data out of a Word table Office 2010 64bit
Novice
Macro to pull data out of a Word table
 
Join Date: Dec 2013
Posts: 29
shanemarkley is on a distinguished road
Default

Thank you for fixing the first part of that script Geoff G. It works great so far.

My apologies to both of you for not explaining this better. The table in the Word Doc contains the following 7 columns:

UserID, AP Name, AP Group, Model, Mounting, MAC Addr, Notes

These columns are where the output pulls the information from. The items in the output in " " need to be pulled from the column tables. Here is what the output template looks like:

provision-ap copy-provisioning-params ap-name "«MAC_Addr»"
provision-ap installation default
provision-ap no external-antenna
provision-ap server-name aruba-master


provision-ap ap-group "«AP_Group»"
provision-ap ap-name "«AP_Name»"
provision-ap no syslocation
provision-ap no remote-ap
provision-ap no fqln
provision-ap reprovision ap-name "«MAC_Addr»"

Here is an example of the first two rows:

provision-ap copy-provisioning-params ap-name 9c:1c:12:c5:a6:c8
provision-ap installation default
provision-ap no external-antenna
provision-ap server-name aruba-master
provision-ap ap-group PollockLocal2-PollockHalls
provision-ap ap-name UP.Beaver-AP003
provision-ap no syslocation
provision-ap no remote-ap
provision-ap no fqln
provision-ap reprovision ap-name 9c:1c:12:c5:a6:c8


provision-ap copy-provisioning-params ap-name 9c:1c:12:c5:a0:78
provision-ap installation default
provision-ap no external-antenna
provision-ap server-name aruba-master
provision-ap ap-group PollockLocal2-PollockHalls
provision-ap ap-name UP.Beaver-AP004
provision-ap no syslocation
provision-ap no remote-ap
provision-ap no fqln
provision-ap reprovision ap-name 9c:1c:12:c5:a0:78

I would need the script to create an output like the ones above for each row in the table. Some of these tables can easily be a couple hundred rows.

Thank you both again very much for your help!
Reply With Quote
  #2  
Old 04-09-2014, 10:23 AM
Geoff_G Geoff_G is offline Macro to pull data out of a Word table Windows XP Macro to pull data out of a Word table Office 2010 32bit
Novice
 
Join Date: Apr 2014
Posts: 6
Geoff_G is on a distinguished road
Default

I am not sure the attached is what you want, but have a look.

Data in your table is output to a new Word document in the format you describe.

If a row in your table does not contain a valid MAC address in the Notes column, that row is skipped in the output document.

The number at the end of line 6 is increased by one for each block of text. If a row is skipped in your table, a number is NOT skipped in the output file. That can be changed if required.

If the format is wrong, please say what you need.
Attached Files
File Type: zip Sample AP Inventory.zip (53.5 KB, 20 views)
Reply With Quote
  #3  
Old 04-09-2014, 04:30 PM
Geoff_G Geoff_G is offline Macro to pull data out of a Word table Windows XP Macro to pull data out of a Word table Office 2010 32bit
Novice
 
Join Date: Apr 2014
Posts: 6
Geoff_G is on a distinguished road
Default

On reviewing your table, I have realised that you want the AP Name and AP Group taken from columns 2 and 3. (At least, I think you do.)

The VBA macros in the attached document do just that.

Incidentally, there was a programming error in the error handler in the previous versions I posted: I put Err.No instead of Error.Number. I have corrected that in the attached version.

Are the macros now doing what you want?
Attached Files
File Type: zip Sample AP Inventory.zip (52.9 KB, 26 views)
Reply With Quote
  #4  
Old 05-13-2014, 08:36 PM
joeynguyen2508 joeynguyen2508 is offline Macro to pull data out of a Word table Windows 7 64bit Macro to pull data out of a Word table Office 2007
Novice
 
Join Date: May 2014
Posts: 1
joeynguyen2508 is on a distinguished road
Default Thank You

Your work saved me hours. Thank you so much for your contribution. I was able to learn and make modification to your script to make changes that work for my data.

Thank you Geoff G.
Reply With Quote
  #5  
Old 05-14-2014, 11:31 AM
Geoff_G Geoff_G is offline Macro to pull data out of a Word table Windows XP Macro to pull data out of a Word table Office 2010 32bit
Novice
 
Join Date: Apr 2014
Posts: 6
Geoff_G is on a distinguished road
Default Hey Joey

Very many thanks for your feedback - it's nice to know one's efforts are appreciated.

I think a documented code example is an easier way to get to grips with something (rather than, say, a wordy explanation), but they do take some work to put together.

I'm glad you were able to adapt the code to meet your objectives.

Geoff
Reply With Quote
  #6  
Old 05-03-2015, 09:40 AM
arelone arelone is offline Macro to pull data out of a Word table Windows 7 64bit Macro to pull data out of a Word table Office 2010 64bit
Novice
 
Join Date: May 2015
Posts: 2
arelone is on a distinguished road
Default

how can i access the code to edit it? Can someone me please!

Last edited by arelone; 05-03-2015 at 04:26 PM.
Reply With Quote
  #7  
Old 05-03-2015, 09:33 AM
arelone arelone is offline Macro to pull data out of a Word table Windows 7 64bit Macro to pull data out of a Word table Office 2010 64bit
Novice
 
Join Date: May 2015
Posts: 2
arelone is on a distinguished road
Default

hi,
this file work great, but can you help me create one for the criteria below:

provision-ap read-bootinfo ap-name "18:64:72:c6:07:5e"
provision-ap copy-provisioning-params ap-name "18:64:72:c6:07:5e"
provision-ap installation indoor
provision-ap a-ant-gain 6
provision-ap g-ant-gain 4
provision-ap ap-group "8236"
provision-ap ap-name "8236_AP012"
provision-ap syslocation "Attendance Office, Main Building 1st Fl"
provision-ap reprovision ap-name "18:64:72:c6:07:5e"
clear provisioning-ap-list

i need one to populate syslocation
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to pull data out of a Word table VBA Code to take data from a table in word document and place it in a summary table VBLearner Word VBA 1 03-09-2014 08:42 PM
Macro to pull data out of a Word table Pull address from Outlook into Word SteveM5000 Word 3 05-11-2012 07:00 PM
Excel VBA: Pull data from web tinfanide Excel Programming 0 12-09-2011 02:11 AM
Pull Outlook Meeting Information into Word alhare Word 0 02-01-2011 12:51 PM
Macro to pull data out of a Word table macro to pull data from multiple files psrs0810 Excel 2 10-25-2010 01:49 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:03 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft