Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-31-2014, 08:27 AM
ptmuldoon ptmuldoon is offline Using FieldCodes, AutoText, BuildingBlocks Windows 7 64bit Using FieldCodes, AutoText, BuildingBlocks Office 2013
Advanced Beginner
Using FieldCodes, AutoText, BuildingBlocks
 
Join Date: Sep 2014
Posts: 93
ptmuldoon is on a distinguished road
Default Using FieldCodes, AutoText, BuildingBlocks

Our Company just upgraded to Office 2013, and as I continue to my learning of VBA and so on, I’m trying to learn the best way to achieve the following.
Currently, I have created a Word Template file that the end user will create a new document from. Within that template is approximately 70+ OLE links to an Excel File to pull various tables and charts. And I have a separate macro (thanks Macropod!) in the Word Startup folder to let the user change the OLE links to a different excel (Workpaper) file. And it all works fairly well so far.

Now, my ‘problem’ is that if the end user deletes a table or chart, they really don’t know how to add that chart back to the document. So my thought was to have some kind of drop down menu/list of the all of the charts where the user could insert the chart back into the document.

So my first thoughts are:

1. The ability to reference the Excel file in a Custom Field, and have a macro where the user could change that Field Code value to the current excel workpaper file.

2. Then have a listing of all tables and charts that would look at that file and be able to re-insert them into document where needed. I think maybe each chart would also need a separate custom field code, and could a) reference the field code made in item 1 above to get the current file path/name, and b) also reference the appropriate cells/named ranges for the table or chart?



I’ve just started reading on the use of Field Codes, Autotext, and Building blocks, and think the use of these may be a start in the right direction. But I’m not sure which of these is the best approach or if I’m even going in the right direction.

Any help/push in the right direction would be great. I can then hopefully begin reading some more and begin work on VBA code, etc as I learn.

Thanks
Paul
Reply With Quote
  #2  
Old 12-31-2014, 12:18 PM
ptmuldoon ptmuldoon is offline Using FieldCodes, AutoText, BuildingBlocks Windows 7 64bit Using FieldCodes, AutoText, BuildingBlocks Office 2013
Advanced Beginner
Using FieldCodes, AutoText, BuildingBlocks
 
Join Date: Sep 2014
Posts: 93
ptmuldoon is on a distinguished road
Default

in doing some more reading, I think what I'm trying to do is possible. I found these posts/discussions here and am going to start trying to play and learn.

I think it involves a combination of setting up custom fields with VBA and using the GetProperty and SetProperty functions?

http://stackoverflow.com/questions/4...der-to-ms-word

http://www.cpearson.com/excel/docprop.aspx
Reply With Quote
  #3  
Old 12-31-2014, 03:13 PM
ptmuldoon ptmuldoon is offline Using FieldCodes, AutoText, BuildingBlocks Windows 7 64bit Using FieldCodes, AutoText, BuildingBlocks Office 2013
Advanced Beginner
Using FieldCodes, AutoText, BuildingBlocks
 
Join Date: Sep 2014
Posts: 93
ptmuldoon is on a distinguished road
Default

Greg Maxey is Awesome!!!

I think using Building Blocks is the Way to go.

If I assign all my charts and tables a custom Building Block, the user can then reinsert them.

http://gregmaxey.com/word_tip_pages/..._autotext.html

Now, I just need to learn how to modify a building block to change its excel file source, and then learn to create a menu, dropdown etc of the custom blocks for the user to use to insert them where needed.
Reply With Quote
  #4  
Old 01-01-2015, 09:49 AM
Charles Kenyon Charles Kenyon is offline Using FieldCodes, AutoText, BuildingBlocks Windows 7 64bit Using FieldCodes, AutoText, BuildingBlocks Office 2010 32bit
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,453
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

  1. You don't modify building blocks, you re-create them. You call a building block, make your modifications, and then resave it under the same name.
  2. Look into categories.
  3. Look at the WordArt Add-In on my site for an example of a custom QAT entry of Building Blocks, in this case AutoText. All of the building blocks were stored in a custom gallery and then a link to that gallery is placed on the QAT. This is all stored in a custom template which is added as a Global Template.
You can build a custom menu, but it is a lot more work than a custom gallery control.
Reply With Quote
  #5  
Old 01-01-2015, 01:53 PM
ptmuldoon ptmuldoon is offline Using FieldCodes, AutoText, BuildingBlocks Windows 7 64bit Using FieldCodes, AutoText, BuildingBlocks Office 2013
Advanced Beginner
Using FieldCodes, AutoText, BuildingBlocks
 
Join Date: Sep 2014
Posts: 93
ptmuldoon is on a distinguished road
Default

Thanks Charles.

It may be time to move this topic over to the Word VBA section or I can start a new post there as well.

I'm learning and experimenting, and am trying to figure out how can I modify both fieldcodes and Building Blocks in VBA to accept variables and/or other field codes.

Example would be.

I have Building block that is an OLE link to a table in Excel. That building block value in debug looks something like this:
Code:
* LINK Excel.SheetMacroEnabled.12 "C:\\NewPath\NewFile.xlsm" "Receivable Charts!Charts_Receivable_ARTrendPrior" \a \p ***
I'm also assuming the the * is a replacement for the curly brackets { } of Link.

But I want the user to be able to replace the filepath/filename of the building block, and hopefully without being asked to resave the building blocks template file.

My thought was to use a FieldCode(s) of the filepath and filename in the Building Block. And then a macro to update those 2 field codes, and the building blocks would then not need to changed.

But I'm not sure if that is the best approach. I'm also struggling similarly to replace a fieldcode value with a new value from a variable.

I'm gonna keep playing. But greatly for any help, and I'll post some sample code shortly.

EDIT: Think I got the updating/modifying of Field Code with a variable figured out. Now, I need to research how to combined field codes together in side of each other.
Reply With Quote
  #6  
Old 01-02-2015, 01:33 PM
Charles Kenyon Charles Kenyon is offline Using FieldCodes, AutoText, BuildingBlocks Windows 7 64bit Using FieldCodes, AutoText, BuildingBlocks Office 2010 32bit
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,453
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

See also Greg Maxey's Build & Deploy Custom Buildign Block Galleries.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Using FieldCodes, AutoText, BuildingBlocks How do I edit AutoText? TommyVincent Outlook 2 08-01-2014 08:20 AM
Using FieldCodes, AutoText, BuildingBlocks Autotext jafrapatty Word 2 05-09-2014 04:30 AM
Using FieldCodes, AutoText, BuildingBlocks Autotext within Fields gotmatt Word 2 06-29-2011 06:05 PM
Using FieldCodes, AutoText, BuildingBlocks Copying autotext jafrapatty Office 3 01-30-2011 01:11 AM
AutoText Updates Ludovico Word 0 07-11-2010 06:10 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:38 AM.


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