View Single Post
 
Old 01-28-2018, 01:50 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2013
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Martin

What you are asking sounds doable but would take more time than I have available at the moment. Macropod raised the question of inline vs floating shapes which would need to be answered but the basic (aircode) approach I would use is to loop the graphics and apply the heading 1 style at that point to work out the previous heading 1 number. You could also use a counter to keep track of how many graphics have already been found and reset that when the heading number increases.

My initial musings are
Code:
Sub ExportPicts()
  Dim aShp As InlineShape, i As Integer, sPath As String, sName As String
  Dim iCounter As Integer
  sPath = ActiveDocument.Path & Application.PathSeparator
  For Each aShp In ActiveDocument.InlineShapes
    iCounter = iCounter + 1
    aShp.Range.Paragraphs(1).Style = "Heading 1"
    i = aShp.Range.Paragraphs(1).Range.ListFormat.ListString - 1
    aShp.Range.Paragraphs(1).Style = "Normal"
    Debug.Print i, iCounter
    'not sure on the code to export inlineshape
  Next aShp
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote