Home |
Search |
Today's Posts |
#1
|
|||
|
|||
VBA function results in fields
Is it possible to have a document field return the result of a macro
function? I'm hopeing to have a field that would call a particular function each time it is updated and display the results. It's important that I'm able to pass a parameter to the function. The function might look sometimg like: public function foo(param as integer) as string ..... 'some calculations ...... foo = "my string" end function I'm aware that it's possible to update fields from macros but is it possible to have a field update itself? |
#2
|
|||
|
|||
You have posted this in an end-user NG; you would get a better response if
you post in one of the word.vba (programming) NGs. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "Robert Mulroney" wrote in message ... Is it possible to have a document field return the result of a macro function? I'm hopeing to have a field that would call a particular function each time it is updated and display the results. It's important that I'm able to pass a parameter to the function. The function might look sometimg like: public function foo(param as integer) as string .... 'some calculations ..... foo = "my string" end function I'm aware that it's possible to update fields from macros but is it possible to have a field update itself? |
#3
|
|||
|
|||
Use a double-barrel approach: insert a DocProperty or DocVariable field to
display your variable; then in your macro use the result to set the value of the document property or document variable and update fields. "Robert Mulroney" wrote in message ... Is it possible to have a document field return the result of a macro function? I'm hopeing to have a field that would call a particular function each time it is updated and display the results. It's important that I'm able to pass a parameter to the function. The function might look sometimg like: public function foo(param as integer) as string .... 'some calculations ..... foo = "my string" end function I'm aware that it's possible to update fields from macros but is it possible to have a field update itself? |
#4
|
|||
|
|||
Hi ?B?Um9iZXJ0IE11bHJvbmV5?=,
Is it possible to have a document field return the result of a macro function? I'm hopeing to have a field that would call a particular function each time it is updated and display the results. It's important that I'm able to pass a parameter to the function. No, this simply is not possible in Word. Too bad... Closest you could get in Word would be a MacroButton field that the user would have to click. Other than that, I can only imagine using something as a macro trigger (either a keyboard shortcut or a specific application event) to update information in the document. There are various things you could use as a "target". Cindy Meister INTER-Solutions, Switzerland http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004) http://www.word.mvps.org This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :-) |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Repost: Record 1 contained too few data fields | Mailmerge | |||
ASK and FILLIN fields in INCLUDETEXT documents do not merge correc | Mailmerge | |||
Word Compare and Merge Document Function | Microsoft Word Help | |||
Attempting to auto-update fields in a word document | Microsoft Word Help | |||
posting data from text input fields to fields later in document | Microsoft Word Help |