Re: AutoNew or AttachAs "name??" to create file name from data

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




Please do not post the same problem to two different newsgroups.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
"JBark" <JBark@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:C81E8C6A-ADC8-4AB0-ABBD-97B9C21CADE6@xxxxxxxxxxxxxxxx
It tells me the full path name of the saved file - which is a good thing. At
least I know the full path is being stored. I've also had a conversation with
Jay about this and he is convinced the code will not execute to kill the file
because the macro is tied to the document and once the document is closed,
the code stops executing so the kill statement nevers gets read. (Which I
understand) He suggested I assign the macro to a custom toolbar and I did but
then the macro will not run at all. If I click the toolbar button, I get a
blank message box and all it says is Microsoft Visual Basic with a red circle
x.

"Doug Robbins - Word MVP" wrote:

If you replace the following part of your code

Dim Doc As Document
Dim DocPathName As String
Set Doc = ActiveDocument
DocPathName = Doc.FullName
Doc.Close wdDoNotSaveChanges
Kill DocPathName

with

Dim Doc As Document
Dim DocPathName As String
Set Doc = ActiveDocument
DocPathName = Doc.FullName
MsgBox DocPathName

what does the message box display?

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
"JBark" <JBark@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:DBF9218F-D3AA-460B-A83F-7F08BBADFE6D@xxxxxxxxxxxxxxxx
>I guess I just don't know enough as to how to sequence everything >together
> properly so that the full file name with its path will be remembered so > it
> can be deleted when the kill statement is executed.
>
> "Doug Robbins - Word MVP" wrote:
>
>> Here is what the VBA Help file says on it:
>>
>> Kill Statement
>>
>> Deletes files from a disk.
>>
>> Syntax
>>
>> Kill pathname
>>
>> The required pathname argument is a string expression that specifies >> one
>> or
>> more file names to be deleted. The pathname may include the directory >> or
>> folder, and the drive.
>>
>> Remarks
>>
>> In Microsoft Windows, Kill supports the use of multiple-character (*) >> and
>> single-character (?) wildcards to specify multiple files. However, on >> the
>> Macintosh, these characters are treated as valid file name characters >> and
>> can't be used as wildcards to specify multiple files.
>>
>>
>>
>> -- >> Hope this helps.
>>
>> Please reply to the newsgroup unless you wish to avail yourself of my
>> services on a paid consulting basis.
>>
>> Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
>> "JBark" <JBark@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:1106529F-E7ED-43E2-A369-DB40865FE3A9@xxxxxxxxxxxxxxxx
>> > All I really need to know at this point is how I can get the kill
>> > command
>> > to
>> > work with the .display mode instead of the .send mode. Is it >> > possible?
>> > I
>> > really appreciate your feedback. Thanks.
>>
>>



.



Relevant Pages

  • Re: AutoNew or AttachAs "name??" to create file name from data
    ... Dim Doc As Document ... Dim DocPathName As String ... can be deleted when the kill statement is executed. ...
    (microsoft.public.word.vba.general)
  • Re: CAT LADY WANTED
    ... I kill a lot of threads myself, ... you would understand....but I will not relate, this is a cat newsgroup ... hit, ... Brits ruled not only the waves, but the airwaves and fashion waves ...
    (rec.pets.cats.anecdotes)
  • Re: Is it worth being here?
    ... our neighborhoods is often much easier than in a newsgroup. ... I'm sure that I'm a permanent resident in some kill ...
    (rec.food.cooking)
  • Computers for disabled Veterans
    ... >day to evade everyone's kill filters. ... S.D. saw the link to the website for my project to ... Then S.D. went to the newsgroup and bragged about making ... >online, but I would like to see the idea spread to other areas. ...
    (sci.electronics.design)
  • Re: Lower interest rate
    ... Come and try to kill me! ... it is your maniac mind to have such idiotic thinking: ... even the communists' dogs have said that in newsgroup.) ... except those communists' dogs, who are fed to tell lies and/or to throw ...
    (soc.culture.china)