Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-13-2011, 11:21 AM
Biofodder Biofodder is offline Complete beginner needs some help. Windows Vista Complete beginner needs some help. Office 2010 32bit
Novice
Complete beginner needs some help.
 
Join Date: Mar 2011
Posts: 1
Biofodder is on a distinguished road
Default Complete beginner needs some help.

Hi. I am new to the forum and VBA in general and i really need some help. I am converting a whole bunch of .doc files, using Word 2007 to web pages and I am trying to build a macro to populate all of the alt text fields for all of the images in my word document with the same data. It sounds like a silly thing to do, I know, but I just need to set up placeholder data for another person to populate with more detailed information later.

The documents I am working on have 500+ images each so this would save me hours worth of time. I really am not sure where to start though. This is as far as I got before i realised I really had no idea what i was doing.

Code:
 
Sub Macro1()
 
Dim x As InlineShape
 
    For Each x In ActiveDocument.InlineShapes
        If x.AlternativeText <> "" Then
        x.AlternativeText = "test"
       
        End If
    Next
End Sub
Obviously it doesn't work, but I really don't know why. Any help would be greatly appreciated.
Reply With Quote
  #2  
Old 03-14-2011, 01:49 AM
macropod's Avatar
macropod macropod is offline Complete beginner needs some help. Windows 7 32bit Complete beginner needs some help. Office 2000
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi biofodder,

Your code works fine. You can test it with:
Code:
Sub Test()
Dim x As InlineShape
For Each x In ActiveDocument.InlineShapes
  MsgBox x.AlternativeText
Next
End Sub
Are you sure you are working with InlineShape objects (ie shapes formatted as in-line with text) and not Shape objects (ie shapes not formatted as in-line with text)?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Complete beginner needs some help. HELP...Beginner Leeroy4022 Word VBA 2 02-25-2011 02:16 AM
Advancing Slide After Animation is complete scottv1001 PowerPoint 0 10-06-2010 02:46 PM
Creating Forms for users to complete dalaurienzo Word 1 07-19-2010 04:12 PM
Using Office to complete and print Forms. eJames Office 2 01-08-2010 08:09 AM
Just a beginner...be nice please! Tommy Gun Project 1 02-18-2009 03:06 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:27 AM.


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