PDA

View Full Version : Can i show a reference filepath?



BEASTOID
03-31-2009, 01:56 AM
Hi,

I am using a word document as a centralised code repository for other word documents.

As such i attach it to each document in the references section of the VBA editor.

All good so far!

I am also developing a msgbox that only appears in my development environments informing the developer on startup in which environment it is running in eg development or UAT (different folders).

And i ran into a problem!

I can list the file path and the header and data source file paths without any issue eg:

ActiveDocument.FullName
ActiveDocument.MailMerge.DataSource.HeaderSourceName

But How do i list the filepath for a reference?

Is it possible?

Any Help is greatly appreciated

(Running Word 2002 SP2)
















Word 2002 SP2

fumei
04-01-2009, 09:02 AM
"I am using a word document as a centralised code repository for other word documents."

Normally, this would be done using a global template (a .DOT file). These are add-ins, and they are precisely that, code containers.

They are NOT References, and are NOT loaded via References in the VBE. Those would be COM add-ins and are .EXE or .DLL files. (Or .OLB, .tlb files as well)

Is this what you are doing?

So could you please clarify what you mean by a reference?

fumei
04-01-2009, 01:07 PM
Would this help?

Dim oRef As Reference
For Each oRef In VBE.ActiveVBProject.References
Debug.Print oRef.FullPath
Next

BEASTOID
04-08-2009, 06:46 AM
Hi, yep this is a .dot file that contains common code i can apply accross multiple documents. I have attached it in the tools references section and can refer to the code modules without the need to type them all out again.

i tried adding this into my documents but it came up with a compile error:

user defined type not defined

Any idea's?
apologies for not replying for a while!

fumei
04-08-2009, 11:15 AM
"i tried adding this into my documents but it came up with a compile error:

user defined type not defined"

Ummm...added...what exactly? Please post code. Obviously there is an error in your code, but it is impossible to say what it is without actually seeing any code.