Hi =?Utf-8?B?Q2FzdG9yJlBvbGx1eA==?=,
Show us the code you've tried, please. And which version of Word are you using?
> I have read a couple of threads asking for similar stuff to what I'm looking
> for but can't seem to get anything to work for me!
[quoted text clipped - 9 lines]
> Not sure if I'm going about things right in the set-up of my document to
> start with so any advice is much appreciated.
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)
Castor&Pollux - 28 May 2008 07:51 GMT
Hi Cindy M
I am using Word 2003. I've tried playing with both of the following bits of
code which I pinched out of other threads in this forum.
With ActiveDocument
.SaveAs .Formfields("From").Result
End With
(I changed the "From" to the name of one of my ref fields).
AND
With ActiveDocument
.SaveAs "SW_COA_" & .Formfields("Text 2").Result & "_johnson.doc"
End With
(I got rid of the "SW_COA" & at the front, adjusted the "Text 2" to the name
of one of my ref fields and adjusted "_johnson.doc" to the remainder of my
proposed title).
The documents I am working on are templates for writing standardised
procedures. On closing, or saving the document I'd like the automatic
suggestion of "document title (SSAP) vX". Basically the "document title" and
the "X" would be the results entered in two fill-in fields (or ref fields if
need be).
I don't really have a great understanding of VBA as yet so the more straight
forward any direction, the better!
Let me know if you need any further info... hope it all makes sense!!!
Thanks
Castor&Pollux
> Hi =?Utf-8?B?Q2FzdG9yJlBvbGx1eA==?=,
>
[quoted text clipped - 21 lines]
> This reply is posted in the Newsgroup; please post any follow question or reply
> in the newsgroup and not by e-mail :-)
Cindy M. - 28 May 2008 11:10 GMT
Hi P&C,
> The documents I am working on are templates for writing standardised
> procedures. On closing, or saving the document I'd like the automatic
> suggestion of "document title (SSAP) vX". Basically the "document title" and
> the "X" would be the results entered in two fill-in fields (or ref fields if
> need be).
Right. Formfields are not the same as bookmarks, which is why you weren't able
to use the code snippets you found. A form field name is also a bookmark, but
the reverse does not apply.
The following shows you the approach I'd use. I may have not gotten the details
quite right (I don't know the bookmark names, for example), but you should be
able to adjust it to fit your needs.
Dim sDocTitle as String
Dim sX as String
Dim doc as Word.Document
Set doc = ActiveDocument
sDocTitle = doc.Bookmarks("Name").Range.Text
sX = doc.Bookmarks("otherName").Range.Text
doc.SaveAs sDocTitle & " (SSAP)v" & sX & *.doc"
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)