Hello everyone.<\/p>\n
Please, I would like your help to the following issue.<\/p>\n
I have tried a lot to find the code to create a macro on MS Word. The macro I am trying to create, I need to make the following:<\/p>\n
Let’s say I have 4 .jpeg files. I insert these 4 files in a Word document via:<\/p>\n
Insert → Picture → From file…<\/p>\n
As far as it concerns wrapping text and the pictures, by default, the four pictures will be inserted in the document “In Line With Text”. I want to create a macro that will search all document, and every picture will find, to convert it to “In Front Of Text”.<\/p>\n
At the moment, without this macro, I have to make it manually:select one by one all pictures, and convert every time selected one to “In Front Of Text”.<\/p>\n
Is there a code to create such a macro?<\/p>\n
Thank you for your time!<\/p>","upvoteCount":5,"answerCount":4,"datePublished":"2025-06-11T08:36:38.060Z","author":{"@type":"Person","name":"serpico75","url":"https://community.spiceworks.com/u/serpico75"},"suggestedAnswer":[{"@type":"Answer","text":"
Hello everyone.<\/p>\n
Please, I would like your help to the following issue.<\/p>\n
I have tried a lot to find the code to create a macro on MS Word. The macro I am trying to create, I need to make the following:<\/p>\n
Let’s say I have 4 .jpeg files. I insert these 4 files in a Word document via:<\/p>\n
Insert → Picture → From file…<\/p>\n
As far as it concerns wrapping text and the pictures, by default, the four pictures will be inserted in the document “In Line With Text”. I want to create a macro that will search all document, and every picture will find, to convert it to “In Front Of Text”.<\/p>\n
At the moment, without this macro, I have to make it manually:select one by one all pictures, and convert every time selected one to “In Front Of Text”.<\/p>\n
Is there a code to create such a macro?<\/p>\n
Thank you for your time!<\/p>","upvoteCount":5,"datePublished":"2025-06-11T08:36:38.127Z","url":"https://community.spiceworks.com/t/ms-word-macros-create/1214175/1","author":{"@type":"Person","name":"serpico75","url":"https://community.spiceworks.com/u/serpico75"}},{"@type":"Answer","text":"
This may do what you are looking for. Create it as a macro, and run it after you’ve inserted all the pictures. Good luck!<\/p>\n
Sub testing()
\nDim shp As InlineShape
\nFor Each shp In ActiveDocument.InlineShapes
\nIf shp.Type = wdInlineShapePicture Then
\nshp.ConvertToShape.WrapFormat.Type = wdWrapFront
\nEnd If
\nNext shp
\nEnd Sub<\/p>","upvoteCount":4,"datePublished":"2025-06-11T10:51:36.306Z","url":"https://community.spiceworks.com/t/ms-word-macros-create/1214175/2","author":{"@type":"Person","name":"sbux2k","url":"https://community.spiceworks.com/u/sbux2k"}},{"@type":"Answer","text":"
I’m sure you are asking for a good reason, but just want to put in a warning here for random people reading this from an internet search:<\/p>\n
Pulling all the pictures in an existing document to “in front of text” will really mess up your document, and doing it one by one would normally be better so that you can make sure the document is still legible.<\/p>","upvoteCount":4,"datePublished":"2025-06-11T11:20:55.757Z","url":"https://community.spiceworks.com/t/ms-word-macros-create/1214175/3","author":{"@type":"Person","name":"Suzanne-Spiceworks","url":"https://community.spiceworks.com/u/Suzanne-Spiceworks"}},{"@type":"Answer","text":"
That’s perfect!!<\/p>\n
This is the code I was looking for:the code created the macro I wanted. Thanks a lot!!<\/p>","upvoteCount":1,"datePublished":"2025-06-12T10:29:20.524Z","url":"https://community.spiceworks.com/t/ms-word-macros-create/1214175/5","author":{"@type":"Person","name":"serpico75","url":"https://community.spiceworks.com/u/serpico75"}}]}}