View Single Post
 
Old 01-01-2015, 01:53 PM
ptmuldoon ptmuldoon is offline Windows 7 64bit Office 2013
Advanced Beginner
 
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