![]() |
#1
|
|||
|
|||
![]()
Hello,
I'll start by saying that I do not know VBA at all, so any and all help will be GREATLY appreciated! I work in a manufacturing plant, and we have a macro that is used almost everyday to open and print *.Doc files. We are now adding bar codes to new documents to call up machine programs. The problem is that we start with a *.Docx file, but then have to save it as a *.Doc file for the macro to work. Doing this changes the bar code to an static image file, which then can not be edited. I'd like to edit our macro so that it will open both *.doc and *.docx files. I've tried several modifications to the macro with no luck. The problem always seems to come back to the file extension specified in the macro. I can change it to *.Docx, but then it doesn't work with the older files. Can someone show me how to open both types of files without specifying the extension? The section of the macro that calls the file is listed below. I'm sure it's probably a simple thing to fix, I just don't know how to do it. Thanks in advance for your help! Documents.Open FileName:="Z:\Travellers" & File & ".doc", _ ConfirmConversions:=False, ReadOnly:=True, AddToRecentFiles:=False, _ Revert:=False, Format:=wdOpenFormatAuto, XMLTransform:="" |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Cannot open files created in Word/show up as DOCX | Alcore | Office | 4 | 10-24-2021 02:08 AM |
![]() |
orealius | Word | 4 | 03-16-2019 08:11 AM |
![]() |
syeh11 | Word | 1 | 09-14-2015 10:16 PM |
How to open Docx files? | mond_bees | Word | 12 | 08-29-2012 03:32 AM |
Office 2007 will not open .docx files | Reg1987 | Word | 1 | 12-15-2010 11:55 AM |