C
Cravaus
I have minimal knowledge of VBA. I have been surching google all day
yesterday to solve this problem and found no solutions that work.
I am trying to create a new FDF file to export data to a PDF form and launch
the file on a button click. I am having trouble with creating the new file.
The code I am using (and is not working) is the following:
Private Sub FDF_Click()
Dim stPDFdata As String
Dim chkName As String
'I want to check to see if the fdf file exists and if not make a new one. I
know this works for directories but it does not check for the file. Need help
here.
chkName = "C:\My File\New.fdf"
If Dir(chkName, vbDirectory) = "" Then
MkDir (chkName)
End If
StPDFdata = "<</T(lastName0)/V(" & [Last Name] & ")>>" &
<</T(FirstName0)/V(" & [First Name] & ")>>"
'I want to print the data to the fdf file. Here it says that the path does
not exist.
Open chkName For Output As #1
Print #1, stPDFdata
Close #1
'Now I want to launch my fdf file.
Application.FollowHyperlink chkName
End Sub
What do I do to get this to work?
yesterday to solve this problem and found no solutions that work.
I am trying to create a new FDF file to export data to a PDF form and launch
the file on a button click. I am having trouble with creating the new file.
The code I am using (and is not working) is the following:
Private Sub FDF_Click()
Dim stPDFdata As String
Dim chkName As String
'I want to check to see if the fdf file exists and if not make a new one. I
know this works for directories but it does not check for the file. Need help
here.
chkName = "C:\My File\New.fdf"
If Dir(chkName, vbDirectory) = "" Then
MkDir (chkName)
End If
StPDFdata = "<</T(lastName0)/V(" & [Last Name] & ")>>" &
<</T(FirstName0)/V(" & [First Name] & ")>>"
'I want to print the data to the fdf file. Here it says that the path does
not exist.
Open chkName For Output As #1
Print #1, stPDFdata
Close #1
'Now I want to launch my fdf file.
Application.FollowHyperlink chkName
End Sub
What do I do to get this to work?