Retrieving values in Macros

  • Thread starter Thread starter Chris Allen
  • Start date Start date
C

Chris Allen

Group,
I have a macro which has a bunch of RunApp Action items in
it. The problem is that I want to change the values that
are in the Command Line based on a condition (i.e. what
city you are in). Is there a way PROGRAMMATICALLY to
retrieve these contents and update the macro command text?

For example, say the Macro Name is abc and the Action is
RunApp. In the Command Line window it says winword
abc.doc. Is there a programmatic way to retrieve this
text and change it to winword def.doc?
 
Define programmatically.

If you want the macro to ask you for the value, replace the
winword abc.doc

with
="winword " & InputBox("enter the filename without extension") & ".doc"
 
Programmatically, meaning during execution of the
application without user input. Here is the problem:
I have an Access 97 application that has several macros
which have hard-coded drive letters for paths to certain
files. I need to be able to change the hard-coded drive
letter to a UNC naming convention without any user
intervention.
For example, the current macro has the following Command
line of winword M:\abc.doc. I want to change this to be
winword \\<somefileshare>\abc.doc to eliminate the
dependence on having the <somefileshare> mapped as M:

I have tried to do this through the DAO object model using
the containers/scripts/documents hierarchy but
unfortunately, none of the properties will display the
contents of the macros. Other than converting all of the
macros to VBA code, is there another way to access the
Command Line text and change during application execution
without user intervention?
 
I do not have knowledge about this, so I can't provide comments directly on
what you want.

However, perhaps you could use a public function that would return a string
with the correct servershare info, and then use that function in the macro's
command line (similar to what I posted before) to be able to use the desired
info.
 
Chris,

You could possibly have a local table where you store the path to the
server as seen from each client machine, and then refer to this in the
macro argument, for example...
="winword " & DLookup("[ServerPath]","UserDefaults") & "abc.doc"
 
Back
Top