Saving a doc with name from doc text
Author |
Message |
John Coh #1 / 7
|
 Saving a doc with name from doc text
I am new to VBA but find it interesting. Thanks in advance for any help. I want to save a Word document with the filename that is text contained in the document. I think I need to use a variable and the Save method. Any suggestions?
|
Tue, 14 Sep 2004 21:57:48 GMT |
|
 |
Dave Let #2 / 7
|
 Saving a doc with name from doc text
Hi John, Throw us a bone here. Do you want the filename to be the entire text of the document?? Do you want to save the file without displaying the SaveAs dialog box? You don't really need to use a variable, and you can use the saveas method. ActiveDocument.SaveAs _ FileName:=Replace("C:\" & ActiveDocument.Words(3) & ".doc", " ", ""), _ FileFormat:=wdFormatDocument HTH
Quote: > I am new to VBA but find it interesting. Thanks in advance for any > help. > I want to save a Word document with the filename that is text > contained in the document. > I think I need to use a variable and the Save method. Any suggestions?
|
Tue, 14 Sep 2004 22:27:30 GMT |
|
 |
John Coh #3 / 7
|
 Saving a doc with name from doc text
Dave, My apologies for not being very clear (I am new to newsgroups as well). I would like the filename to be text from two different bookmarks in the document that would be concatenated together. Thanks again. Quote:
> Hi John, > Throw us a bone here. Do you want the filename to be the entire text of the > document?? Do you want to save the file without displaying the SaveAs dialog > box? > You don't really need to use a variable, and you can use the saveas method. > ActiveDocument.SaveAs _ > FileName:=Replace("C:\" & ActiveDocument.Words(3) & ".doc", " ", ""), _ > FileFormat:=wdFormatDocument > HTH
> > I am new to VBA but find it interesting. Thanks in advance for any > > help. > > I want to save a Word document with the filename that is text > > contained in the document. > > I think I need to use a variable and the Save method. Any suggestions?
|
Wed, 15 Sep 2004 21:19:00 GMT |
|
 |
Chris Gree #4 / 7
|
 Saving a doc with name from doc text
Hi John, Howzabout: ActiveDocument.SaveAs "C:My Documents\" & ActiveDocument.Bookmarks _ ("MyBookmark1").Range.Text & ActiveDocument.Bookmarks("MyBookmark2").Range.Text HTH, Chris
Quote: > Dave, > My apologies for not being very clear (I am new to newsgroups as > well). > I would like the filename to be text from two different bookmarks in > the document that would be concatenated together. > Thanks again.
Quote: > > Hi John, > > Throw us a bone here. Do you want the filename to be the entire text of the > > document?? Do you want to save the file without displaying the SaveAs dialog > > box? > > You don't really need to use a variable, and you can use the saveas method. > > ActiveDocument.SaveAs _ > > FileName:=Replace("C:\" & ActiveDocument.Words(3) & ".doc", " ", ""), _ > > FileFormat:=wdFormatDocument > > HTH
> > > I am new to VBA but find it interesting. Thanks in advance for any > > > help. > > > I want to save a Word document with the filename that is text > > > contained in the document. > > > I think I need to use a variable and the Save method. Any suggestions?
|
Fri, 17 Sep 2004 02:21:00 GMT |
|
 |
John Coh #5 / 7
|
 Saving a doc with name from doc text
Hi Chris, Too COOL. I am on the right track. Any way to run this code from a protected form other than the Entry or Exit macros on the form field. Thanks again, John Quote:
> Hi John, > Howzabout: > ActiveDocument.SaveAs "C:My Documents\" & ActiveDocument.Bookmarks _ > ("MyBookmark1").Range.Text & > ActiveDocument.Bookmarks("MyBookmark2").Range.Text > HTH, > Chris
> > Dave, > > My apologies for not being very clear (I am new to newsgroups as > > well). > > I would like the filename to be text from two different bookmarks in > > the document that would be concatenated together. > > Thanks again.
> > > Hi John, > > > Throw us a bone here. Do you want the filename to be the entire text of > the > > > document?? Do you want to save the file without displaying the SaveAs > dialog > > > box? > > > You don't really need to use a variable, and you can use the saveas > method. > > > ActiveDocument.SaveAs _ > > > FileName:=Replace("C:\" & ActiveDocument.Words(3) & ".doc", " ", > ""), _ > > > FileFormat:=wdFormatDocument > > > HTH
> > > > I am new to VBA but find it interesting. Thanks in advance for any > > > > help. > > > > I want to save a Word document with the filename that is text > > > > contained in the document. > > > > I think I need to use a variable and the Save method. Any suggestions?
|
Fri, 17 Sep 2004 23:55:12 GMT |
|
 |
Doug Robbins - Word MV #6 / 7
|
 Saving a doc with name from doc text
Hi John, If you assign it to the keyboard or put a macro button on a toolbar, you can run it from a protected form. Please post any response to the newsgroups for the benefit of others who may also be following the thread. Hope this helps, Doug Robbins - Word MVP
Quote: > Hi Chris, > Too COOL. I am on the right track. > Any way to run this code from a protected form other than the Entry or > Exit macros on the form field. > Thanks again, > John
Quote: > > Hi John, > > Howzabout: > > ActiveDocument.SaveAs "C:My Documents\" & ActiveDocument.Bookmarks _ > > ("MyBookmark1").Range.Text & > > ActiveDocument.Bookmarks("MyBookmark2").Range.Text > > HTH, > > Chris
> > > Dave, > > > My apologies for not being very clear (I am new to newsgroups as > > > well). > > > I would like the filename to be text from two different bookmarks in > > > the document that would be concatenated together. > > > Thanks again.
> > > > Hi John, > > > > Throw us a bone here. Do you want the filename to be the entire text of > > the > > > > document?? Do you want to save the file without displaying the SaveAs > > dialog > > > > box? > > > > You don't really need to use a variable, and you can use the saveas > > method. > > > > ActiveDocument.SaveAs _ > > > > FileName:=Replace("C:\" & ActiveDocument.Words(3) & ".doc", " ", > > ""), _ > > > > FileFormat:=wdFormatDocument > > > > HTH
> > > > > I am new to VBA but find it interesting. Thanks in advance for any > > > > > help. > > > > > I want to save a Word document with the filename that is text > > > > > contained in the document. > > > > > I think I need to use a variable and the Save method. Any
suggestions?
|
Sat, 18 Sep 2004 17:53:16 GMT |
|
 |
John Coh #7 / 7
|
 Saving a doc with name from doc text
Quote: > Hi John, > If you assign it to the keyboard or put a macro button on a toolbar, you can > run it from a protected form. > Please post any response to the newsgroups for the benefit of others who may > also be following the thread. > Hope this helps, > Doug Robbins - Word MVP
> > Hi Chris, > > Too COOL. I am on the right track. > > Any way to run this code from a protected form other than the Entry or > > Exit macros on the form field. > > Thanks again, > > John
> > > Hi John, > > > Howzabout: > > > ActiveDocument.SaveAs "C:My Documents\" & ActiveDocument.Bookmarks _ > > > ("MyBookmark1").Range.Text & > > > ActiveDocument.Bookmarks("MyBookmark2").Range.Text > > > HTH, > > > Chris
> > > > Dave, > > > > My apologies for not being very clear (I am new to newsgroups as > > > > well). > > > > I would like the filename to be text from two different bookmarks in > > > > the document that would be concatenated together. > > > > Thanks again.
> > > > > Hi John, > > > > > Throw us a bone here. Do you want the filename to be the entire text > of > the > > > > > document?? Do you want to save the file without displaying the > SaveAs > dialog > > > > > box? > > > > > You don't really need to use a variable, and you can use the saveas > method. > > > > > ActiveDocument.SaveAs _ > > > > > FileName:=Replace("C:\" & ActiveDocument.Words(3) & ".doc", " ", > ""), _ > > > > > FileFormat:=wdFormatDocument > > > > > HTH
> > > > > > I am new to VBA but find it interesting. Thanks in advance for any > > > > > > help. > > > > > > I want to save a Word document with the filename that is text > > > > > > contained in the document. > > > > > > I think I need to use a variable and the Save method. Any > suggestions?
To All, Great help--thanks! ;)
|
Tue, 21 Sep 2004 22:38:50 GMT |
|
|
|