Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-05-2020, 03:12 AM
reneemettrie reneemettrie is offline Accessing the format tab with the macro recorder Windows 10 Accessing the format tab with the macro recorder Office 2016
Novice
Accessing the format tab with the macro recorder
 
Join Date: Jan 2020
Posts: 16
reneemettrie is on a distinguished road
Default Accessing the format tab with the macro recorder

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?
Reply With Quote
  #2  
Old 01-05-2020, 06:29 AM
gmayor's Avatar
gmayor gmayor is offline Accessing the format tab with the macro recorder Windows 10 Accessing the format tab with the macro recorder Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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
Reply With Quote
  #3  
Old 01-05-2020, 08:48 AM
reneemettrie reneemettrie is offline Accessing the format tab with the macro recorder Windows 10 Accessing the format tab with the macro recorder Office 2016
Novice
Accessing the format tab with the macro recorder
 
Join Date: Jan 2020
Posts: 16
reneemettrie is on a distinguished road
Default

Thanks, this code changes the formatting!
But not the correct way, I will skip changing the brightness and the contrast





Quote:
Originally Posted by gmayor View Post
Maybe something like

Code:
Sub Macro1()

Dim oShape As Shape
Dim oIlshape As InlineShape
    If Selection.InlineShapes.Count = 0 Then


***

     Set oShape = Nothing
    Set oIlshape = Nothing
End Sub

Last edited by Charles Kenyon; 01-10-2020 at 12:01 PM.
Reply With Quote
  #4  
Old 01-07-2020, 10:10 AM
Charles Kenyon Charles Kenyon is offline Accessing the format tab with the macro recorder Windows 10 Accessing the format tab with the macro recorder Office 2019
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,082
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

So, does that work for you?
Reply With Quote
  #5  
Old 01-07-2020, 12:02 PM
reneemettrie reneemettrie is offline Accessing the format tab with the macro recorder Windows 10 Accessing the format tab with the macro recorder Office 2016
Novice
Accessing the format tab with the macro recorder
 
Join Date: Jan 2020
Posts: 16
reneemettrie is on a distinguished road
Default

Quote:
Originally Posted by Charles Kenyon View Post
So, does that work for you?
As I said:Thanks, this code changes the formatting!
But not the correct way, I will skip changing the brightness and the contrast
Reply With Quote
  #6  
Old 01-07-2020, 05:03 PM
macropod's Avatar
macropod macropod is offline Accessing the format tab with the macro recorder Windows 7 64bit Accessing the format tab with the macro recorder 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

So delete/comment-out the offending lines and see what you end up with...
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 01-10-2020, 12:03 PM
Charles Kenyon Charles Kenyon is offline Accessing the format tab with the macro recorder Windows 10 Accessing the format tab with the macro recorder Office 2019
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,082
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Quote:
Originally Posted by reneemettrie View Post
As I said:Thanks, this code changes the formatting!
But not the correct way, I will skip changing the brightness and the contrast
That was why I asked. Your reply was ambiguous, at least to me.

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).
Reply With Quote
Reply

Tags
format tab, macro recorder

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing the format tab with the macro recorder 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
Accessing the format tab with the macro recorder Macro recorder and ShowFieldCodes Jennifer Murphy Word VBA 1 11-04-2012 01:55 AM
Accessing the format tab with the macro recorder Picture properties bug in Word 2010 Macro Recorder ralphpickering Word VBA 5 10-24-2012 10:15 AM
Accessing the format tab with the macro recorder Stumped by the recorder again Ulodesk Word VBA 6 07-02-2012 09:23 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:44 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