Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-16-2012, 12:42 PM
The Orange The Orange is offline Word 2010 mismatched images Windows 7 64bit Word 2010 mismatched images Office 2010 64bit
Novice
Word 2010 mismatched images
 
Join Date: Jul 2012
Posts: 5
The Orange is on a distinguished road
Default Word 2010 mismatched images

I'm working with Word 2010 to put together some nametags. Each set of nametags contains anywhere from 300 - 600 names. I take the images out of an image in paint and put them into Word onto the nametags.



Everything was working fine until lately, where this strange issue started showing up: In a large majority of my files, the first 1 - 15 images would actually be other random images from the document.

To clarify, the first few show the images they're supposed to be, yet when I print them they display a different image. Also, if I double click the image to open in paint, it shows the wrong image as well.

Here's a screenshot of what's happening:


I think I've narrowed this down to one of three things.
  1. My macro that I wrote is probably poorly written and could be causing it, see below for more details.
  2. I'm saving the nametags in dropbox.
  3. Word freezes up for a few minutes whenever I save, it could be corrupting the file during that frozen period. I have a strong core i5 cpu, so it's definately word, not me causing the freezing.

Here's the macro I've been using:
Code:
Sub FormatPicture()    
    Selection.PasteSpecial Link:=False, Placement:=wdWrapTight, _
        DisplayAsIcon:=False

    With Selection.ShapeRange
        .LockAspectRatio = msoTrue

        .Height = InchesToPoints(1.4)
        
        .WrapFormat.Type = wdWrapTight
        
        .IncrementLeft 50
        .IncrementTop -5
    End With

End Sub
Any help would be great. Thank you in advance.
Reply With Quote
  #2  
Old 07-16-2012, 08:24 PM
macropod's Avatar
macropod macropod is offline Word 2010 mismatched images Windows 7 64bit Word 2010 mismatched images Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,250
macropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant future
Default

If your image & name data are held in, say, a database, Excel workbook or a Word table, you could probably achieve the desired outcome with no vba at all, using Word's mailmerge tools.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 07-16-2012, 10:35 PM
The Orange The Orange is offline Word 2010 mismatched images Windows 7 64bit Word 2010 mismatched images Office 2010 64bit
Novice
Word 2010 mismatched images
 
Join Date: Jul 2012
Posts: 5
The Orange is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
If your image & name data are held in, say, a database, Excel workbook or a Word table, you could probably achieve the desired outcome with no vba at all, using Word's mailmerge tools.
The name data is pulled through a mailmerge, but the images come straight from a scanned yearbook page. It would be a lot of extra work to cut each one out and save it and then link it in the database.
Reply With Quote
  #4  
Old 07-16-2012, 10:38 PM
macropod's Avatar
macropod macropod is offline Word 2010 mismatched images Windows 7 64bit Word 2010 mismatched images Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,250
macropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant future
Default

Actually, if the image names are the same as the names in the database, you don't need both to be in the database; the mailmerge can use the name field for referfencing the images.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 07-16-2012, 10:41 PM
The Orange The Orange is offline Word 2010 mismatched images Windows 7 64bit Word 2010 mismatched images Office 2010 64bit
Novice
Word 2010 mismatched images
 
Join Date: Jul 2012
Posts: 5
The Orange is on a distinguished road
Default

This would still require the cropping and saving of each image, instead of selecting and copying them. This is something I'd like to avoid.
Reply With Quote
  #6  
Old 07-16-2012, 10:56 PM
macropod's Avatar
macropod macropod is offline Word 2010 mismatched images Windows 7 64bit Word 2010 mismatched images Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,250
macropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant future
Default

So you're doing this manually for 300 - 600 images per file? For safety, you really should be saving these to disk, cropped so that each image represents one student, before adding them to Word. If you don't, you risk losing the lot if the document becomes corrupted - which it's already showing signs of.

FWIW, if you're using the docx format your existing images can easily be extracted by changing the file's extension to .zip, then opening the file as a zip archive from where you can readily copy the images to a folder.

As for the cropping concerns, perhaps you could explain the current process? In any half-decent graphics program (even Windows Paint) you should be able to select an area then save the selection as a new file (copying to a new file might be required first).
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 07-16-2012, 11:12 PM
The Orange The Orange is offline Word 2010 mismatched images Windows 7 64bit Word 2010 mismatched images Office 2010 64bit
Novice
Word 2010 mismatched images
 
Join Date: Jul 2012
Posts: 5
The Orange is on a distinguished road
Default

I'm not doing it entirely manually. I use programmable keys on my keyboard. One to select and copy the picture (using a mousekeys macro) and another to trigger the macro in Word. It takes me about 45 minutes to an hour to do 400 nametags depending on my concentration.

The macro first exectutes a paste special -> As image to get the image on the nametag correctly. It then sets the word wrapping, size, and position.

I see what you mean by saving them for safety though. I hadn't thought about it that way.

Would it cause issues to link to non-existant files (name + .png) in the merge? That would mean I would just have to cut the pictures out and save them into the directory it's pointing too.
Reply With Quote
  #8  
Old 07-16-2012, 11:19 PM
macropod's Avatar
macropod macropod is offline Word 2010 mismatched images Windows 7 64bit Word 2010 mismatched images Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,250
macropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant future
Default

The only negative issue I'm aware of with mailmerges is that, if there is no image file for a particular record, some Word versions repeat the image from the previous record - other versions output either a blank rectangle or an error message. The simple solution is to ensure there is an image file for every record. Where you don't have a picture, substitute a generic image file (perhaps with the words 'no picture available' on it).

If you do decide to go down the mailmerge route, let me know as there are some setup issues you might need help with.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #9  
Old 07-16-2012, 11:21 PM
The Orange The Orange is offline Word 2010 mismatched images Windows 7 64bit Word 2010 mismatched images Office 2010 64bit
Novice
Word 2010 mismatched images
 
Join Date: Jul 2012
Posts: 5
The Orange is on a distinguished road
Default

Unfortunately I'm finished with the nametags for now (there were 15 sets), and won't have a new set to work with for quite a while. I have another set re-exported for testing purposes (I'm not in charge of the merge though). I'll let you know if something comes up.
Reply With Quote
Reply

Tags
images, macro, word 2010

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't paste images into Word! Jemko Word 1 02-18-2012 09:53 AM
Word 2010 mismatched images Mail Mege Images - Path Correct but Images Repeated Sonia Sosa Mail Merge 8 04-22-2011 03:05 PM
Word 2010 mismatched images Word - inserting images sulasno Drawing and Graphics 4 04-09-2011 07:28 AM
Word 2010 mismatched images Why are images so big when inserted into Word? WaltR Word 2 02-13-2011 10:43 PM
Word 2010 mismatched images Fit 2 Images on Same Line in Word 2010 questiona Drawing and Graphics 2 01-03-2011 03:07 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:08 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2022 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft