View Single Post
 
Old 12-03-2011, 01:11 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

Hi Saneman,

Presumably the licence # is in the same position for every licence. In that case, it's simply a matter of using a Range statement (eg StrName = .Range(1050,1060)). With the document you posted, for example, you can retrieve the licence # with:
Msgbox Activedocument.Range(104, 113)

To find where the licence #s appear in each Section, select the first one and use:
Code:
Sub test()
Dim StrName As String, i As Long, j As Long
With ActiveDocument
  i = .Range(Selection.Start).Start
  j = .Range(Selection.End).Start
  StrName = .Range(i, j)
  MsgBox "Start" & vbTab & "end" & vbTab & "String" & vbCr & i & vbTab & j & vbTab & StrName
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote