Re: Email and possibly a Fax Question with Word
You can do this to save the document where you want with the name you want.
Do it before you close the doc so you dont need to be bothered saving again.
VB Code:
Documents(1).SaveAs "FileName:=" & app.Path & "\SomePreknownName_" & Format(Now, "MM-DD-YYYY_hh-mm-ss AMPM") & ".doc"
Re: Email and possibly a Fax Question with Word
I'm getting a 5096 error. It's saying something about the filename. its EEsD797.tmp. Any idea?
VB Code:
moApp.Documents(1).SaveAs "FileName:=" & App.Path & "\Listing" & Format(Now, "MM-DD-YYYY") & ".doc"
error is %1 is longer than 127 characters
Re: Email and possibly a Fax Question with Word
Sorry about that, there is no app.path in Office only Application.Path.
If that still gives an error then try hardcoding in a simple path and filename.
VB Code:
Documents(1).SaveAs "FileName:=" & Application.Path & "\Listing" & Format(Now, "MM-DD-YYYY") & ".doc"
Re: Email and possibly a Fax Question with Word
Same error even with a simple path. :(
I don't think it's document 1. It says Letter1
I got it. I didn't need Filename:=
Re: Email and possibly a Fax Question with Word
Ah, so when the "document" is not a Document the FileName:= is not a valid parameter label.
VB Code:
Documents(1).SaveAs Application.Path & "\Listing" & Format(Now, "MM-DD-YYYY") & ".doc"
Re: Email and possibly a Fax Question with Word
Last problem, is that it is not saving the merged letter. it is saving the query document. asks me if i want to run the sql statement.
I want to save the merged document.
Edit. I had doc(2). changed it to doc(1) and it comes up with the right info.
the problem is that the sql query is still there.
Re: Email and possibly a Fax Question with Word
Use the wdSendToNewDocument and then do the saveas on that document. You may
have to run the mm twice, but it would be the easiest solution. Run the mm to email, print, fax.
Then run it again to output it to a new document, save that new document and close. I dont
know if you output to a new document in the beginning if you would be able to still send it to
an email, printer, or fax though. Maybe try a test.
Re: Email and possibly a Fax Question with Word
the document stil has the query in it because it is set up as a mm document. I can't change the ds and have it work. it seems to add new records each time I open the new document. there were just 35 pages in it.
Maybe you could tell me how to save it as a RTF? That wouldn't merge, would it?
EDIT: It saved both as doc and rtf, and when I opened the rtf, it merged again
I just had a thought. The client can open the dot file and get a new list generated. Maybe we don't need to save the document in the first place.
Scratch that. There is no way to execute the merge. I tried....
Re: Email and possibly a Fax Question with Word
I guess I'll have to live with it. Any way to keep word hidden? It pops open in the foreground and then closes.
Thanks for the help.
Re: Email and possibly a Fax Question with Word
Sorry for the delay, was outside because it stopped raining.
No, they cant execute the MM unless they had access to the ds.
You can set the Word Application object's .Visibility property to False.
Re: Email and possibly a Fax Question with Word
Allright. I think that will wrap this one up. I read what you said about doing different MM's for each person, but that would mean generating them on the fly, which is beyond the scope of this project. The main things were printing and the labels. That is working correctly. The other things were email and fax. I wonder if the MM will work with different versions of Office, though. We have Office 2000, but did you say something wouldn't work with Office 2003?
I don't think that would be cool, and a work-around would have to be reached.
Re: Email and possibly a Fax Question with Word
The KB article was replicated for 2002 and 2003 also.
The workaround could be to use some third party fax software which creates
a fax printer. Then do a sendtoprinter pointing to the fax printer.
Re: Email and possibly a Fax Question with Word
But the email should work for all version?
Re: Email and possibly a Fax Question with Word
Yes, it should as long as they have internet access.
Re: Email and possibly a Fax Question with Word
Re: Email and possibly a Fax with Word [Resolved]
The email didn't work when I shipped it to a beta tester.
Now he wants to skip automation, as if you play a macro to email, it doesn't pop up the messages!
Can I use application.path in a macro? I think I'll be able to.