471,343 Members | 1,404 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,343 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}};
  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 2027

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
reply views Thread by rosydwin | last post: by

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.