[dba-Tech] Determine current position in Word

Arthur Fuller artful at rogers.com
Thu Aug 25 07:22:38 CDT 2005


This reply tipped me off and ended up simplifying my code. Since I already
had the document open I did not need the additional declares, and since I
was already inside a With Bookmarks block, I pared your suggestion down to
this:
        .Item("AdditionalInformationTable").Range.InsertFile
(CurrentRTFFile)
And it is working! Lovely! Thanks!
But since I live by the theory, If it works, break it, an additional
question: How can I provide a folder name for the user when she saves the
file? The system cannot predict what the user will choose to call the file,
but can predict where she wants to store it.
Thanks again,
Arthur

-----Original Message-----
From: dba-tech-bounces at databaseadvisors.com
[mailto:dba-tech-bounces at databaseadvisors.com] On Behalf Of Bryan Carbonnell
Sent: August 25, 2005 6:48 AM
To: Discussion of Hardware and Software issues
Subject: Re: [dba-Tech] Determine current position in Word

On 24/08/05, Arthur Fuller <artful at rogers.com> wrote:
> Now, I try your second example code fragment. I had a problem with the
line:
>         Set rng = doc.Bookmarks("BookmarkName").Range
> I changed it to:
>         Set rng = doc.Bookmarks.Item("AdditionalInformationTable")
> Then it compiled successfully (Access 2003). However, nothing is there in
> the resulting document where the table should be. All the other bookmarks
> have been successfully populated, but not the one where I want to plant
the
> table(s).
> I am obviously doing something wrong. Please tell me what it is.

A couple of things come to mind, keeping in mind I don't have O2K3 to test
with.

1) Does your doc variable point to the new document based on the template?
2) The line Set rng = doc.Bookmarks.Item("AdditionalInformationTable")
should actually be:
Set rng = doc.Bookmarks.Item("AdditionalInformationTable").RANGE
3) Is the document/template protected in way? (Tools|Protect Document...)
4) Try opening the rtf file in Word and then save it as a Word
document. It may not like inserting RTF.

The first 2 is my best guess as to why it's not working. The other 2
are just WAGs.

-- 
Bryan Carbonnell - carbonnb at gmail.com
Life's journey is not to arrive at the grave safely in a well
preserved body, but rather to skid in sideways, totally worn out,
shouting "What a great ride!"
_______________________________________________
dba-Tech mailing list
dba-Tech at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-tech
Website: http://www.databaseadvisors.com




More information about the dba-Tech mailing list