thesoxman
03-08-2006, 05:26 PM
Hey all,
I've run into a little bit of trouble here and hoping somebody can help. Basically I have a catalogue generator that generates various catalogues based on data passed into the document. So my function looks like:
Sub AutoOpen()
Call Catalogue("256")
Call Catalogue("123")
End Sub
Sub Catalogue(cartype)
....
...
Now my problem is that when the first instance of Catalogue is run it needs to be saved but then continue the macro on the ORIGINAL file. But using:
ActiveDocument.SaveAs(Filename)
makes the saved document the active one and therefore the script gets an error because the .ini file used to define other variables is located w/ the original file, not the new saved file. I have considered saving the New Catalogue document to the same directory as the original, but this isn't viable since when i open the new document the macro will run all over again and i'll lose the orignal work.
I know it's confusing but need a solution
Thanks
I've run into a little bit of trouble here and hoping somebody can help. Basically I have a catalogue generator that generates various catalogues based on data passed into the document. So my function looks like:
Sub AutoOpen()
Call Catalogue("256")
Call Catalogue("123")
End Sub
Sub Catalogue(cartype)
....
...
Now my problem is that when the first instance of Catalogue is run it needs to be saved but then continue the macro on the ORIGINAL file. But using:
ActiveDocument.SaveAs(Filename)
makes the saved document the active one and therefore the script gets an error because the .ini file used to define other variables is located w/ the original file, not the new saved file. I have considered saving the New Catalogue document to the same directory as the original, but this isn't viable since when i open the new document the macro will run all over again and i'll lose the orignal work.
I know it's confusing but need a solution
Thanks