Home |
Search |
Today's Posts |
#1
|
|||
|
|||
get selected InlineShapes ID
I have word documents where lot of times need to replace tables from excel paste as windows metafile then resize to 70%. The normal method is very time consupting.
I tried to write a macro which delete the old table (win metafile - InlineShapes), then insert the new table (which is on the clipboard) as a win metafile (InlineShapes) then resize it. The macro working until resizing. Resize is also working if I know the InlineShape ID, but I unable to get what is the ID of the actually inserted InlineShape. I have approx. 50 InlineShapes and I replace eg. 10-35 the InlineShapes, but the ID-s always different. I couldn't find any method to get InlineShape ID in that line where the cursor stays or get the pasted InlineShape ID. Here is the macro: Sub Paste_resize() Selection.Delete Selection.PasteSpecial Link:=False, Placement:=wdInLine, DataType:=wdPasteMetafilePicture, DisplayAsIcon:=False ActiveDocument.InlineShapes(1).ScaleHeight = 70 ActiveDocument.InlineShapes(1).ScaleWidth = 70 End Sub Have anybody an idea to solving this problem? Thanks! Last edited by ghost01 : April 16th 13 at 06:14 PM |
#2
|
|||
|
|||
I solved the problem, not so nice code but working...
1. delete the selected part (shape or text) 2. insert the content from clipboard as a windows metafile as a shape 3. resize 4. convert to inplaneshape Sub Paste_resize() Selection.Delete Selection.PasteSpecial Link:=False, DataType:=wdPasteMetafilePicture, Placement:=wdFloatOverText, DisplayAsIcon:=False With ActiveDocument.Shapes(ActiveDocument.Shapes.Count) .Width = .Width * 0.7 .ConvertToInlineShape End With End Sub |
#3
|
|||
|
|||
That's okay, there will be another one along in a while and that will save opening another thread.
Last edited by Aries86 : November 19th 14 at 09:11 AM |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can't Tab Selected Text | New Users | |||
How do I go to a selected page? | Microsoft Word Help | |||
i cant paste what i have selected | Microsoft Word Help | |||
Selected Style gets updated from selected text | Page Layout | |||
Selected text | Microsoft Word Help |