- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I can't find the right text to get the File path of a referenced document within an IAM.
I have the code below. This gets me the full path (including filename) for each child of the parent IAM (from which the rule was run). I'm just using a message box as a simple diagnostic tool, to show what I'm getting.
Instead of "FullFileName", how do I get the Path WITHOUT the filename and extension?
Yes, ThisDoc.Path works when I'm within the "root level", but refDoc.Path is not working in this case.
I feel I'm missing something obvious.
Dim oAsmDoc As AssemblyDocument = ThisApplication.ActiveDocument Dim oDoc As Document = ThisDoc.Document For Each refDoc As Document In oDoc.AllReferencedDocuments MessageBox.Show(refDoc.FullFileName, "file path")
Vault Professional 2021
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
you can try it like this:
Dim oAsmDoc As AssemblyDocument = ThisApplication.ActiveDocument
Dim oDoc As Document = ThisDoc.Document
For Each refDoc As Document In oDoc.AllReferencedDocuments
Dim path = System.IO.Path.GetDirectoryName(refDoc.FullFileName)
MessageBox.Show(path, "file path")
Next
Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Blog: hjalte.nl - github.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report