Thanks, just what I was looking for.
Henrik
"CVAengineering" skrev i en meddelelse
news:5769507@discussion.autodesk.com...
Oop.,. use
case kPresentationDocumentObject for case else
since there are more than 4 cases.
CVA
--
www.CVAengineering.com
IV11 Pro. sp2 and IV2008 Pro. sp1
Vault 2008 sp1
Window XP Pro sp2
Pentium 3.2 Ghz, 3.0 GB of RAM
NVIDIA FX 3400 91.85
SpacePilot V 3.3.6
"CVAengineering" wrote in message
news:5769471@discussion.autodesk.com...
use this simple code to figure out what type of document
Select Case ThisApplication.ActiveDocumentType
Case kDrawingDocumentObject
Debug.Print ".idw type"
'do something
Case kAssemblyDocumentObject
Debug.Print ".iam type"
'do something
Case kPartDocumentObject
Debug.Print ".ipt type"
'do something
Case Else
Debug.Print "ipn type"
'do something
End Select
--
www.CVAengineering.com
IV11 Pro. sp2 and IV2008 Pro. sp1
Vault 2008 sp1
Window XP Pro sp2
Pentium 3.2 Ghz, 3.0 GB of RAM
NVIDIA FX 3400 91.85
SpacePilot V 3.3.6
"Henrik" wrote in message
news:5766487@discussion.autodesk.com...
When I try to find the extension of the file that I'm working on, I have to
turn off "hide filetypename for known filetype". That means that myh program
only works on pc with shown filetype (extension), and not others. Is there a
way to find fileextension, that's not depending of setting "Hide filtypename
for known filetype".?
Her is my program, working fine with showing filetype name.....
Dim invDoc As Document
Set invDoc = ThisApplication.ActiveDocument
Dim file_type1 As String
file_type1 = Right(invDoc.DisplayName, 3)
Select Case file_type1
Case "ipt"
' MsgBox "det er en ipt fil"
' do somthing
Case "iam"
'MsgBox "det er en iam fil"
' do something else
Case "idw"
MsgBox "det er en idw fil"
Case "ipn"
' MsgBox "det er en ipn fil"
' do really something else.
End Select
best regards Henrik