Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-13-2018, 01:27 AM
Nina Nina is offline Mac - Macro insert pictures in table Mac OS X Mac - Macro insert pictures in table Office 2016 for Mac
Novice
Mac - Macro insert pictures in table
 
Join Date: Aug 2018
Posts: 15
Nina is on a distinguished road
Default Mac - Macro insert pictures in table

Hello,

I'm looking for a macro that insert multiple pictures I've selected in an dialog into a tabel with 3 columns. Rows are automatically added based on the number of pictures.

I've had a macro that works in Windows, but I can't get it to work on a Macbook.

Can someone please help me?



Thanks,
Nina
Reply With Quote
  #2  
Old 08-13-2018, 01:37 AM
macropod's Avatar
macropod macropod is offline Mac - Macro insert pictures in table Windows 7 64bit Mac - Macro insert pictures in table Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

A possible Word for Windows candidate is: https://www.msofficeforums.com/word-...html#post47919. I don't know whether that would work on a Mac, however.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 08-13-2018, 02:20 AM
Nina Nina is offline Mac - Macro insert pictures in table Mac OS X Mac - Macro insert pictures in table Office 2016 for Mac
Novice
Mac - Macro insert pictures in table
 
Join Date: Aug 2018
Posts: 15
Nina is on a distinguished road
Default

Hello,

Thanks for the reply. I think I've used the code you are refering to on my windows pc. But it doesn't work on Mac. :-(
Reply With Quote
  #4  
Old 08-13-2018, 03:41 AM
macropod's Avatar
macropod macropod is offline Mac - Macro insert pictures in table Windows 7 64bit Mac - Macro insert pictures in table Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

For the necessary Mac modifications, see: https://answers.microsoft.com/en-us/...2-fc62e569fe5a
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 08-14-2018, 04:33 AM
Nina Nina is offline Mac - Macro insert pictures in table Mac OS X Mac - Macro insert pictures in table Office 2016 for Mac
Novice
Mac - Macro insert pictures in table
 
Join Date: Aug 2018
Posts: 15
Nina is on a distinguished road
Default

Hello,

thank you for the link. I now get it to open the window to select the images. However I am not able to select any...

The thing I want to achieve is the following:
Insert multiple pictures at once. They already have the same size. But when I insert them they stick together. There should be some whitespace in between. Maybe there is an other simpler way to align them all at once?
Reply With Quote
  #6  
Old 08-14-2018, 05:12 AM
Nina Nina is offline Mac - Macro insert pictures in table Mac OS X Mac - Macro insert pictures in table Office 2016 for Mac
Novice
Mac - Macro insert pictures in table
 
Join Date: Aug 2018
Posts: 15
Nina is on a distinguished road
Default

I was now playing around with find-replace
The best result is when I search for ^g and replace it with ^&^t^&^t^&^p^p this is more or less the look that I want. the only problem here is that now my images are added 2 more times.

When I replace by ^&^t the tab is added but the images still stick together in heigt. also starting from the second line the tab is added in the front. So not really what I want...
Reply With Quote
  #7  
Old 08-14-2018, 03:16 PM
macropod's Avatar
macropod macropod is offline Mac - Macro insert pictures in table Windows 7 64bit Mac - Macro insert pictures in table Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

You should be able to use a wildcard Find/Replace with:
Find = (^g)(^g)
Replace = \1^t\2^l^l
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #8  
Old 08-16-2018, 04:13 AM
Nina Nina is offline Mac - Macro insert pictures in table Mac OS X Mac - Macro insert pictures in table Office 2016 for Mac
Novice
Mac - Macro insert pictures in table
 
Join Date: Aug 2018
Posts: 15
Nina is on a distinguished road
Default

When I try this I get a message that ^g isn't a valid special character when using wild cards...

I tried to translate from Dutch, so I'm sorry if the words I used above aren't the correct ones.
Reply With Quote
  #9  
Old 08-16-2018, 06:04 AM
macropod's Avatar
macropod macropod is offline Mac - Macro insert pictures in table Windows 7 64bit Mac - Macro insert pictures in table Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

Hmm, according to the Find/Replace dialogue, ^g is valid with wildcards. No matter, try two ordinary Find/Replaces, with:
Find = ^g^g
Replace = ^&^l^l
and:
Find = ^g^l
Replace = ^t^&
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #10  
Old 08-17-2018, 05:08 AM
Nina Nina is offline Mac - Macro insert pictures in table Mac OS X Mac - Macro insert pictures in table Office 2016 for Mac
Novice
Mac - Macro insert pictures in table
 
Join Date: Aug 2018
Posts: 15
Nina is on a distinguished road
Default

Hello,

Getting close! now the images are with two on a row in stead of 3.

Is 3 possible? I have been playing around without any luck

thanks
Reply With Quote
  #11  
Old 08-17-2018, 05:14 AM
macropod's Avatar
macropod macropod is offline Mac - Macro insert pictures in table Windows 7 64bit Mac - Macro insert pictures in table Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

Try:
Find = ^g^g^g
Replace = ^&^l^l
then:
Find = ^g^l
Replace = ^t^&
then:
Find = ^g^t
Replace = ^t^&
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #12  
Old 08-17-2018, 05:43 AM
Nina Nina is offline Mac - Macro insert pictures in table Mac OS X Mac - Macro insert pictures in table Office 2016 for Mac
Novice
Mac - Macro insert pictures in table
 
Join Date: Aug 2018
Posts: 15
Nina is on a distinguished road
Default

got it! THANKS!!!
what I did is:
First: ^g^g^g replace by ^&^l

second: ^g replace by ^&^t

couldn't have done it without your help!

Is there a way to put this in a macro? so the user just has to push one button? (on a mac of course) I tried to record it, but nothing got recorded.
Reply With Quote
  #13  
Old 08-17-2018, 05:49 AM
macropod's Avatar
macropod macropod is offline Mac - Macro insert pictures in table Windows 7 64bit Mac - Macro insert pictures in table Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

Your approach will insert unnecessary tabs before the line breaks - and in some situations that could affect the overall layout.

For a macro, try:
Code:
Sub Demo()
Application.ScreenUpdating = False
With ActiveDocument.Range
  With .Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Forward = True
    .Wrap = wdFindContinue
    .Text = "^g^g^g"
    .Replacement.Text = "^&^l^l"
    .Execute Replace:=wdReplaceAll
    .Text = "^g^l"
    .Replacement.Text = "^t^&"
    .Execute Replace:=wdReplaceAll
    .Text = "^g^t"
    .Replacement.Text = "^t^&"
    .Execute Replace:=wdReplaceAll
  End With
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #14  
Old 08-17-2018, 06:03 AM
Nina Nina is offline Mac - Macro insert pictures in table Mac OS X Mac - Macro insert pictures in table Office 2016 for Mac
Novice
Mac - Macro insert pictures in table
 
Join Date: Aug 2018
Posts: 15
Nina is on a distinguished road
Default

Hello,

I used your macro and it works! :-)
The only problem is that when I have a line with only 2 images, no tab is added between them. That is why I used the other code I made.
Reply With Quote
  #15  
Old 08-17-2018, 06:07 AM
macropod's Avatar
macropod macropod is offline Mac - Macro insert pictures in table Windows 7 64bit Mac - Macro insert pictures in table Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

In that case, you could use:
Code:
Sub Demo()
Application.ScreenUpdating = False
With ActiveDocument.Range
  With .Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Forward = True
    .Wrap = wdFindContinue
    .Text = "^g^g^g"
    .Replacement.Text = "^&^l^l"
    .Execute Replace:=wdReplaceAll
    .Text = "^g"
    .Replacement.Text = "^&^t"
    .Execute Replace:=wdReplaceAll
    .Text = "^t^l"
    .Replacement.Text = "^l"
    .Execute Replace:=wdReplaceAll
  End With
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mac - Macro insert pictures in table Insert Pictures - Via MACRO sahrens1 Word VBA 1 07-02-2017 07:16 AM
Mac - Macro insert pictures in table How do I insert pictures directly into picture boxes by clicking the box instead of using INSERT>PIC Bree Word 1 06-24-2016 10:32 PM
Mac - Macro insert pictures in table Macro to insert multiple pictures with adjustable column size nando88 Word VBA 6 05-09-2016 11:56 PM
Mac - Macro insert pictures in table Insert an article with pictures into a table cell skatiemcb Word Tables 2 01-24-2015 08:18 AM
Mac - Macro insert pictures in table Macro to insert multiple pictures to word to a specific size and text wrap mescaL Word VBA 3 11-03-2014 10:51 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:25 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft