A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

CreateObject



 
 
Thread Tools Display Modes
  #1  
Old April 18th, 2005, 06:30 AM
John Nurick
external usenet poster
 
Posts: n/a
Default

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  
Old April 18th, 2005, 10:11 AM
JohnFol
external usenet poster
 
Posts: n/a
Default

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  
Old April 18th, 2005, 01:54 PM
Shadow
external usenet poster
 
Posts: n/a
Default

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  
Old April 18th, 2005, 05:50 PM
dan artuso
external usenet poster
 
Posts: n/a
Default

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  
Old April 18th, 2005, 08:44 PM
Shadow
external usenet poster
 
Posts: n/a
Default 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  
Old April 18th, 2005, 10:33 PM
John Nurick
external usenet poster
 
Posts: n/a
Default

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  
Old April 19th, 2005, 01:52 PM
Dirk Goldgar
external usenet poster
 
Posts: n/a
Default

"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  
Old April 19th, 2005, 04:29 PM
Shadow
external usenet poster
 
Posts: n/a
Default

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  
Old April 19th, 2005, 04:42 PM
Tony Toews
external usenet poster
 
Posts: n/a
Default

"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  
Old April 19th, 2005, 08:56 PM
Shadow
external usenet poster
 
Posts: n/a
Default

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 04:53 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.