Switch OptionSet in VBa

About the programming interface for the virtual PDF printer driver.

Moderator: jr

Herrie
Posts: 6
Joined: Thu Feb 26, 2015 6:48 pm

Switch OptionSet in VBa

Post by Herrie »

A double question

a: does it make sense to programmatically switch OptionSet ini ?
Example: before printing from vba (Excel)
set a specific OptionSet file
After finishing the job,
set the 'original' OptionSet file

would the code below be the best solution??

[code]
Part from an existing sub routine..

oPdfSettings.LoadSettingsFile (sLocation & "Theeketel Option Set.ini")
If oPdfSettings.getvalue("optionsetname") <> "" Then 'this is a name I wrote in the ini file myself, but it is not stable
fp = oPdfSettings.getvalue("optionsetname")
Else
fp = oPdfSettings.getvalue("author")
End If
'test it
Debug.Print fp

'loadBasic Option Set.ini
oPdfSettings.LoadSettingsFile (sLocation & "Basic Option Set.ini")
If oPdfSettings.getvalue("optionsetname") <> "" Then
fp = oPdfSettings.getvalue("optionsetname")
Else
fp = oPdfSettings.getvalue("author")
End If
'test it
Debug.Print fp

End Sub
[/code]

Any suggestions?