Solved

Picture insertion with Word VBA and Window integration

Posted on 2011-02-17
3
355 Views
Last Modified: 2012-05-11
Dear all,

I am thinking of designing a marco to simplify the picture insertion procedures by inserting the picture to cell(1,1) of the tables after clicking the pictures in the window explorer. Can anyone advise how to do it?


Thanks
0
Comment
Question by:Lawlords
  • 2
3 Comments
 

Author Comment

by:Lawlords
ID: 34917853
Just to clarity, each selected picture shall be inserted to cell(1,1) of the tables. (e.g. table 1, table 2 and so on..)
0
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 500 total points
ID: 34920067
You should know that that is extremely difficult. Remember that Windows Explorer is not COM-enabled. so you would need to find some API that could find the instance (there can be more than one) of the Explorer application that was last in focus (the focus now being on the Word application), and finding which, if any, graphic file(s) are selected and then inserting it or them as inline shapes into the given cell.

However it is relatively simple to create a macro that will open a dialogue, allow the user to select a graphics file and to insert the picture in a specific place. This would only differ from the built-in functionality in that the insertion would take place at a specific location (eg.a table cell) as opposed to the selection point.
0
 

Author Closing Comment

by:Lawlords
ID: 34936113
Thanks GrahamSkan, I will look for another way round.
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
My experience with Windows 10 over a one year period and suggestions for smooth operation
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question