Options

Automation Word

mckornmckorn Member Posts: 5
Please Help!
I need trasfer navision date to word now I made tranfer text, but how I may tranfer BLOB (bitmap) and Date. Which Word Object Library I must use. May be you have same information about Word Object Library automation data type.
Thanks!

](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,)

Comments

  • Options
    mckornmckorn Member Posts: 5
    I Find Answerd!

    "Any data that is not Text or Code must be converted before it is passed to Word. so you have to use the FORMAT function to convert it to Text. The FORMAT function has the following syntax:
    String := FORMAT(Value [, Length] [, FormatNumber | FormatString])"

    If some one need help for this help ask me be I can help!
  • Options
    janpieterjanpieter Member Posts: 298
    probably you need to export the BLOB to a file with this system

    CALCFIELDS("BLOB Field");
    "BLOB Field".EXPORT('c:\tmp.bmp', FALSE);
    

    When you have done that you have to figure out the code that inserts the BMP as an image into word. Don't know the code needed for that but i have a tip:

    Start the macro recorder in word and simulate what you want to do in C/AL manually. When youre done stop the recorder and you will find VBA code in the VBA editor (SHIFT-F11). This code can be translated into a C/AL syntax.
    In a world without Borders or Fences, who needs Windows and Gates?
  • Options
    mckornmckorn Member Posts: 5
    I wont to use "Company Information" "Picture" (logo) export to word :?:
    Thanks :!:
  • Options
    janpieterjanpieter Member Posts: 298
    Did you try what i described ?
    In a world without Borders or Fences, who needs Windows and Gates?
  • Options
    mckornmckorn Member Posts: 5
    I don't real undersand what do you mean with macro recorder. What field in Word I need use if I want insert BMP fromNAVI. and there is saved picture of company logo on database how I may I use in my code. May be You may told me how that is your way how you get picture in word (in place there I need)
  • Options
    janpieterjanpieter Member Posts: 298
    ok a little more indepth detail then:
    CompanyInformation.GET();
    CompanyInformation.CALCFIELDS(Picture);
    CompanyInformation.Picture.EXPORT('c:\companylogo.bmp');
    

    This code i get from the macro editor in word but be aware this code only inserts a picture on the current cursor posistion:
    Selection.InlineShapes.AddPicture "C:\companylogo.bmp", False, True
    

    Plus this is Visual Basic Code so you have to translate it into C/Al.

    The macro recorder you can find in MS word, in the menu extra. The second code in this post is generated by the macro recorder. With the macro recorder you can simulate what you want to automate. It is the easiest way on discoverin how to automate things and works really good.
    In a world without Borders or Fences, who needs Windows and Gates?
  • Options
    JanStepanekJanStepanek Member Posts: 6
    Create word document to word template with predefined picture.
Sign In or Register to comment.