#1
|
|||
|
|||
Inconsistency with split(string, vbNewLine)
Same text in two different bookmark in MS Word, separating with hard return.
First bookmark, I split at vbNewLine, all good. Second bookmark, vbNewLine fails, I must split at vbCr ? Yet, same text, same doc?? Thanks for the help |
#2
|
|||
|
|||
Very sorry, the project was protected.
Hope it is OK now. Thanks |
#3
|
||||
|
||||
I'm getting an unviewable project. Perhaps you can post your code here.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#4
|
|||
|
|||
Hi Guessed,
Thanks for helping, sorry for that. Let me do a last try with the file. Same problem on my side, no access to macro. I had to use the "Unblock a single file" in the doc properties before opening it?? a) Open Windows File Explorer and go to the folder where you saved the file. b) Right-click the file and choose Properties from the context menu. c) At the bottom of the General tab, select the Unblock checkbox and select OK. If file is fine, please run "FillFields" If not, well sorry, I will close the thread I found a fix using this function Code:
Function splitLineBreaks(ByVal str As String) As String str = Replace(str, vbCrLf, vbCr) str = Replace(str, vbLf, vbCr) splitLineBreaks = Split(str, vbCr) End Function Code:
'dt = Split(CorNot1VenueDate, vbNewLine) dt = splitLineBreaks(CorNot1VenueDate) |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Mistake in the help file for String "Split Function"? | John 4 | Word VBA | 6 | 11-19-2020 06:02 AM |
Mail Merge - split merged documents and rename each split document based on text in header | FuriousD | Word VBA | 1 | 05-12-2019 04:06 AM |
Split word file into several PDF using the bookmarks as split positions and name | Fixxxer | Word VBA | 7 | 10-08-2018 01:10 AM |
Inconsistency in Word Bibliography | yoel | Word | 4 | 02-15-2015 02:24 AM |
Way to search for a string in text file, pull out everything until another string? | omahadivision | Excel Programming | 12 | 11-23-2013 12:10 PM |