468,738 Members | 2,641 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,738 developers. It's quick & easy.

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}};
  4. // A data object that contains the list of photos to print.
  5. IDataObject* pDataObject;
  7. // Create the Photo Printing Wizard drop target.
  8. CComPtr<IDropTarget> spDropTarget;
  10. hr = CoCreateInstance(CLSID_PrintPhotosDropTarget,
  11.                       NULL,
  12.                       CLSCTX_INPROC_SERVER,
  13.                       IID_PPV_ARGS(&spDropTarget));
  15. // Drop the data object onto the drop target.
  16. POINTL pt = {0};
  19. spDropTarget->DragEnter(pDataObject, MK_LBUTTON, pt, &dwEffect);
  21. spDropTarget->Drop(pDataObject, MK_LBUTTON, pt, &dwEffect);}
Thanks in advance for any help you might be able to give.

Feb 13 '09 #1
0 1919

Post your reply

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

Similar topics

reply views Thread by Kenneth A. Holm III | last post: by
1 post views Thread by Xah Lee | last post: by
2 posts views Thread by xarzu | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.