![]() |
|
#1
|
|||
|
|||
|
I am writing a manual with many screenshots. Some of the are too pale for printing, so I go to format-color-B&W75%. I would like to do this action with a macro. As I know VBA in Excel and Access but not in Word, I try to do this with the recorder, but as soon as I start it the Format tab is inactive. How can I solve this problem? Or is the anyone who can tell me which code to use? |
|
#2
|
||||
|
||||
|
Maybe something like
Code:
Sub Macro1()
Dim oShape As Shape
Dim oIlshape As InlineShape
If Selection.InlineShapes.Count = 0 Then
If Selection.ShapeRange.Count = 1 Then
Set oShape = Selection.ShapeRange(1)
With oShape.PictureFormat
.ColorType = msoPictureBlackAndWhite
.Brightness = 0.1
.Contrast = 0.75
End With
Else
MsgBox "No shape selected"
End If
Else
Set oIlshape = Selection.InlineShapes(1)
With oIlshape.PictureFormat
.ColorType = msoPictureBlackAndWhite
.Brightness = 0.1
.Contrast = 0.75
End With
End If
Set oShape = Nothing
Set oIlshape = Nothing
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
#3
|
|||
|
|||
|
Thanks, this code changes the formatting!
But not the correct way, I will skip changing the brightness and the contrast Last edited by Charles Kenyon; 01-10-2020 at 12:01 PM. |
|
#4
|
|||
|
|||
|
So, does that work for you?
|
|
#5
|
|||
|
|||
|
As I said:Thanks, this code changes the formatting!
But not the correct way, I will skip changing the brightness and the contrast |
|
#6
|
||||
|
||||
|
So delete/comment-out the offending lines and see what you end up with...
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
#7
|
|||
|
|||
|
Quote:
It is easy to skip the brightness and contrast. As Paul pointed out, you can delete those lines, or you can place a single apostrophe at the beginning so that they will be skipped (comment them out). |
|
| Tags |
| format tab, macro recorder |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
copying text with Word's macro recorder
|
cheech1981 | Word VBA | 4 | 11-29-2018 09:25 PM |
| Macro recorder changing reference style for columns in pivot source | andylaw31 | Excel Programming | 0 | 06-15-2016 08:45 AM |
Macro recorder and ShowFieldCodes
|
Jennifer Murphy | Word VBA | 1 | 11-04-2012 01:55 AM |
Picture properties bug in Word 2010 Macro Recorder
|
ralphpickering | Word VBA | 5 | 10-24-2012 10:15 AM |
Stumped by the recorder again
|
Ulodesk | Word VBA | 6 | 07-02-2012 09:23 AM |