473,785 Members | 2,235 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using the Photo Print Wizard in VBA

69 New Member
I posted this question originally in the Access forum but received no responses (probably was the wrong place to post it). At any rate, I'm hoping someone here might be able to help me.

I've added a Microsoft Office Document Imaging (MODI) viewer control on a form in Access to let me see the TIFF images referenced by records in a table. The MODI viewer control works just fine. My problem arises when I try to print TIFF images displayed in the control. The MODI component has a basic print method, but it doesn't let me change the paper size or orientation.

Instead, I though I would use the Microsoft Photo Print Wizard that comes with Windows XP. This is the same wizard used by Windows "Picture and Fax Viewer." I found an article on MSDN to tell me how to programatically launch the Photo Print Wizard. Problem is, the sample code is writen in C+!

Has anyone used the Photo Print Wizard in a VBA application and have some sample code I might be able to use? If not, any suggestions on how I could convert the following C+ code to Visual Basic for my VBA?

Expand|Select|Wrap|Line Numbers
  1. static const CLSID CLSID_PrintPhotosDropTarget = 
  2.   {0x60fd46de, 0xf830, 0x4894, {0xa6, 0x28, 0x6f, 0xa8, 0x1b, 0xc0, 0x19, 0x0d}};
  3.  
  4. // A data object that contains the list of photos to print.
  5. IDataObject* pDataObject;
  6.  
  7. // Create the Photo Printing Wizard drop target.
  8. CComPtr<IDropTarget> spDropTarget;
  9.  
  10. hr = CoCreateInstance(CLSID_PrintPhotosDropTarget,
  11.                       NULL,
  12.                       CLSCTX_INPROC_SERVER,
  13.                       IID_PPV_ARGS(&spDropTarget));
  14.  
  15. // Drop the data object onto the drop target.
  16. POINTL pt = {0};
  17. DWORD dwEffect = DROPEFFECT_LINK | DROPEFFECT_MOVE | DROPEFFECT_COPY;
  18.  
  19. spDropTarget->DragEnter(pDataObject, MK_LBUTTON, pt, &dwEffect);
  20.  
  21. spDropTarget->Drop(pDataObject, MK_LBUTTON, pt, &dwEffect);}
Thanks in advance for any help you might be able to give.

sphinney
Feb 13 '09 #1
0 2170

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1431
by: Kenneth A. Holm III | last post by:
Easy function that makes a pic look like a 3D photo. Needed images are included. Place images in directory called i //------------------------- function photoIt($_pic, $_float = 'right', $_alt = 'PCXPRESS') { if ( file_exists($_pic) ) { list($_w, $_h, $_t, $_a) = getimagesize($_pic); $_wide = $_w + 11 + 17;
1
3240
by: Xah Lee | last post by:
The following is a program to generate thumbnail images for a website. Useful, if you want to do that. It is used to generate the thumbnails for my “Banners, Damsels, and Mores” project gallery. ( http://xahlee.org/Periodic_dosage_dir/lanci/lanci.html ) Comments and versions in other lang welcome. Xah
2
3169
by: falloutphil | last post by:
Hi, I'm running a CGI script written in python that tars up the photos in user selected directories (via a form). It's running on Apache 1.3.31.1 on Solaris 5.8. It works well for a small amount of files, but when I try to use it for large archives (typically over 10MB, but this seems to vary) my download stops short. Occasionally I get an error message, this is usually a Broken Pipe (IO Error 32), but sometimes I don't see anything at...
3
8514
by: falloutphil | last post by:
Hi, First of all sorry for the double post - this is on the Python page too, but as far as I can see this is an Apache issue now. Mods - feel free to delete the similar titled posts from me on Python, if this is the case (can't seem to do it myself!). Anyway, I'm running a CGI script written in python that tars up the photos in user selected directories (via a form). It's running on Apache 1.3.31.1 on Solaris 5.8. It works well for a...
21
34439
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Uploading files from a local computer to a remote web server has many useful purposes, the most obvious of which is the sharing of files. For example, you upload images to a server to share them with other people over the Internet. Perl comes ready equipped for uploading files via the CGI.pm module, which has long been a core module and allows users...
5
21242
by: NJonge01 | last post by:
Greetings, I've read some great advice on similar topics, just nothing matching exactly what I'm trying I'm pretty close I think on making this work, but note quite there. I want to print a report that basically displays photographs. the photographs are located on a web server viewable from my browser. I want to reference the URL and "pull" them into my report at print time TABLE: In a Table, I have a field defined as Hyperlink. ...
0
2074
by: brendan | last post by:
I'm trying to write a code that batch renames photos. In the end each photo should be named: AABBB1111YYYYMM222 where AABBB1111 defines a given place. (i.e. CAMTL = montreal and four digits define the area in Montreal.) YYYYMM reveals the year and month that the photo was taken based on EXIF data. 222 allows for 999 photos of a given place in a given month.
2
2251
by: sphinney | last post by:
I've added a Microsoft Office Document Imaging (MODI) viewer control on a form to let me see the TIFF images referenced by records in a table. The MODI viewer control works fine. My problem arises when I try to print the TIFF image. The MODI component has a basic print method, but it doesn't let me change the paper size or orientation. Instead, I though I would use the Microsoft Photo Print Wizard that comes with Windows XP. This is the...
6
2400
by: piyusht | last post by:
Hello, I have a small piece of code to launch a file and print it to desired printer. The code is as follows: objProcess.StartInfo.FileName = "C:\test.jpg"; objProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden | ProcessWindowStyle.Minimized; objProcess.StartInfo.UseShellExecute = true; objProcess.StartInfo.CreateNoWindow = true; objProcess.StartInfo.ErrorDialog = false;
0
9646
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9484
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10350
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10097
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9957
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5386
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5518
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3658
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2887
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.