473,231 Members | 2,999 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,231 software developers and data experts.

Using the Photo Print Wizard in VBA

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 2138

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

Similar topics

0
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',...
1
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...
2
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...
3
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...
21
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...
5
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...
0
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...
2
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...
6
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...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, youll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...

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.