Hi,
So I've added the creation of the word instance to "Open Letter" button, and it seems to be working fine now. No error messages, at least.
Thanks for the links, and, yes, I agree that this is quite complicated. I've never thought that I will encounter all the possible problems when I...
hi and thanks again,
Didn't have a chance to do anything with this project today, but anyway....
Ok, I understand what happens. the user closes the document together with Word object by clicking "X" in Word. So, being able to close a doc this way but NOT Word would be a good idea.
Also, I'm...
Hi,
Well, thanks again. It seems it's working fine now. And no more multiple winword.exe in the processes.
However, there's one more thing I'd like to ask about the wdApp.Visible = True. I'm not even sure if this is withtin the scope of this thread, and I kinda feel bad for asking because I've...
Hi,
Didn't have a chance to lay my hands on this thing yesterday, but:
THANK YOU!!! YOU'RE A LEGEND!!! This is pretty much what I want to have. Yeah!!! :)
However, I have a question about Unload Me. At the moment the user closes the userform by closing the window with "X". Which is fine with...
Hi,
Thanks for tidying up my code.
"Really? Where is that? This is NOT in your code." Well, I thought that Set wdApp........ & Set wdDoc....... statements do that. After clicking the "Open letter" button, a new document FROM the template is being opened (and saved) and none of the changes...
Hi,
Thanks. This is the order of the things the user does (or at least that's how I want this userform to work):
1. User enters all data into textboxes and picks choices from checkboxes and comboboxes;
2. Clicks "Open letter";
3. A word doc is being opened and saved straight away;
4. The...
Hi,
So this is my code, after some translation :).Sorry, I don't know who to paste it properly, so I'll just quote it:
"
Sub FillWord_BM(wdApp As Word.Application, _
wdDoc As Word.Document, _
strBM As String, _
strText As String)
Dim r As Word.Range
Set r =...
Hi,
Loomah, I still get the "91" error.
It seems I've putting the "nothing" statements in wrong place, and that's why I was getting the error. However, I was following fumei's solution and I put them after the End With. But the error says "Run time error '91': Object variable or With block...
hi,
well...thank you, thank you, thank you:) it's all a bit clearer now.
however, i still get the same runtime error '91' at both "Set wdDoc = Nothing" and "Set wdApp = Nothing". And since I don't know what those statements do, I deleted them, and the form is still working. Any ideas?
sessionone
Thanks guys,
Tried fumei's code, and it does what I want it to do. Thank you! But after the code is executed and the doc is opened and saved, I get an error "Run time error '91': Object variable or With block variable not set". And this happens at "setwdDoc = Nothing" line.
Now I also need to...
hi,
Tried the add wsdoc.saveas, but nothing happens. Also changed the document to open to .dot, but if i change documents.open to documents.new, then i get an error. I'm probably doing it wrong.
hmm...
Hi,
Thanks for reply. The host app is excel, and the userform and buttons and code is in excel also.
The whole code is not long, and this is what I use to open the word doc:
"Private Sub cmdOpenLetter_Click()
Dim wdApp As Object
Dim wdDoc As Object
Set wdApp =...
thanks guys, all is sorted. used if for all possible situations. as in, if one = true and two = false, then "one", if one = false and two = true, then "two", if one = true and two = true then "one, two".
thanks for your time,
sessionone
Hi all,
I'm looking for some help with coding a print and save button. I have a userform in excel, which is used to enter data into a spreadsheet. the data from the userform is also used to populate bookmarks in a word doc template. (it's not a word template, just a predefined document.) by...
Hi all,
I'm looking for some tips on how to change bookmark string depending on how many checkboxes are checked on a userform.
I have 3 checkboxes: let's say "one", "two", "three". If "one" is checked then the bookmark string is "one", if "two" is chekced then the bookmark is "two" etc. But...
thanks skip for your suggestion. what i meant was that i need some info from the userform saved in the table but all of the info must go into the word document. so, if I use the table as the source for the word doc, then not all info will be in the doc.
"How 'bout save it in a DIFFERENT table...
Hi,
"Have you considered saving your data in a TABLE (sheet) in Excel and then connecting the data using the MailMerge feature in Word?"
Well, I thought about that, but I don't really need everything that I enter in the userform to be saved in the table. So, I figure, the data for the...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.