Consulting

Results 1 to 9 of 9

Thread: Edit Picture Command and Update Field

  1. #1
    VBAX Newbie
    Joined
    Dec 2011
    Posts
    4
    Location

    Question Edit Picture Command and Update Field

    I have two seperate problems that I am trying to solve and cant figure them out. any help would be appricated.

    Edit Picture Command:
    I have .EMF file in Word that needs to be put into edit mode (right click and hit 'edit picture'). I tried to use the record macro function to do this and nothing shows up when I perform this action. Does anyone know how to set a picture into this mode using a VBA macro?

    Update Fields:
    I am trying to write a macro that will use the update 'entire table' command. I used the record macro function and it is the same command as if i just did a normal update field command. This seems like it should be simple, but cannot figure it out.


    If you need more clarification please let me know. Thank you

  2. #2
    VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,273
    Location
    Cross-posted at: http://www.msofficeforums.com/vba/10...te-fields.html

    For cross-posting etiquette, please read: http://www.excelguru.ca/node/7
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    VBAX Expert Tinbendr's Avatar
    Joined
    Jun 2005
    Location
    North Central Mississippi (The Pines)
    Posts
    992
    Location
    Quote Originally Posted by PatrickE
    If you need more clarification please let me know. Thank you
    Can you provide a sample? Will it be the only picture in the file?

    David


  4. #4
    VBAX Newbie
    Joined
    Dec 2011
    Posts
    4
    Location
    Quote Originally Posted by Tinbendr
    Can you provide a sample? Will it be the only picture in the file?
    I am guessing that you are working on the first problem.

    It will not be the only picture in the file, but it will be selected. I am iserting the picture using the line below. I would like to insert the picture then get it into edit mode.

    Selection.InlineShapes.AddPicture Filename:= _
    picFile, LinkToFile:=False, SaveWithDocument:=True

    Put http in front of: img842.imageshack.us/img842/5270/examplea.png

    Backround that may help: When I convert my word document to a PDF after i run all my macros the image in the PDF does not look as clear as it did. If i get the picture into edit mode before I convert it, the pciture looks good once converted.

    If you need more information I can try and provide more. Thanks

  5. #5
    VBAX Expert Tinbendr's Avatar
    Joined
    Jun 2005
    Location
    North Central Mississippi (The Pines)
    Posts
    992
    Location
    I don't think the Edit mode is exposed to the VBA project.

    update 'entire table' command
    I don't understand this.

    David


  6. #6
    VBAX Newbie
    Joined
    Dec 2011
    Posts
    4
    Location
    Quote Originally Posted by Tinbendr
    I don't think the Edit mode is exposed to the VBA project.

    I don't understand this.
    If it is not exposed to VBA then I am out of luck....

    I would be game for any other solutions to the problem. Problem: need to insert an image file into Word. Once I convert the word document into a PDF the text in the image is still searchable. Right now my solution is an EMF file. The only problem is that when i convert it to a pdf if looks wierd unless i can put it into 'edit mode.'

    Here is a link to what I am trying to do with the update entire field
    add http to this: img843.imageshack.us/img843/4723/example2s.png

    The command i use right now is:
    ActiveDocument.Fields.update

    Thank you for your help.

  7. #7
    VBAX Expert Tinbendr's Avatar
    Joined
    Jun 2005
    Location
    North Central Mississippi (The Pines)
    Posts
    992
    Location
    Quote Originally Posted by PatrickE
    The command I use right now is:
    ActiveDocument.Fields.update
    [vba]
    Activedocument.TableOfContents(1).Update
    [/vba]

    Additional TOC info

    I'm still looking at your EMF problem.

    David


  8. #8
    VBAX Newbie
    Joined
    Dec 2011
    Posts
    4
    Location
    Quote Originally Posted by Tinbendr
    [vba]
    Activedocument.TableOfContents(1).Update
    [/vba]

    Additional TOC info

    I'm still looking at your EMF problem.
    The advice for the updating the table of contents work out great. thank you

    I thought of a method that I could used to solve the EMF problem I just don't know how to impliment it.I can assign a quick key to do the 'edit picture' command. I just dont know how to press the key once I have assigned it.

    Is there anyway to do that

    Here is the text to set the command
    [vba]CustomizationContext = NormalTemplate
    KeyBindings.add KeyCode:=BuildKeyCode(wdKeyF12), KeyCategory:= _
    wdKeyCategoryCommand, Command:="EditPictureEdit"[/vba]

  9. #9
    VBAX Expert Tinbendr's Avatar
    Joined
    Jun 2005
    Location
    North Central Mississippi (The Pines)
    Posts
    992
    Location
    Look at SendKeys.

    David


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •