I get an error message when I try to run
debug
.SaveAs FileName:=DocName, FileFormat:=wdFormatDocument
?docname
F:\My Documents\Test\Merge Eagle Hawk Angeleah Rose 10/15/2007 .doc
It looks alright?
I get an error message when I try to run
debug
.SaveAs FileName:=DocName, FileFormat:=wdFormatDocument
?docname
F:\My Documents\Test\Merge Eagle Hawk Angeleah Rose 10/15/2007 .doc
It looks alright?
A Filename cannot contain a / character.
If they are in your document and there's nothing you can do about it they can be removed in the code (or changed to another character, a hyphen perhaps).
Enjoy,
Tony
---------------------------------------------------------------
Give a man a fish and he'll eat for a day.
Teach him how to fish and he'll sit in a boat and drink beer all day.
I'm (slowly) building my own site: www.WordArticles.com
no its not in the file name so it's in the macro I cut and pasted it and then changed the drive I will retry now that I am home
oh its in the date eh?
OK I changed the date and tried to run it and I get
ambiguous name detected CreateDocnameAndEmail
and yes it would be great if did something to note no email address
Ambiguous name probably means you have two macros with the same name.
Enjoy,
Tony
---------------------------------------------------------------
Give a man a fish and he'll eat for a day.
Teach him how to fish and he'll sit in a boat and drink beer all day.
I'm (slowly) building my own site: www.WordArticles.com
Perhaps you could change ..
[VBA]If MailTo <> "" Then [/VBA]
to
[VBA]
If MailTo = "" Then
Msgbox "Document " & DocName & " not e-mailed. No mail id found"
Else
[/VBA]
If you may have lots you may want something more sophisticated.
Enjoy,
Tony
---------------------------------------------------------------
Give a man a fish and he'll eat for a day.
Teach him how to fish and he'll sit in a boat and drink beer all day.
I'm (slowly) building my own site: www.WordArticles.com
I thought ambiguous always meant there are two identical names. Although why the text of the error does not simply SAY that, I don't know.
...it is...ummmm, ambiguous.
I still get and I can find the error .. I removed the / and made sure the path is correct any ideas?
.SaveAs FileName:=DocName, FileFormat:=wdFormatDocument
Yes I have never understood the ambiguity as opposed to the duplicity.
Enjoy,
Tony
---------------------------------------------------------------
Give a man a fish and he'll eat for a day.
Teach him how to fish and he'll sit in a boat and drink beer all day.
I'm (slowly) building my own site: www.WordArticles.com
What is the DocName now?
Enjoy,
Tony
---------------------------------------------------------------
Give a man a fish and he'll eat for a day.
Teach him how to fish and he'll sit in a boat and drink beer all day.
I'm (slowly) building my own site: www.WordArticles.com
"C:\Documents and Settings\Administrator\My Documents\Test " & myRange.Text & ".doc"
Yes, but what value does myRange.text have when it errors?
Enjoy,
Tony
---------------------------------------------------------------
Give a man a fish and he'll eat for a day.
Teach him how to fish and he'll sit in a boat and drink beer all day.
I'm (slowly) building my own site: www.WordArticles.com
I thought I should clarify when try to run macro I get this error message
Run-time error 4198 command failed
When I do debug I get this highlighted yellow
.SaveAs FileName:=DocName, FileFormat:=wdFormatDocument
?docname
C:\Documents and Settings\Administrator\My Documents\Test Eagle Hawk Angeleah Rose Oct 15, 2007.doc
So I have checked path, seems correct.
What else should I look at ?
I hate "Command failed" messages - they give you nothing to go on.
Do you have authority to write to Administrator files?
Enjoy,
Tony
---------------------------------------------------------------
Give a man a fish and he'll eat for a day.
Teach him how to fish and he'll sit in a boat and drink beer all day.
I'm (slowly) building my own site: www.WordArticles.com
Yes it is the same file name used for the first macro and that worked
So the file already exists? That could explain it.
Enjoy,
Tony
---------------------------------------------------------------
Give a man a fish and he'll eat for a day.
Teach him how to fish and he'll sit in a boat and drink beer all day.
I'm (slowly) building my own site: www.WordArticles.com
What I meant is I used the same folders as the other one the folders are empty so the file does not already exist. I made the folders so it would have some place to put it
myRange.TextOriginally Posted by TonyJollans
When it gives the error message is the email address
But you don't want to be saving as the e-mail address. @ is not a valid character in a filename which will be why it fails.
Can you post exactly the code you are using when it fails?
Enjoy,
Tony
---------------------------------------------------------------
Give a man a fish and he'll eat for a day.
Teach him how to fish and he'll sit in a boat and drink beer all day.
I'm (slowly) building my own site: www.WordArticles.com