By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,863 Members | 838 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,863 IT Pros & Developers. It's quick & easy.

changing code by code

P: n/a
hi y'all!

i want to implement a few macros to help me do my coding; when calling a
macro: how i can i find out in which module i'm currently in; at which
position and what text i have selected. it's gotta be possible somehow, but
the screen-objekt really isn't of much help. can anyone help me?

thanks in advance!

mike maercker
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
I don't know about macros. You might be able to use them to run code you
write. But if you are up to coding, you need to set a reference to the
'Microsoft Visual Basic for Applications Extensibility 5.3'. It provides
the interface for modifying/returning information about code modules.

The CodePane object returns information about the code/module being viewed
in the IDE. CodePane.CodeModule property will tell you which module is
being viewed in the in the IDE. Using the CodePane's GetSelection method you
can retrieve information about the currently selected text.

The CodeModule object allows to locate, identify, modify lines of code in a
particular module.

I have not checked to see what kind of documentation Microsoft has on
programming using the IDE object. You can use the object browser to look at
it and retrieve information about its object model, properties and methods.
Some Wrox Publishing books contain reference information about the IDE
object. The "Excel 2000 VBA Programmer's Reference" does and it is what 1st
introduced me the IDE object. I don't have my copy handy ( it is packed
away) so I just used the object browser to search out the information above.

--
Jeffrey R. Bailey
"Maercker Michael" <nc*********@netcologne.de> wrote in message
news:bl**********@newsreader2.netcologne.de...
hi y'all!

i want to implement a few macros to help me do my coding; when calling a
macro: how i can i find out in which module i'm currently in; at which
position and what text i have selected. it's gotta be possible somehow, but the screen-objekt really isn't of much help. can anyone help me?

thanks in advance!

mike maercker

Nov 12 '05 #2

P: n/a
TR
What version of Access are you using?
If 97, IMHO an add in is the easiest way to accomplish this.

If 2000/2002, an add-in is the easiest way too, but its a completely
different beast, best built in VB.

I have some code examples for both, what version are you using?
"Maercker Michael" <nc*********@netcologne.de> wrote in message
news:bl**********@newsreader2.netcologne.de...
hi y'all!

i want to implement a few macros to help me do my coding; when calling a
macro: how i can i find out in which module i'm currently in; at which
position and what text i have selected. it's gotta be possible somehow, but the screen-objekt really isn't of much help. can anyone help me?

thanks in advance!

mike maercker

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.