troubleshooting Question

Insert File at Bookmark

Avatar of dspace
dspace asked on
Microsoft Word
1 Comment1 Solution1255 ViewsLast Modified:
With Word 2003, I'm using the following code to insert a file at a bookmark:

If PathExists("C:\Taxes\Towns\" & PropCity & ".doc") Then
        ChangeFileOpenDirectory "C:\Taxes\Towns\"
        Set rngPara = ActiveDocument.Bookmarks("Town").Range
        With rngPara
            .Font.Size = 12
            .Font.Bold = False
            .InsertFile FileName:=PropCity & ".doc", ConfirmConversions:=False, Link:=False, Attachment:=False
        End With
 End If

This works fine and does what I want EXCEPT it seems to delete the bookmark.  If I look at my bookmarks after this code has run, the "Town" bookmark no longer exists.  Is there a way to prevent this from happening?

Thanks.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 1 Comment.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros