#1
|
|||
|
|||
buttons to import a picture
Hi,
i work in a laboratory where images are taken of electrophoresis gels. i need to design a standard word document that will import a picture into the doc. Most of our staff are not very word savvy, so i had an idea but dont know if i can do it. i need a "frame" of fixed dimensions within my doc. inside the frame is a "click here" button assigned to macro that will use an opendialog box to select from a list of jpg's(say in c:\gels) and place it in the frame, resizing as it completes. i have some success with vba/macros/buttons in excel but i am struggling in word Any help would be gratefully received |
#2
|
||||
|
||||
Hi rhino4eva,
If you create a fixed-size table cell and insert a picture into that, Word will automatically re-size the picture so that it fits the cell, preserving the original scaling. For the 'click here' to insert the picture, you could use a MACROBUTTON field to trigger the macro. See attached.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Hi,
So I created the fixed-size field for the picture in a form with drop down lists and text fields. I also created a command button to reset all the drop down and fields back to blank at click, which works beautifully. However, I'm struggling with resetting the picture content form field. Can you help me with a code for the command button that will 'reset' the picture content form field back to 'blank'? Just FYI, the current code for the reset command button is: Code:
Sub CommandButton1_Click() Dim oFF As FormField For Each oFF In ActiveDocument.Range.FormFields Select Case oFF.Type Case Is = wdFieldFormTextInput oFF.Result = "" Case Is = wdFieldFormDropDown oFF.DropDown.Value = 1 Case Is = wdFieldFormCheckBox oFF.Result = False End Select Next oFF End Sub EDIT: I realized that this question might be more apt in the Word VBA box, but since there's a thread on picture content form field, I thought I'd ask it here Last edited by macropod; 10-09-2012 at 03:09 PM. Reason: Added code tags and formatting |
#4
|
||||
|
||||
The is no 'picture content form field'. As indicated in my previous post, the picture can go directly into the table cell.
To clear the picture from the table you could use code like: ActiveDocument.Tables(1).Range.Cells(1).Range.Dele te Whilst there is a picture content control, your code suggests you're only working with formfields. Equally, I'm not sure why you're referencing formfields from a userform - usually, you'd use one or the other.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Help! I can't get the buttons to work! | Alicia | PowerPoint | 0 | 02-19-2011 01:48 PM |
Can I insert a picture into a picture ? | alexcalgary | Drawing and Graphics | 2 | 10-16-2010 03:29 PM |
Removing `form buttons` in VBA? | mrphilk | Excel | 0 | 06-15-2010 01:25 PM |
command buttons | ronf | Excel | 0 | 04-28-2006 08:32 AM |
command buttons | ronf | Excel | 0 | 12-03-2005 06:26 AM |