Hallo Zusammen
Habe mir ein kleies Script zusammengestellt, welches mir nach ein paar anderen Schritten
eine Zeichnung als PDF speichert.
So weit funktionniert das auch, nun möchte ich aber nicht, dass mir ein
vorhandenes File (mit dem selben Namen) automatisch überschrieben wird.
Ich möchte in dem Fall die selbe Frage gestellt bekommen wie wenn ich manuell
eine Datei "Speicher unter" wähle und die schon besteht.
Hier mal ein Teil vom Code:
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
' Create File Name and Path
If Len(Trim(dDoc.FullFileName)) > 0 Then
outFile = fso.GetParentFolderName(dDoc.FullFileName) & "\" & fso.GetBaseName(dDoc.FullFileName) & ".pdf"
'dDoc.SaveAs outFile, True
Else
MsgBox "Bitte zuerst das IDW Speichern!", vbInformation, "...Toni..."
End If
'Set the destination file name
oDataMedium.FileName = outFile
'Publish document.
Call PDFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)
------------------
Grüsse, Toni
Rechtschreibefehler gehören dem findigen Finder
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP