Yes it seems so.
Carls, I don't find an easy method so far, however, I believe calling
Windows API can be the "safe" method to perform this task, we can send the
filename string to the dialog window by Windows API; below is a sample to
get start, this sample send string "hello" to notepad window.
Option Compare Database
Option Explicit
Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" _
(ByVal hWnd As Long, ByVal Msg As Long, wParam As Any, lParam As Any) As
Long
Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" _
(ByVal hWndParent As Long, ByVal hwndChildAfter As Long, ByVal lpszClass As
_
String, ByVal lpszWindow As String) As Long
Private Const WM_SETTEXT = 12
Private Sub Command0_Click()
ToNotePad "hello"
End Sub
Public Sub ToNotePad(x As String)
'assuming notepad is open
Dim h As Long, ed As Long, t As Long
h = FindWindow("Notepad", "Untitled - Notepad")
If (h <> 0) Then
ed = FindWindowEx(h, 0, "Edit", "")
If (ed <> 0) Then
SendMessage ed, WM_SETTEXT, ByVal 0, ByVal x
Else
MsgBox "Could not find notepad's edit"
End If
Else
MsgBox "Could not find notepad"
End If
End Sub
Please feel free to reply to the thread if you have any questions or
concerns.
Sincerely,
Alick Ye, MCSD
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
| From: "Allen Browne" <
[email protected]>
| References: <
[email protected]>
<
[email protected]>
| Subject: Re: Hiding a dialog box while creating a pdf
|
| Carls has not told us what version of Acrobat they use, but from memory,
| Keri's method is not too helpful with the more recent versions of Acrobat,
| since it relies on a setting in win.ini which the new versions don't read.
|
| --
| Allen Browne - Microsoft MVP. Perth, Western Australia.
|
|
| | > Hi Carls,
| >
| > Do you have any chance to try Keri Hardwick method?
| >
| >
http://www.mvps.org/access/reports/rpt0011.htm
| >
| > I did not test it however, based on the code line below, we can specify
| the
| > filename by code instead of inputting it on the dialog window at run
time,
| > which should be the thing you are after.
| >
| > Call aht_apiWriteProfileString("Acrobat PDFWriter", _
| > "PDFFileName", NewFileName)
| >
| > ChangePdfFileName "Name of pdf file including .pdf"
| >
| > Please let me know if the above information helps.
| >
| >
| > Sincerely,
| >
| > Alick Ye, MCSD
| > Microsoft Online Partner Support
| >
| > Get Secure! -
www.microsoft.com/security
| > This posting is provided "as is" with no warranties and confers no
rights.
| >
| >
| >
| > --------------------
| > | Content-Class: urn:content-classes:message
| > | From: "Carls" <
[email protected]>
| > | X-Tomcat-NG: microsoft.public.access.modulesdaovba
| > |
| > | I am creating a pdf file in Access when it prints the
| > | file to my pdf writer it displays a dialog box asking me
| > | for a filename. Is there a way to accept the default
| > | automatically and not display this box? I have tried the
| > | send keys function but it is very inconsistant.
|
|
|