Varga,
If you want the filename then you can derive it from the oDocument object.
The property you want is called FullFileName.
(When in the VBA environment place a period after any object to see what properties and methods it contains.)
'-----
' Change the sub routine: Output_DXF_PDF to:
'-----
Public Sub Output_DXF_PDF()
Dim oDocument As Inventor.Document
Dim sPath As String
Dim PN As String
' VBA requires the keyword "Set" when instantiating an Object variable
Set oDocument = ThisApplication.ActiveDocument
' Set Path and base file name
sPath = "C:\Users\varga\Desktop\"
PN = GetFileName(oDocument.FullFileName)
PN = sPath & PN
' Call the translation sub routines
Call TranslateFile(PN, ".dxf", oDocument)
Call TranslateFile(PN, ".pdf", oDocument)
' Clean up objects
Set oDocument = Nothing
End Sub
'-----
' Add the following Function (It is used in the above sub routine.)
'-----
Private Function GetFileName(Byval sFullFileName as string) as string
Dim sFileName as string
Dim nPos as integer
Dim sFileName = sFullFileName
nPos = instrRev$(sFullFileName,"\")
if nPos > 0 then
sFileName = Mid$(sFullFileName,nPos+1)
End if
GetFileName = sFileName
End Function