Wie und vor allem wo kann ich eine Fenster anzeigen lassen das mir der Benutzer einen Pfad angeben muss wo die Datei (PDF) peichert werden soll?
Derzeit mein PDF
Public Sub Dev_PDF()
' Get the PDF translator Add-In.
Dim PDFAddIn As TranslatorAddIn
Set PDFAddIn = ThisApplication.ApplicationAddIns.ItemById("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")
'Set a reference to the active document (the document to be published).
Dim oDocument As Document
Set oDocument = ThisApplication.ActiveDocument
Dim oContext As TranslationContext
Set oContext = ThisApplication.TransientObjects.CreateTranslationContext
oContext.Type = kFileBrowseIOMechanism
' Create a NameValueMap object
Dim oOptions As NameValueMap
Set oOptions = ThisApplication.TransientObjects.CreateNameValueMap
' Create a DataMedium object
Dim oDataMedium As DataMedium
Set oDataMedium = ThisApplication.TransientObjects.CreateDataMedium
' Check whether the translator has 'SaveCopyAs' options
If PDFAddIn.HasSaveCopyAsOptions(oDocument, oContext, oOptions) Then
' Options for drawings...
oOptions.Value("All_Color_AS_Black") = 0
'oOptions.Value("Remove_Line_Weights") = 0
'oOptions.Value("Vector_Resolution") = 400
'oOptions.Value("Sheet_Range") = kPrintAllSheets
'oOptions.Value("Custom_Begin_Sheet") = 2
'oOptions.Value("Custom_End_Sheet") = 4
End If
Dim oDoc As Document
Dim Länge_Dateiname_mit_Pfad As Integer
Dim Name_Pfad As String
Dim Pfad_export As String
Dim Länge_String As Integer
Dim Dateiname_mit_Pfad As String
Set oDoc = ThisApplication.ActiveDocument
'____________________________________________________________________iProperties_______________________________________
' Get the PropertySets object.
Dim oPropSets As PropertySets
Set oPropSets = oDoc.PropertySets
' Get the design tracking property set.
Dim oPropSet As PropertySet
Set oPropSet = oPropSets.Item("Design Tracking Properties")
' Get the drawing number iProperty.
'Dim status As Property
'Set status = oPropSet.Item("User Status")
'Get the ipt status iProperty
'Dim oDrawDoc As DrawingDocument
Set oDrawDoc = ThisApplication.ActiveDocument
Dim oReferencedDoc As Document
On Error Resume Next
Set oReferencedDoc = oDrawDoc.ReferencedDocuments.Item(1)
Dim oPropValue As String
oPropValue = oReferencedDoc.PropertySets.Item("{32853F0F-3444-11D1-9E93-0060B03C1CA6}").Item("User Status").Value
' Display the value.
'MsgBox "The part number is: " & oPropValue
'______________________________________________________________________iProperties__________________________________________
Dateiname_mit_Pfad = oDoc.FullFileName
Länge_Dateiname_mit_Pfad = Len(Dateiname_mit_Pfad)
Dim Endung As Integer
'Endung = 0 'mit .ipt usw.
Endung = 4 ' ohne .ipt usw
Name_Pfad = Mid(Dateiname_mit_Pfad, 1, Länge_Dateiname_mit_Pfad - 4)
Länge_String = Len(Name_Pfad)
Dim i As Integer
i = 1
Do Until Mid(Name_Pfad, Länge_String - i, 1) = "\"
i = i + 1
Loop
Dateiname = Right(Name_Pfad, i - Endung)
Name_Pfad = Mid(Dateiname_mit_Pfad, 1, Länge_Dateiname_mit_Pfad - i)
'Pfad_export = Left(Name_Pfad, 1, 1)
Dim source As String
Dim destination As String
source = "V"
destination = "J"
'Pfad_export = System.Text.RegularExpression.Regex.Replace(Name_Pfad, source, destination, RegexOptions.IgnoreCase)
'Name_Pfad.Replace(source, destination)
'Pfad_export = Mid(Name_Pfad, 2, Len(Name_Pfad))
'MsgBox "Dateiname : " & Dateiname & Chr(10) & "Pfad : " & Name_Pfad & Chr(10) & "Laufwerk: " & destination & Pfad_export
'Set the destination file name
If oPropValue = "" Then
oDataMedium.FileName = Name_Pfad & Dateiname & ".pdf"
Else
oDataMedium.FileName = Name_Pfad & Dateiname & "_" & oPropValue & ".pdf"
End If
'Publish document.
Call PDFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)
MsgBox "PDF Export abgeschlossen!", vbOKOnly, "PDF Erstellt!"
'Set shell = CreateObject("WScript.Shell")
'shell """C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe"" /C " & oDataMedium.FileName
'MsgBox oDataMedium.FileName
Shell "C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe " & oDataMedium.FileName, vbNormalFocus
End Sub
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP