Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Other Office > Word VBA
|
Word VBA Discuss using VBA to program Word.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Word VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 7th, 2007, 04:13 AM
Registered User
 
Join Date: Jun 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to finding the Graphic objects in word doc

Urgent:
Please someone help me out in finding the graphic objects present in the document (like chart, images, textboxes etc) but except (math type equations ( whose field code text will start with "EMBEDD equation"). THis should be done using VBA coding.

 i have used activedocuments.fields.code.text but it is used to get all the field codes except images.

 
Old June 8th, 2007, 04:03 AM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

You can use the shapes collection madhan

here is an example to get the textboxes

Sub TB_Focus()

    For i = 1 To ActiveDocument.Shapes.Count
      If ActiveDocument.Shapes(i).Type = msoTextBox Then MsgBox True
    Next i

End Sub


cheers
Shasur

http://www.vbadud.blogspot.com
 
Old August 8th, 2007, 10:38 AM
Authorized User
 
Join Date: Jul 2007
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to vksingh24
Default

To Find all the graphics, images, textboxes you can use the following code

Selection.Find.ClearFormatting
    With Selection.Find
        .Text = "^g"
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute

I hope it will be useful for you or write it detail about the math equations you r using

__________________
Vikash Kumar Singh





Similar Threads
Thread Thread Starter Forum Replies Last Post
Output Word WITH Template or Header Graphic Ron Howerton ASP.NET 2.0 Professional 1 October 31st, 2007 03:18 PM
Creating word doc - word behaviour mat41 Classic ASP Professional 2 April 29th, 2007 06:46 PM
Copy text from 1 doc to other doc thru vba in word itchock Word VBA 2 December 29th, 2006 02:47 AM
BLOB graphic files /.wmf into a Word doc mckly Pro VB Databases 1 July 2nd, 2004 02:18 AM
Copy word to word doc. in VB vamshi Pro VB 6 1 March 24th, 2004 06:25 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.