Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 08-21-2024, 08:52 PM
Guessed's Avatar
Guessed Guessed is online now Read into a variable a block of Word Document Windows 10 Read into a variable a block of Word Document Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,185
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

A simpler method of dealing with this data is to use split to break the entire document into a string array.
Code:
Sub Macro2()
  Dim arrClauses() As String, i As Integer
  arrClauses = Split(ActiveDocument.Range.Text, "#")
  For i = 1 To UBound(arrClauses) 'intentionally excludes entry before first #
    MsgBox arrClauses(i)
  Next i
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Read into a variable a block of Word Document error 91 object variable or with block variable not set ubrielbryne Word VBA 1 02-25-2019 11:15 AM
Run Time Error '91': Object variable or With block variable not set using Catalogue Mailmerge Berryblue Mail Merge 1 11-13-2014 05:36 PM
Read into a variable a block of Word Document Run-time error 91 object variable or with block variable not set JUST ME Word VBA 4 03-25-2014 06:56 AM
Read into a variable a block of Word Document object variable or with block variable not set MJP143 Excel 1 02-11-2013 05:07 AM
Read into a variable a block of Word Document Run-time error '91': Object variable or With block variable not set tinfanide Excel Programming 2 06-10-2012 10:17 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:33 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft