![]() |
#2
|
||||
|
||||
![]()
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] |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
dynamic charts based on mail merge fields | jwajehee | Mail Merge | 0 | 10-05-2011 09:47 AM |
![]() |
Vampy99 | Mail Merge | 7 | 09-25-2011 05:41 AM |
![]() |
morten_lysgaard | Mail Merge | 3 | 07-25-2011 11:19 PM |
![]() |
rekcots | Mail Merge | 2 | 05-18-2011 06:32 AM |
delete blank pages from mail merge document | blusea | Word | 0 | 12-17-2010 06:10 PM |