Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-15-2011, 10:59 AM
rhino4eva rhino4eva is offline buttons to import a picture Windows XP buttons to import a picture Office 2003
Novice
buttons to import a picture
 
Join Date: Jun 2011
Posts: 1
rhino4eva is on a distinguished road
Smile 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
Reply With Quote
  #2  
Old 06-16-2011, 06:09 PM
macropod's Avatar
macropod macropod is offline buttons to import a picture Windows 7 32bit buttons to import a picture Office 2007
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 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.
Attached Files
File Type: doc InsertPic.doc (26.0 KB, 36 views)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 10-09-2012, 11:32 AM
Staind Staind is offline buttons to import a picture Windows 7 64bit buttons to import a picture Office 2010 64bit
Novice
 
Join Date: Oct 2012
Posts: 1
Staind is on a distinguished road
Default

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
Thanks so much in advance!



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
Reply With Quote
  #4  
Old 10-09-2012, 03:19 PM
macropod's Avatar
macropod macropod is offline buttons to import a picture Windows 7 64bit buttons to import a picture Office 2010 32bit
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

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]
Reply With Quote
Reply

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
buttons to import a picture 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

Other Forums: Access Forums

All times are GMT -7. The time now is 02:28 PM.


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