PDA

View Full Version : Edit Picture Command and Update Field



PatrickE
12-05-2011, 01:44 PM
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

macropod
12-05-2011, 03:56 PM
Cross-posted at: http://www.msofficeforums.com/vba/10097-edit-picture-command-update-fields.html

For cross-posting etiquette, please read: http://www.excelguru.ca/node/7 (wlmailhtml:{64CE8C15-0C83-4021-B475-A9AF6CEEA4DC}mid://00000010/!x-usc:http://www.excelguru.ca/node/7)

Tinbendr
12-06-2011, 07:49 AM
If you need more clarification please let me know. Thank youCan you provide a sample? Will it be the only picture in the file?

PatrickE
12-06-2011, 08:37 AM
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

Tinbendr
12-06-2011, 02:07 PM
I don't think the Edit mode is exposed to the VBA project.


update 'entire table' commandI don't understand this.

PatrickE
12-06-2011, 02:23 PM
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.

Tinbendr
12-07-2011, 07:17 AM
The command I use right now is:
ActiveDocument.Fields.update


Activedocument.TableOfContents(1).Update


Additional TOC info (http://word.mvps.org/faqs/Formatting/TOCJasonTabs.htm)

I'm still looking at your EMF problem.

PatrickE
12-07-2011, 03:37 PM
Activedocument.TableOfContents(1).Update


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
CustomizationContext = NormalTemplate
KeyBindings.add KeyCode:=BuildKeyCode(wdKeyF12), KeyCategory:= _
wdKeyCategoryCommand, Command:="EditPictureEdit"

Tinbendr
12-08-2011, 09:54 AM
Look at SendKeys.