If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
If you'd scrolled through the list you get when you use the
Tools|References menu command in the VB Editor you would have found the "Microsoft Office Document Imaging 11.0 Type Library". Once you've set a reference to a library you can see what it contains by hitting F2 to launch the Object Browser. I don't know how to program MODI; it doesnt' seem to expose an Application object. However, as a general rule if you want to print a document you can find out how by going to the Folder Options in Windows Explorer. Switch to the File Types tab, find the type you're interested in, and click Advanced... Then select Print and click Edit... Under "Application used..." you'll usually find a Windows shell command that will do the job. For TIFF files on my computer, it's "C:\Program Files\Common Files\Microsoft Shared\MODI\11.0\MSPVIEW.EXE" /p "%1" where %1 would be replaced by the file to be printed. (This information is also available under program control by using API calls to read the corresponding registry entries). On Mon, 18 Apr 2005 12:44:14 -0700, "Shadow" wrote: Dim xwordobj as object set xwordobj = CreateObject(word.Application) the above code creates a reference to Mocrosoft word. How can I create a reference to Document Imaging ( an application in office2003)? ( I'm trying to print a .tif file. Van T. Dinh - Dan Aruso - Alex and Douglas J. Steele showed me how to print .doc and .pdf files through vba in a previous help request and now I'm trying to print a .tif file) Any kind of help is much appreciated -- John Nurick [Microsoft Access MVP] Please respond in the newgroup and not by email. |
#2
|
|||
|
|||
PS best to use early binding.
"John Nurick" wrote in message ... If you'd scrolled through the list you get when you use the Tools|References menu command in the VB Editor you would have found the "Microsoft Office Document Imaging 11.0 Type Library". Once you've set a reference to a library you can see what it contains by hitting F2 to launch the Object Browser. I don't know how to program MODI; it doesnt' seem to expose an Application object. However, as a general rule if you want to print a document you can find out how by going to the Folder Options in Windows Explorer. Switch to the File Types tab, find the type you're interested in, and click Advanced... Then select Print and click Edit... Under "Application used..." you'll usually find a Windows shell command that will do the job. For TIFF files on my computer, it's "C:\Program Files\Common Files\Microsoft Shared\MODI\11.0\MSPVIEW.EXE" /p "%1" where %1 would be replaced by the file to be printed. (This information is also available under program control by using API calls to read the corresponding registry entries). On Mon, 18 Apr 2005 12:44:14 -0700, "Shadow" wrote: Dim xwordobj as object set xwordobj = CreateObject(word.Application) the above code creates a reference to Mocrosoft word. How can I create a reference to Document Imaging ( an application in office2003)? ( I'm trying to print a .tif file. Van T. Dinh - Dan Aruso - Alex and Douglas J. Steele showed me how to print .doc and .pdf files through vba in a previous help request and now I'm trying to print a .tif file) Any kind of help is much appreciated -- John Nurick [Microsoft Access MVP] Please respond in the newgroup and not by email. |
#3
|
|||
|
|||
thanks for your reply.
I've added Office document to the references but I'm not able to find it in Object Browser. I'm trying to print some .tif files through vba in an access database when a user clicks a print button. It would be great if you explain how "C:\Program Files\Common Files\Microsoft Shared\MODI\11.0\MSPVIEW.EXE" /p "%1" can be used in vba. Thanks for your help. "JohnFol" wrote in message ... PS best to use early binding. "John Nurick" wrote in message ... If you'd scrolled through the list you get when you use the Tools|References menu command in the VB Editor you would have found the "Microsoft Office Document Imaging 11.0 Type Library". Once you've set a reference to a library you can see what it contains by hitting F2 to launch the Object Browser. I don't know how to program MODI; it doesnt' seem to expose an Application object. However, as a general rule if you want to print a document you can find out how by going to the Folder Options in Windows Explorer. Switch to the File Types tab, find the type you're interested in, and click Advanced... Then select Print and click Edit... Under "Application used..." you'll usually find a Windows shell command that will do the job. For TIFF files on my computer, it's "C:\Program Files\Common Files\Microsoft Shared\MODI\11.0\MSPVIEW.EXE" /p "%1" where %1 would be replaced by the file to be printed. (This information is also available under program control by using API calls to read the corresponding registry entries). On Mon, 18 Apr 2005 12:44:14 -0700, "Shadow" wrote: Dim xwordobj as object set xwordobj = CreateObject(word.Application) the above code creates a reference to Mocrosoft word. How can I create a reference to Document Imaging ( an application in office2003)? ( I'm trying to print a .tif file. Van T. Dinh - Dan Aruso - Alex and Douglas J. Steele showed me how to print .doc and .pdf files through vba in a previous help request and now I'm trying to print a .tif file) Any kind of help is much appreciated -- John Nurick [Microsoft Access MVP] Please respond in the newgroup and not by email. |
#4
|
|||
|
|||
Hey Shadow,
Can you please fix your system clock? Your in the future, so that means you posts will remain on top for a while. Thanks Dan Artuso, MVP "Shadow" wrote in message ... Dim xwordobj as object set xwordobj = CreateObject(word.Application) the above code creates a reference to Mocrosoft word. How can I create a reference to Document Imaging ( an application in office2003)? ( I'm trying to print a .tif file. Van T. Dinh - Dan Aruso - Alex and Douglas J. Steele showed me how to print .doc and .pdf files through vba in a previous help request and now I'm trying to print a .tif file) Any kind of help is much appreciated |
#5
|
|||
|
|||
CreateObject
Dim xwordobj as object
set xwordobj = CreateObject(word.Application) the above code creates a reference to Mocrosoft word. How can I create a reference to Document Imaging ( an application in office2003)? ( I'm trying to print a .tif file. Van T. Dinh - Dan Aruso - Alex and Douglas J. Steele showed me how to print .doc and .pdf files through vba in a previous help request and now I'm trying to print a .tif file) Any kind of help is much appreciated |
#6
|
|||
|
|||
Didn't someone just explain to you how to do the equivalent thing for
PDF files? Anyway, it would take something along thesse lines: Dim strFileToPrint As String Dim strCmd as String strFileToPrint = "C:\My Folder\My File.tif" 'or whatever strCmd = """C:\Program Files\Common Files\Microsoft Shared\" _ & "MODI\11.0\MSPVIEW.EXE"" /p """ & strFileToPrint & """" Shell strCmd On Mon, 18 Apr 2005 21:54:36 +0900, "Shadow" wrote: It would be great if you explain how "C:\Program Files\Common Files\Microsoft Shared\MODI\11.0\MSPVIEW.EXE" /p "%1" can be used in vba. -- John Nurick [Microsoft Access MVP] Please respond in the newgroup and not by email. |
#7
|
|||
|
|||
"Shadow" wrote in message
I'm so sorry. It's fixed now Doesn't seem to be. -- Dirk Goldgar, MS Access MVP www.datagnostics.com (please reply to the newsgroup) |
#8
|
|||
|
|||
thank you for the details.
"John Nurick" wrote in message ... Didn't someone just explain to you how to do the equivalent thing for PDF files? Anyway, it would take something along thesse lines: Dim strFileToPrint As String Dim strCmd as String strFileToPrint = "C:\My Folder\My File.tif" 'or whatever strCmd = """C:\Program Files\Common Files\Microsoft Shared\" _ & "MODI\11.0\MSPVIEW.EXE"" /p """ & strFileToPrint & """" Shell strCmd On Mon, 18 Apr 2005 21:54:36 +0900, "Shadow" wrote: It would be great if you explain how "C:\Program Files\Common Files\Microsoft Shared\MODI\11.0\MSPVIEW.EXE" /p "%1" can be used in vba. -- John Nurick [Microsoft Access MVP] Please respond in the newgroup and not by email. |
#9
|
|||
|
|||
"JohnFol" wrote:
PS best to use early binding. Only while testing and debugging. How do you know what version of the software, if any, are installed on the client system? Late binding means you can safely remove the reference and only have an error when the app executes lines of code in question. Rather than erroring out while starting up the app and not allowing the users in the app at all. Or when hitting a mid, left or trim function call. You'll want to install the reference if you are programming or debugging and want to use the object intellisense while in the VBA editor. Then,. once your app is running smoothly, remove the reference and setup the late binding statements. Sample code: ' Declare an object variable to hold the object ' reference. Dim as Object causes late binding. Dim objWordDoc As Object Set objWordDoc = CreateObject(" Word.Document") For more information including additional text and some detailed links see the "Late Binding in Microsoft Access" page at http://www.granite.ab.ca/access/latebinding.htm Tony -- Tony Toews, Microsoft Access MVP Please respond only in the newsgroups so that others can read the entire thread of messages. Microsoft Access Links, Hints, Tips & Accounting Systems at http://www.granite.ab.ca/accsmstr.htm |
#10
|
|||
|
|||
I'm so sorry. It's fixed now
"dan artuso" wrote in message ... Hey Shadow, Can you please fix your system clock? Your in the future, so that means you posts will remain on top for a while. Thanks Dan Artuso, MVP "Shadow" wrote in message ... Dim xwordobj as object set xwordobj = CreateObject(word.Application) the above code creates a reference to Mocrosoft word. How can I create a reference to Document Imaging ( an application in office2003)? ( I'm trying to print a .tif file. Van T. Dinh - Dan Aruso - Alex and Douglas J. Steele showed me how to print .doc and .pdf files through vba in a previous help request and now I'm trying to print a .tif file) Any kind of help is much appreciated |
|
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
CreateObject | John Nurick | General Discussion | 12 | April 20th, 2005 12:32 AM |
CreateObject fails second time | T101 | General Discussions | 1 | March 23rd, 2005 03:56 AM |
"permission denied" errors with CreateObject (runtime 70) | Maury Markowitz | General Discussion | 1 | February 7th, 2005 07:46 PM |