ok maybe backup was the wrong choice of words,
i'm making a cryptanalysis script which involves guessing to an extent, so if i guess the wrong set of characters and VB carries on manipulating the text and writing to the document, i want to be able to go back to the old text. so plain text is the only thing i want to be able to recover.
Black box
User Profile
Collapse
-
apollogies,
when i'm working on the text in a word document i want to make a backup so if i make a mistake i can come back to the original.
I need to copy the text out of the document, carry on working in that document and then copy the text back in.
any clearer?
black boxLeave a comment:
-
ok how can i apply this method to writing to the text file? the save as option doesn't quite do what i want.
black boxLeave a comment:
-
hate to be a pain but could you explan what each line of the code does, i don't just copy and paste code, i have to learn what it does.
Black boxLeave a comment:
-
that's fine, but later i need to refer back to that text. how would i do that?
black boxLeave a comment:
-
writing to an external file
hey guys,
just a quickie that's probably been asked a million times, but i couldn't find it when searching so here goes:
i need to copy the contents of a word document and paste it to an external file (.txt) using VBA how do i go about doing this?
cheers Black Box -
my mistake i'd left in the userform1.show above the code, then closed it to run the code underneath and it'd reset the .listcount to 0. works now.
cheers
black box...Leave a comment:
-
the "Thing list" isn't the problem it's the "For ndx = 0 To .ListCount - 1" line. When stepping through the code, it'll run the "with Thing" line, highlight the "For ndx = 0 To .ListCount - 1" and skip straight to "end with" on the next step. no error message it just runs through that same process for each lstb value....Leave a comment:
-
sorry if i sounded a little ungrateful on my last post i was a little busy, i think the problem is a misunderstandin g between VB6 and VBA and have managed to straighten most of it out there might be a few problems left firstly in the following:
...Code:For Each Thing In UserForm1.Controls ' thing is a control If TypeName(Thing) = "ListBox" Then For lstb = 1 To 8 With ThingLeave a comment:
-
hate to point it out that my VB doesn't like either of your responses, though they look as if they work in spectacular form it likes neither lstbox(a) (or ListBox(a)) or ListBox(lstb) (or lstbox(lstb))Leave a comment:
-
VBA listbox help
I have 8 list boxes and i need to compare values stored in them, i need to find the first non-numerical character in each line in each listbox and then compare between listboxes does anyone have any ides how to do this?
cheers
Black box -
message box automatic response
when finding/replacing in a certain part of word, word askes if you'd like to carry on and search the rest of the document, is there anyway of automating my response to this?
cheers
blackbox -
have managed to get it all to work, i made a silly mistake with the instr, it wouldnt let me search for chr(146) and i wouldn't let me use ' either so i used " ' " (without the spaces) so then it searched for exactly what i aske dit to, so used a var insteaed. small question: when searchnig through a certain part of a document it says it's finished and would i like to search the rest? the answer is always no but unfortunately i have to...Leave a comment:
-
instr still returns a value of "0" it's probably something to do with the text i'm using.
also do you happen to know / suggest code for counting the frequency of each letter in a document? i have managed to find some but it's rather long, if not could you tell me how to only find and replace in a certain part of the document?Leave a comment:
-
have sorted the variant problem just used do...loop
when i refer to a thisdocument it refers to the actual document as the code is written in the project rather than the normal.
i could go on asking problems all night if you want to stay and help?Leave a comment:
-
to be honest i might just elave it as i managed to re-write the code so it works using if then statements, roughly the same lenght just takes abit longer. the real reason i came on here again is a question about variants, if i want a to paste the entire contents of a variant how would i go about doing that?Leave a comment:
-
x = 1
With Selection
.GoTo what:=wdGoToPag e
.MoveRight unit:=wdCharact er, Count:=NumChars Before
.TypeText Text:=Chr(146)
x = InStr(1, ThisDocument, "'")
.MoveRight unit:=wdCharact er, Count:=x
UserForm1.ListB ox3.AddItem (Selection.Text )
Do
x = InStr(x, ThisDocument, "'")
.MoveRight unit:=wdCharact er, Count:=x
...Leave a comment:
-
thanks but when i use
x = InStr(1, ThisDocument, "'")
firstly if i leave out the 1 it takes "this document" as the start and secondly instr returns a value of 0 why? there definitely are ' in the text.
any suggestions? cheeers
blackboxLeave a comment:
-
For each... next help needed
For Each variant In ThisDocument
[statements]
Next variant
for the above code i need VBA to scan all of the document and find each " ' " but "thisdocume nt" doesn't work neither does "wholestory " anyone got any suggestions?
cheers Blacbox -
The most obvious solution seems to be involving a message box to display each sub directory as it is passed, and getting the user to check each one individually. if that's too time consuming and you're looking for a better solution then listing each sub directory at the end of the process and having the user check them then seems more time effective.
Try:
Msgbox "ok?" & subdirectory variable ,...Leave a comment:
No activity results to display
Show More
Leave a comment: