+ Reply to Thread
Results 1 to 2 of 2

open .dotm and save as .docx with filename from bookmark

  1. #1
    Forum Contributor
    Join Date
    06-05-2013
    Location
    Austria
    MS-Off Ver
    Excel 2016
    Posts
    165

    open .dotm and save as .docx with filename from bookmark

    Hy everyone,
    I try to write a macro that opens a template (.dotm) and save it as a .docx in the same directory as my workbook. I searched a lot and tried to find the mistake, but I have no chance. Here is my code:

    Please Login or Register  to view this content.
    Thanks a lot
    Kind Regards
    Roman

  2. #2
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: open .dotm and save as .docx with filename from bookmark

    Try:
    Please Login or Register  to view this content.
    Note: This code requires a reference to Word, via Tools|References, but I assume you already have that since you're already using Word constants. Templates should not ordinarily be opened; rather, you should use the .Add method to create a new document from them. The code will still fail, however, if the "Aktbezeichnung" bookmark is empty - you don't have any code to update it - or contains characters that are illegal for a filename.
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Using Workbook.Open Filename to Open a Cell Reference Filename
    By PerplexedMel in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-10-2014, 12:20 PM
  2. [SOLVED] Read out Filename and Save all Sheet as Filename.pdf
    By bluesurger in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-28-2014, 02:34 AM
  3. [SOLVED] Open .docx from Excel form using partial filename
    By pnmng49 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-02-2014, 01:30 PM
  4. Macro to save changes from dotm template to new docx file
    By Pius in forum Word Formatting & General
    Replies: 1
    Last Post: 01-30-2013, 03:02 AM
  5. [SOLVED] Open a .dotm so I could copy stuff in it.
    By stojko89 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-31-2012, 05:50 AM
  6. Replies: 0
    Last Post: 01-11-2006, 01:55 PM
  7. open pdf files with a certain bookmark or page number
    By Fendic in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-24-2005, 07:13 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1