Save as docx from office 2003/XP/2000/97

C

Cold_Burn

Hi all.

Following the discussion that can be found at:

http://groups.google.com/group/micr...4?hl=en&tvc=2&q=save+as+docx+from+office+2003

As i could learn from that thread the FileFormat is variable by PC by
installation and by the number of file converters installed on the PC.

When i tested with Office 2003 the FileFormat was 100, (confirmed by
macro), and when i tested the same procedure with office XP (2002) the
FileFormat changed to 103 (confirmed by macro again)!

So it's variable.

The thread shows an example of how to dynamically get the FileFormat
number for saving .docx using VBA.
I'm using automation using OLE Objects so i'm having hard time
adapting the VBA example as i don't know how to access the
FileConverter through an OLE Object to know the number of the
FileFormat that is assigned to .docx.

Is there any way of doing it through the old school way? :)

So if anyone could give me a hand i would be very glad.

Thanks,
Cold_Burn
 
C

Cold_Burn

Well i have some news on the issue.

I can get the correct FileConverter to a OLEObject, get some of the
info's but i can't get the actual information that i wanted, the
dynamic SaveFormat number.

This is the code that i use:

ioo_objFileConv = this.ioo_obj.application.FileConverters.Item
("Word12")
ls_temp = ioo_objFileConv.ClassName --> "Word12"
ls_temp1 = ioo_objFileConv.FormatName --> "Word 2007 Document"
ls_temp2 = ioo_objFileConv.Extensions --> "docx"
lb_save = ioo_objFileConv.CanSave --> "false" :(
li_SaveFormat = ioo_objFileConv.SaveFormat ----> gives error

The CanSave property comes as false, but i have 100% certain that the
software is correctly installed.

Is there any other name for the FileConverter that is connected to the
Office compatibility pack?
I found one "MSWord12" here:

http://www.microsoft.com/brasil/msdn/tecnologias/visualc/convertedocs.mspx

but it doesn't work.

Thanks,
Cold_Burn
 
C

Cold_Burn

I'm back with some more news.Good news btw.

X-Files Music ON

On this link ( http://msdn.microsoft.com/en-us/library/bb215525.aspx )
you learn that there are two ways of getting a FileConverter object
from the FileConverters array. Check. Thank you teacher.

So it would be expectable that this two lines below would be
equivalent:

ioo_objFileConv = this.ioo_obj.application.FileConverters.Item
("Word12")

ioo_objFileConv = this.ioo_obj.application.FileConverters.Item(13) //
assuming that Word12 would be the 13 position on the FileConverter
array

humm,okay let's see if it's true.

1st way:

ioo_objFileConv = this.ioo_obj.application.FileConverters.Item
("Word12")
ls_temp = ioo_objFileConv.ClassName --> "Word12"
ls_temp1 = ioo_objFileConv.FormatName --> "Word 2007 Document"
ls_temp2 = ioo_objFileConv.Extensions --> "docx"
lb_save = ioo_objFileConv.CanSave --> "false" :(
li_SaveFormat = ioo_objFileConv.SaveFormat ----> gives error

2nd way:

Humm error on the 1st way! It would give the exact same error if i get
the object through the number on Item,rigth?

Lets see.

ioo_objFileConv = this.ioo_obj.application.FileConverters.Item(13)
ls_temp = ioo_objFileConv.ClassName --> "Word12"
ls_temp1 = ioo_objFileConv.FormatName --> "Word 2007 Document"
ls_temp2 = ioo_objFileConv.Extensions --> "docx"
lb_save = ioo_objFileConv.CanSave --> true :)
li_SaveFormat = ioo_objFileConv.SaveFormat ----> it doesnt gives
error

and works.

Scully help me out,plz...

X-Files Music OFF

Well it isn't the end.

If you search a bit you will find that the FileFormat changes
dynamically to the docx saving procedure when the FileConverter is
installed. And that the FileFormat of docx on 2000/XP/2003 would be
above 100. (I was getting 103 and 100 by macro recording)

So it would, (again) be expectable that the SaveFormat of the
FileConverter object would be above 100 right? No it isnt. Well thats
very very odd but it works. I got 17 on 2000 and 15 on XP.

So thats all for now.

Cold_Burn
 
C

Cindy M.

Hi Cold_Burn,
Following the discussion that can be found at:

http://groups.google.com/group/micr...mation/browse_thread/thread/9345dfb0fd519084?
hl=en&tvc=2&q=save+as+docx+from+office+2003

As i could learn from that thread the FileFormat is variable by PC by
installation and by the number of file converters installed on the PC.

When i tested with Office 2003 the FileFormat was 100, (confirmed by
macro), and when i tested the same procedure with office XP (2002) the
FileFormat changed to 103 (confirmed by macro again)!

So it's variable.

The thread shows an example of how to dynamically get the FileFormat
number for saving .docx using VBA.
I'm using automation using OLE Objects so i'm having hard time
adapting the VBA example as i don't know how to access the
FileConverter through an OLE Object to know the number of the
FileFormat that is assigned to .docx.
It's not really clear to me why you're having a problem "translating" the VBA to whatever language you're using.
Could you give us a sample of your code, plus whatever you've tried, indicate where it's failing, and with what
error information?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail
:)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top